Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button Identification 1

Status
Not open for further replies.

Saul775

Programmer
Aug 9, 2004
11
US
Hello:

I'm trying to interact with another application running on the computer. It has some buttons that need to be sent some WM_LBUTTONUP. I'm using Spy++ to determine the buttons; however, I have twenty-five buttons on the window, they all are of the same class, and they all have a caption of "", so I don't know how to determine the correct button. Again, I'm using Spy++, which reports all twenty-five buttons are of the same class, and they all have the same caption, which is "". How can I pin-point a specific button in the window that I need to send a message to? I've thought of using GetWindowRect()? Also, what is the class atom? Can I use this to determine the correct button?

Lastly, and another question I've thought of, what code, or functions, can I use to reboot a computer?

Thank you, all, for your time and consideration in this matter. I hope to solve it soon with your help. Thank you again.

Saul775
 
2nd question first. ExitWindowsEx().Look it up at MSDN.

Now the first question. I might try FindWindow to get HWND of parent and then use that in a call to ChildWindowFromPointEx() assuming you know the coords of the button relative to the window. That should give you the hwnd of the button. Now you can use PostMessage() or SendMessage() or SendInput() to send events to the button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top