Hi guys, I've just used some resources in my emulator to make menus and dialogs for the windowed mode. But I need a little help. I was wondering how would I get the property of a particular menu selection?
I have made a standard File->Exit menu with the "EXIT" button with an ID numeral of "IDCLOSE".
I do something like this to quite the emulator (window handling stuff written in C, but I have converted to Asm):


.IF uMsg==WM_COMMAND
mov eax, wParam
and eax,0FFFFh ;Low word of wParam contains ID of menu item being selected
cmp eax,IDCLOSE
jnz @f
invoke ExitEmu
@@:
mov eax,TRUE
ret
.ENDIF




This code sequence works because when I select exit, the program closes gracefully :D
But say for example I would like a menu item to be checked, to have a little check beside it. How would I turn it off in code instead of resources? I want this because if the user wants to select say a window size, I can check the currently selected window size.

Also for dailog boxes, how would I do stuff like change the current caption on a command button or the picture in a picture box or even the Dialog window caption?

I've been too caught up using fullscreen to realize that windowed mode might be an advantage!! And resources seem to be making my life WAY easier :D

Thanks in advance
Posted on 2004-08-08 12:23:06 by x86asm
I wrote a somewhat longer post, but closed the browser before sending - doh! Here's the short version:
CheckMenuItem, SetWindowText/SetDlgItemText, STM_SETIMAGE window message.

:)
Posted on 2004-08-08 12:35:48 by f0dder

I wrote a somewhat longer post, but closed the browser before sending - doh! Here's the short version:
CheckMenuItem, SetWindowText/SetDlgItemText, STM_SETIMAGE window message.

:)


hahaha, it happens man :D

I was also wondering, say if I had a combo box how would I add items to it through code and such, or maybe u could suggest somewhere in which I could look to set the properties of various items on the dialog box. Customize it based on situations encountered in the code.
Posted on 2004-08-08 13:52:05 by x86asm