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/