This is no doubt a really stupid mistake, but I'm just a beginner...I'm trying to add an 'Always On Top' system menu item to my window. I have this in WM_INITDIALOG but the menu item never appears:



; mii = MENUITEMINFO
; AOT = "&Always On Top"

.ELSEIF uMsg == WM_INITDIALOG
invoke GetSystemMenu, hWnd, FALSE
mov sysmenu, eax
mov eax, MIIM_ID or MIIM_STRING or MIIM_DATA or \
MIIM_CHECKMARKS or MIIM_STATE
mov mii.fMask, eax
mov eax, 61439
mov mii.wID, eax
mov eax, MFT_STRING
mov mii.fType, eax
mov eax, MFS_UNCHECKED
mov mii.fState, eax
lea eax, AOT
mov mii.dwTypeData, eax
mov eax, SIZEOF MENUITEMINFO
mov mii.cbSize, eax
invoke InsertMenuItem, sysmenu, 5, TRUE, ADDR mii
.ELSEIF ....


Is this related to my mii.wID of EFFFh? Or maybe the insert position 5? I don't really understand how these work so my guess is it's one of these.

Thanks.
Posted on 2003-05-27 10:49:11 by spanner
Use AppendMenu.
Posted on 2003-05-27 15:25:55 by comrade
Is there something wrong with InsertMenuItem? If there is what alternative is there to add an item to the system menu but not at the end?
Posted on 2003-05-28 03:42:50 by spanner