I am making a small app which has a WS_EX_PALETTEWINDOW style window. When I right click on the titlebar a menu pops up. Is there anyway I can add an item to this menu. Thanks.
Posted on 2001-01-03 23:23:00 by Frank Hale
I can send u source for insert\delete menu item. .data dlgname db "DLG",0 miname db "About ...",0 nfo db "Coded using Masm32",10,13 db "by Second Life (C) 2000",0 DlgProc PROTO :DWORD,:DWORD,:DWORD,:DWORD .data? hinst dd ? hmenu dd ? .code start: invoke GetModuleHandle,0 mov hinst,eax invoke DialogBoxParam,hinst,addr dlgname,0,addr DlgProc,0 invoke ExitProcess,0 DlgProc proc hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD .if uMsg==WM_CLOSE invoke EndDialog,hWnd,0 .elseif uMsg==WM_INITDIALOG invoke GetSystemMenu,hWnd,0 mov hmenu,eax; |-this is menu position number invoke InsertMenuA,hmenu,3,MF_BYCOMMAND or MF_SEPARATOR,0,0 ;this insterts in menu separator(line) invoke InsertMenuA,hmenu,3,MF_BYCOMMAND or MF_STRING,333,addr miname ;this insterts in menu 'About ...' string invoke RemoveMenu,hmenu,SC_RESTORE,MF_BYCOMMAND ; invoke RemoveMenu,hmenu,SC_SIZE,MF_BYCOMMAND ;invoke RemoveMenu,hmenu,SC_CLOSE,MF_BYCOMMAND invoke RemoveMenu,hmenu,SC_MINIMIZE,MF_BYCOMMAND invoke RemoveMenu,hmenu,SC_MAXIMIZE,MF_BYCOMMAND ; invoke RemoveMenu,hmenu,SC_MOVE,MF_BYCOMMAND .elseif uMsg==WM_COMMAND mov eax,wParam .if ax==201 invoke EndDialog,hWnd,0 .elseif ax==101 invoke PostQuitMessage,0 .elseif ax==102 invoke MessageBoxA,hWnd,addr nfo,addr miname,MB_OK .endif .elseif wParam==333 invoke MessageBoxA,hWnd,addr nfo,addr miname,MB_OK .endif xor eax,eax ret DlgProc endp end start Functions GetSystemMenuA-gets munu handle, InstertMenuA-adds to menu string,bitmap,separator ... RemoveMenuA-removes ...
Posted on 2001-01-04 10:48:00 by SEL
thank you for the code example. I will try this out when I get home!
Posted on 2001-01-04 15:47:00 by Frank Hale