Hi Peter,
Thanks for the response. Your blog has been helpful to me on more than one
occasion.
I'm able to find the softkey bar window (class "menu_worker") using
SHFindMenuBar without any trouble. Its parent is the form hWnd, and it has
no child windows, so that seems to be a dead end as far as finding the
related MS_SOFTKEY_CE_1.0 window goes.
I'm also able to find my form menu handle using the TB_GETBUTTONINFO
message. GetMenu (SHCMBM_GETMENU) only works on the Smartphone platform, not
on the PocketPC.
But I still don't see any way to get the correct lParam value to use to send
a WM_COMMAND message that will invoke a .NET CF menu command.
-David
"Peter Foot [MVP]" wrote:
> There is a softkey bar for each application potentially. I can't remember
> but possibly the GetMenu API call will work - pass in the handle to your
> main form and see what handle is returned.
>
> Regards,
>
> Peter
>
> --
> Peter Foot
> Microsoft Device Application Development MVP
> www.peterfoot.net | www.inthehand.com
> In The Hand Ltd - .NET Solutions for Mobility
>
> "_dtaylorus" <(E-Mail Removed)> wrote in message
> news:F308EF11-E3B7-4189-9B17-(E-Mail Removed)...
> >I thought it would be a simple matter to SendMessage(hWnd, WM_COMMAND,
> > commandId, lParam), where hWnd is the form window handle and lParam is 0.
> > (Surprise... it doesn't work on a WM5 PPC.)
> >
> > Using CESpy, I can see that for real menu clicks, lParam is set to the
> > handle of a window with a class name of "MS_SOFTKEY_CE_1.0".
> >
> > Sure enough, if I manually set lParam to this value in the debugger,
> > SendMessage works as expected.
> >
> > So now the question is: How do I _reliably_ get the handle to this
> > MS_SOFTKEY_CE_1.0 window? There can be any number of them at a given
> > time.
> > I need to know which one to use for the active form.
> >
> > Thanks!
> > -David
>