Hello EB,

I'm trying to disable the "Options..." menu item in the SIP's menu
that pops up on the Pocket PC, for both - Pocket PC 2003 and WM5.0.
I'm unable to get the handle to the menu for the SIP's menu.
WM_COMMAND messages aren't fired on the click event which occurs when
I select the "Options..." menu item.

What I've done is:

//Get the handle to the SIP's window.
hSIP = FindWindow(TEXT("MS_SIPBUTTON"), TEXT("MS_SIPBUTTON")) ;

// Get the menu associated with this window.
hMenu = (HMENU) SendMessage(hSIP, SHCMBM_GETMENU, 0, 0);

// Get the sub-menu for the SIP button's menu.
hSubMenu = GetSubMenu(hMenu, 0); // Tried other position values too.
NULL ref. returned.


I also tried obtaining the system menu - using the GetSystemMenu(...)
API, but I don't get any sub-menu on the menu handle that I receive on
this call.

Where am I going wrong? How can I disable "Options..." for good? Any
help in this regard will be appreciated.

Thank you.

Warm regards,
Amit.

Re: SIP menu disable menu item. by Amit

Amit
Wed Mar 05 06:52:47 CST 2008

Hello EB,

I've got the solution for this. It involves subclassing the SIP window and
handling the WM_INITMENUPOPUP message. The handle to the Menu is the wParam
of this message, and calling EnableMenuItem(...) with ID = 0, and MF_GRAYED
for the second and third parameter respectively. The first parameter is the
handle to the menu obtained from wParam.

Hope this helps!
Thanks to Nilesh for his solution. Anybody wanting a sample solution for
this problem can contact me at:
agawde AT gmail DOT com

Amit.