How can i convert *Mnu.rc() to .mnu?

Started by duyangan, July 26, 2007, 11:08:00 AM

Previous topic - Next topic

duyangan

How can i convert *Mnu.rc() to .mnu?

I favor radasm much more!

KetilO

The hard way, by hand. Unless you create a converter program.

KetilO

ramguru

#2
Damn...this is what it cost to read new post, now look what you made me to do (see attachment )
OK I will tell ya how to make this piece of junk work properly:

  • rc should contain only MENUEX resource
  • of course #define statements should be above MENUEX declaration
  • there should be IDR_MENU bla bla for each menuitem, popup (I mean #define IDR_MENU1 12001 etc.)
  • that's about it...

This converter doesn't take into account:

  • hotkeys
  • state stuff
These for next time

Also assuming I haven't looked at RadASM  source-code (swore not to..), I could miss something important...
Poorly tested...

Was listening to niggaz rap, watching TV & coding at the same time, don't expect code to be readable...

Attachment in last post....

ramguru

I found one bug (f.e. MENUITEM "",...) the problem is quotes, so you have to change it to MENUITEM " ",... in order to work.
I've of course already fixed it but not ready to upload new version...

Just out of curiosity does anyone needs rc 2 dlg ..  I can code it to in no-time (almost :) )

no_feedback EQU no_updates

KetilO

Thanks ramguru

The rc2mnu works well with the limitations you mention.
Some improvements would be great.

rc2dlg is rather complex and the latest version of ResEd has an option to save dialogs as RadASM .dlg files.
But it would be great to have a simple tool to do this.

KetilO

ramguru

#5
OK here it is!
Serious update:
...Now Rc2Mnu works almost perfectly
...#define statements became optional
...Now hotkeys are supported
...States are supported
...Fixed many bugs

One remark: every menuitem should have ID even if it's menubreak (in this case ID can be 0), everything else - flexible
File should contain only MENUEX resource rule remains.
I should also mention that to implement hotkeys support was a nightmare (some insane design, no offense :) )

I haven't started rc2dlg mini_project yet, I'll see - if I can do something about it, I will

Edit> how come dlg template isn't 2 aligned:
> 485b (header)
> 341b (for each item)

Attachment in last post....

ramguru

I have a working prototype again  :bg
Now my the app can convert rc file containing only MENUEX or DIALOGEX to mnu or dlg RadASM equivalents.

The first 14 bytes of each control in dlg was a mystery (still is), looked like a random numbers or time-stamp. I even didn't bother to generate something random, wrote a constant-byte in place of first byte, and it worked :)
Also I couldn't find a correct way to convert main window position DIALOGEX x,y,cx,cy , with child windows everything was fine max 1px error rate.

So here are assumptions on how rc file should look if it could be converted to dlg
these statements should begin at start of each line:
CLASS, FONT, STYLE, EXSTYE, CAPTION, MENU (statements should be in upper-case)

CONTROL statement cannot be found between quotes

If there will be some unknown class it won't be recognized

#define statements are optional

aboutbox needs some work, will be working on it...

[attachment deleted by admin]

duyangan


hfheatherfox07

Thank you very much ..... will look for bugs if any and will report if any

Since you posted the source I will add a drag file

.ELSEIF uMsg == WM_DROPFILES
   push wParam
   pop hDrop
   invoke DragQueryFile,hDrop,0,offset cFname,sizeof cFname
   invoke DragFinish,hDrop
   invoke SetDlgItemText,hDlg,IDC_TARGETFILE,offset cFname


It would be nice if you ever posted  more updates if that was added

There is an example of that in Yoda's Crypter v1.3  here http://www.programmersheaven.com/download/35321/download.aspx

http://www.programmersheaven.com/d/click.aspx?ID=F35321