Hi everybody.

Well, I am using RadASM and have started a project. It is basically a program I made using delphi, but done in MASM32 so that I can reduce the size of the application and learn more about how MASM32 works with the windows registry. All was good until I got to the part where I appended some items to the dialogs system menu. Below is my rather crude and amateurish code...

;**** Begin amateur code block
DlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
mov eax, uMsg

.if uMsg==WM_INITDIALOG
invoke GetSystemMenu, hWin, FALSE
mov hMenu, eax

invoke AppendMenu, hMenu, MF_SEPARATOR, 0, NULL
invoke AppendMenu, hMenu, MF_STRING, IDM_ABOUT, addr MenuAbout
invoke AppendMenu, hMenu, MF_STRING, IDM_SYSTEM, addr MenuInfo
.endif

.if uMsg==WM_COMMAND
.if lParam==0
mov eax, wParam
.if ax==IDM_ABOUT
invoke MessageBox, hWin, addr msgText, addr msgTitle, MB_ICONINFORMATION or MB_TASKMODAL
.endif
.endif

.elseif uMsg==WM_CLOSE
invoke EndDialog, hWin, 0
.else
mov eax, FALSE
ret
.endif
mov eax, TRUE
ret
DlgProc endp
end start
;**** End amateur code block

The menu items append fine. They show up and look the way I need them to look. The only problem is in the block where I am trying to show a MessageBox when you click the "About" menu item, IDM_ABOUT. Nothing happens! I am SURE I am making some kind of simple mistake that I am just not seeing, so I am here begging for help on this one. =)

It's been a few hours now and I can't seem to get this to work at all. If anyone can help, it would be much appreciated.

Cheers!
The Beginner
Posted on 2003-05-25 09:08:06 by The Beginner
The system menu returns with a WM_SYSCOMMAND message not a WM_COMMAND message. Should work fine otherwise
Posted on 2003-05-25 09:18:45 by donkey
That was it, heh. I knew it was something simple I was missing. Thanks a ton donkey!

NOTE: Edited because me spell gud.
Posted on 2003-05-25 09:43:39 by The Beginner