c = lngItemCount;
while(c > lngItemCount -4)
RemoveMenu(hMenuHandle, c--,MF_BYPOSITION|MF_DISABLED);
DrawMenuBar(hWnd);;As you can see this code will go in your window procedure under WM_CREATE. Just as a reminder, some systems have things added to the "standard" system menu so you will need to find a way of allowing for that.
Thank you, this does exactly what I need...using this plus a menu with trigger as "x" button will open a menu making sure you want to close the window.
Original disabled maximize button got rid of setwinstyle to remove max button and changed the 3 to 4 int he for statement.
int hWnd=win("Untitled - Notepad""Notepad") int hMenuHandle lngItemCount c style
hMenuHandle =GetSystemMenu(hWnd,0);
lngItemCount =GetMenuItemCount(hMenuHandle); for c lngItemCount-14-1 ,RemoveMenu(hMenuHandle, c,MF_BYPOSITION); DrawMenuBar(hWnd)
Ran into a little problem, some of the windows have minimize, maximize and close and others have only minimize and close.
The code I posted above works fine when all three are there but when it only has minimize and close it will not work. I tried adjusting the for statement but can not get the correct combination. Any idea?