flat assembler
Message board for the users of flat assembler.

Index > Windows > WM_COMMAND not being sent

Author
Thread Post new topic Reply to topic
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin
i cant understand why i cant receive WM_COMMAND messages.
i have used menu's and intercepted this message many many times
before. i have even compared the code in fasm from another project
and i cant see where the problem is.
i have even changed the value of the constants but that doesnt help.

here is my menu resouce

; CONSTANTS
RC_MENU_ID_MAINWND = 1

IDM_FILE_EXIT = 101

IDM_HELP_VERSION = 130
IDM_HELP_ABOUT = 131

section '.rsrc' resource data readable

directory RT_MENU, my_menus

resource my_menus, RC_MENU_ID_MAINWND,LANG_ENGLISH+SUBLANG_DEFAULT, mainwnd_menu

menu mainwnd_menu
menuitem "&File", 0, MFR_POPUP
menuitem "E&xit", IDM_FILE_EXIT, MFR_END
menuitem "Hel&p", 0, MFR_POPUP or MFR_END
menuitem "&Version...", IDM_HELP_VERSION, 0
menuitem "&About...", IDM_HELP_ABOUT, MFR_END

the menu is displayed properly, but when clicking on a menu item
nothing happens. here is my the relevant bit from my window proc
code

cmp [uMsg], .WM_COMMAND
je .WM_COMMAND

... other code
.WM_COMMAND:
invoke MessageBox, HWND_DESKTOP, "WM_COMMAND", NULL, MB_OK

the message box is there just to tell me i have got WM_COMMAND because
the code to check which item it was using wParam didnt work. so i added this to check. and the message box doesnt appear.
Post 14 Jul 2005, 15:05
View user's profile Send private message Reply with quote
Eoin



Joined: 16 Jun 2003
Posts: 68
Location: Ireland
Eoin
Could it be the period befored the WM_CO... in

cmp [uMsg], .WM_COMMAND
Post 14 Jul 2005, 18:06
View user's profile Send private message Reply with quote
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin
just read your reply, and tried it.
yes it was ! Smile
i can't believe i missed such a silly mistake,
i should take more breaks and come back to it fresh.

thankyou eoin.
Post 14 Jul 2005, 18:56
View user's profile Send private message Reply with quote
Eoin



Joined: 16 Jun 2003
Posts: 68
Location: Ireland
Eoin
My solution when something like that happens is to just copy and paste over some working code (if some exists). It saves searching for small typos.
Post 15 Jul 2005, 01:09
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.