Thanks Thomas ! That was helpful :-) 

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Thomas Hruska
Sent: Tuesday, July 10, 2007 12:55 AM
To: [email protected]
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/> 

 



**************** 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]

Reply via email to