Originally posted by Ken Fitlike
Where IDSM_MY_MENU_ITEM is some #defined short int value (just like you would for a resource id) and hwnd is the handle of the window for which you want to adjust the system menu. Then in your WM_SYSCOMMAND handler you check the wParam for that value (read the specifics on msdn) to take whatever action you want for that menu item.
I know this is an old thread, but I have a question, and instead of starting a new thread, I thought I'd add to the information in this one.

When you add a menu item to the system (window) menu, what are the restrictions (if any) for the menu-item identifier (3rd parameter in AppendMenu(): UINT uIDNewItem)? I was under the impression that all privately defined messages must be >= WM_USER (0x0400). Am I correct?

Also, while processing the WM_SYSCOMMAND message, I know you are supposed to ignore the lower four bits of uCmdType (wParam), by ANDing it with 0xFFF0. I assume this is not the case with a user defined menu item. Am I correct?

The MSDN provides no information on the specifics of either question. Any help is appreciated.