In Spy++, I get the class name, co-ordinates etc. If you don't have spy++ don't worry. One such tool is here
http://www.codeproject.com/dialog/windowfinder.asp ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sumit Chawla Sent: Thursday, July 12, 2007 8:38 PM To: [email protected] Subject: Re: [c-prog] Can we access menus using C program? On 7/12/07, Karthikeyan M <[EMAIL PROTECTED] <mailto:Karthikeyan_M05%40infosys.com> > wrote: > > > Hi All, > > I'm able to do it for a calculator window. Thanks a lot. > > But I get stuck, when there is a window inside a window. I couldn't get > the handle for the inside window. > > For example, in Adobe photo shop, we have so many windows inside the > main window. I've no clue how to get the handle for those windows. > > Help will be greatly appreciated. > > ________________________________ > > From: [email protected] <mailto:c-prog%40yahoogroups.com> <c-prog%40yahoogroups.com> [mailto: > [email protected] <mailto:c-prog%40yahoogroups.com> <c-prog%40yahoogroups.com>] On Behalf > Of Thomas Hruska > Sent: Tuesday, July 10, 2007 12:55 AM > To: [email protected] <mailto:c-prog%40yahoogroups.com> <c-prog%40yahoogroups.com> > Subject: Re: [c-prog] Can we access menus using C program? > > Karthikeyan M wrote: > > Hi guys, > > > > I want to access the menus of some other running application using a C > - > > program. I dunno how to proceed. So far, I've found how to create a > > handle for the window. Say, if I want to access the menus of a > > calculator application, > > > > int main (void){ > > HWND calc; > > calc = FindWindow (NULL, "Calculator"); > > } > > > > After this I couldn't find how to proceed further to access the menus. > > Help will be appreciated. > > Karthikeyan, > > Menus under Windows are generally "black boxes". I suggest using a tool > like Spy++ or Winspector Spy to watch the window of the calculator > process. Specifically, you are looking for WM_COMMAND messages sent as > a result of clicking a menu item. Each WM_COMMAND is unique for each > menu item (and will rarely change its value between software > builds/versions), so all you have to do is use SendMessage() to replay > the command from your application. > > -- > Thomas Hruska > CubicleSoft President > Ph: 517-803-4197 > > *NEW* MyTaskFocus 1.1 > Get on task. Stay on task. > > http://www.CubicleSoft.com/MyTaskFocus/ <http://www.CubicleSoft.com/MyTaskFocus/> > <http://www.CubicleSoft.com/MyTaskFocus/ <http://www.CubicleSoft.com/MyTaskFocus/> > > > **************** CAUTION - Disclaimer ***************** > This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended > solely for the use of the addressee(s). If you are not the intended > recipient, please notify the sender by e-mail and delete the original > message. Further, you are not to copy, disclose, or distribute this e-mail > or its contents to any other person and any such actions are unlawful. This > e-mail may contain viruses. Infosys has taken every reasonable precaution to > minimize this risk, but is not liable for any damage you may sustain as a > result of any virus in this e-mail. You should carry out your own virus > checks before opening the e-mail or attachment. Infosys reserves the right > to monitor and review the content of all messages sent to or from this > e-mail address. Messages sent to or from this e-mail address may be stored > on the Infosys e-mail system. > ***INFOSYS******** End of Disclaimer ********INFOSYS*** > > [Non-text portions of this message have been removed] > > > What do you get from SPY++? -- Regards Sumit Chawla ("eNetra : Hail the Invention") "Computers are useless. They can only give you answers.":Pablo Picasso [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]
