Re: How do I get a Handle to a Windows Associated Menu
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Thu, 6 Sep 2007 08:50:03 -0700
Unless you think that the OS isn't going to properly interpret the clicks,
you don't really need to do that, at least in general. Each menu item in
Win32 has a command value associated with it. When the item is clicked, the
window associated with the menu gets a WM_COMMAND message with the command
value for the selected menu item. You should be able to simulate the
selection of the menu item without physically popping up the menu.
You'll probably have to use Remote Spy++ to figure out what command values
are assigned to each menu item, since I don't think that they're explicitly
set for managed code applications, and you'll need to verify that they don't
change from run to run, but a quick test that I just ran came up with the
same values each time. You'll also need to be sure that you're sending the
WM_COMMAND message to the right window. A special window is created by the
NET CF to catch menu commands. Look through the list in Remote Spy++ and
you'll see it. It's class name is #NETCF_AGL_BASE_ in .NET CF 1.0.
Paul T.
"ink" <ink@xxxxxxxxxxxxxx> wrote in message
news:OJM8MjF8HHA.3940@xxxxxxxxxxxxxxxxxxxxxxx
hi Paul,
i have a windows mobile 5 CF2.0 Prooof Of Deliver application that news
End to End Load and functional testing.
As it is not practical to site with 50 devices infrount of me trying to
use all 50 at the same time, i thought the next logical solution is to
write a small application that can automate the users front end of the
application.
i am doing pritty well at the moment. i can do almost everything i want.
there is just a few things left.
And one of them is finding the menu.
i have a screen Tap method that takes in a Handle to a window and then
that works out using get window rectangle where it needs to send the tap.
There are 2 hard keys on the Key board that are mapped to the menu that i
may be able to send the Key board event for them to the screen but that
still dose not solve the problem of the menu items. i gues i was hopping
that a menu was made up od button like controls that i could get a handle
to.
thanks,
ink
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:ujPdaQ97HHA.2004@xxxxxxxxxxxxxxxxxxxxxxx
Why do you need it? Generally, that's a bad idea. Give us some
information about what you're trying to do and maybe we can suggest
something that would be supported.
Paul T.
"ink" <ink@xxxxxxxxxxxxxx> wrote in message
news:uUoHSx87HHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
Hi all,
How do you get a Handle to the menu on a Form running in a different
process using p/invoke and the Win API.
Unfortunately "HMENU GetMenu(HWND hWnd );" does not seem to be
implemented in Windows Mobile 5.
I have opened "Remote Spy" and I don't see it there.
I think it might have something to do with the class "HHTaskBar" but I
am not sure.
Any ideas welcome?
Thnaks,
ink
.
- Follow-Ups:
- References:
- How do I get a Handle to a Windows Associated Menu
- From: ink
- Re: How do I get a Handle to a Windows Associated Menu
- From: Paul G. Tobey [eMVP]
- Re: How do I get a Handle to a Windows Associated Menu
- From: ink
- How do I get a Handle to a Windows Associated Menu
- Prev by Date: Drag-and-drop graphics in CF.NET?
- Next by Date: Strange sudden shutdown issue with CF app
- Previous by thread: Re: How do I get a Handle to a Windows Associated Menu
- Next by thread: Re: How do I get a Handle to a Windows Associated Menu
- Index(es):