tags:

views:

15

answers:

1

I'm looking for a way to send a "right mouse button pressed" message to a node of a tree view in some window. Sending message is not a problem - the problem is how do i find this control and how do i find the specific node (i know its displayed text)?

A: 

As I understand you are trying to emulate mouse click in foreign application and you want to search for handler to specific control to send message to it. I think you should run Spy++ or WinSpector application. They should allow you to quickly find what window and class name window have. Base on this you may use FindWindow/FindWindowEx/EnumChildWindows/GetDlgItem win32 api to get handler of it. And after that you can call PostMessage to send message to selected control. If you don't know what message you need to send you can use Spy++ or WinSpector to trace all messages that came to specified window and check what kind of them are send when you click using real mouse.

Zuljin