I can't find my hMenu anywhere! Can you help?
IntPtr hMenuBar = SHFindMenuBar(hWnd);
IntPtr hMenu = new IntPtr(SendMessage(hMenuBar, SHCMBM_GETSUBMENU, 0, 0));
hMenu is always 0 in the WM5 PocketPC emulator!
Also tried this, per the WM5 SDK topic "How to: Obtain a Handle to a Softkey
Menu":
IntPtr hMenu = new IntPtr(SendMessage(hMenuBar, SHCMBM_GETMENU, 0, 0));
Still 0.
Searched for the answer all over the net. Lots of people asking this
question. No answers.
Declarations:
const int WM_USER = 1024;
const int SHCMBM_GETSUBMENU = WM_USER + 401;
const int SHCMBM_GETMENU = WM_USER + 402;
[DllImport("aygshell.dll")]
internal static extern IntPtr SHFindMenuBar(IntPtr hwnd);
[DllImport("coredll.dll")]
internal static extern int SendMessage(IntPtr hWnd, uint Msg, uint wParam,
uint lParam);
|