Re: How do I get a Handle to a Windows Associated Menu
- From: "ink" <ink@xxxxxxxxxxxxxx>
- Date: Fri, 7 Sep 2007 21:54:22 +0100
There doesn't seem to be any menu handle at all i am looping around all the sibling windows getting there classes and handles and there is no menu i have looken in remote spy and there is nothing that looks like a menu except for something called "HHTaskBar".
ink
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com> wrote in message news:eIgvwtY8HHA.2208@xxxxxxxxxxxxxxxxxxxxxxx
All of the menu handling, I would think, is handled by a single window per process. When you have two forms open from the same application, are there two instances of that menu handling window? If so, you may be out of luck for this scheme...
Paul T.
"ink" <ink@xxxxxxxxxxxxxx> wrote in message news:uH$1n5X8HHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
There will be 2.
The one that is being automated and the one doing the automation. nothing else.
I am still in the dark how it will know what menu it is dealing with.
if you load up FormA with MenuA(with Exit button) on it and then you you click a button on FormA that loads up FormB with MenuB(with close button) on it. How dow you know were to send the windows message. What Handle am i looking for if i want to close FormB using the menu. should i be sending the message to FormB's Handle?
Thanks,
ink
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com> wrote in message news:uoOorVW8HHA.600@xxxxxxxxxxxxxxxxxxxxxxxHow many copies of the program, or other CF programs, might be running at once on the target device. Always lazy, I'd be inclined to test with only the one you care about running and just assume that only one is there...
Paul T.
"ink" <ink@xxxxxxxxxxxxxx> wrote in message news:e4q7YQT8HHA.3900@xxxxxxxxxxxxxxxxxxxxxxxHi Paul,
Thanks for this i was hoping i would be able to do something like send a windows message as you say there is no need to see the menu as it is a automation application as long as the code behind it is run when the message is sent.
My only problem is that this class name(#NETCF_AGL_BASE_ ) is actually used for any Dot.Net container (TabControl, Panal and Forms) I can figure out which class is active parent container.
Would i need to send the windows message to the currently active form and then that would send it to its associated menu?
thanks,
ink
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com> wrote in message news:%23wWSV2J8HHA.464@xxxxxxxxxxxxxxxxxxxxxxxUnless 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@xxxxxxxxxxxxxxxxxxxxxxxhi 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@xxxxxxxxxxxxxxxxxxxxxxxWhy 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@xxxxxxxxxxxxxxxxxxxxxxxHi 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:
- Re: How do I get a Handle to a Windows Associated Menu
- From: <ctacke/>
- Re: How do I get a Handle to a Windows Associated Menu
- 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
- 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
- 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
- Re: How do I get a Handle to a Windows Associated Menu
- From: Paul G. Tobey [eMVP]
- How do I get a Handle to a Windows Associated Menu
- Prev by Date: Re: How do I get a Handle to a Windows Associated Menu
- Next by Date: Re: How do I get a Handle to a Windows Associated Menu
- 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):