finding the correct control of a remote application(win32)

Started by
1 comment, last by balla_the_king 17 years, 7 months ago
Hello! I am making an add-on to a program and on a window I must find the correct textbox of several textboxes to perform my task. I wonder how I can distinguish the correct textbox undepending on which computer my program is launched since I intend to sell my program. My first idea is to distinguish it by looking at the position of the textbox but I wonder if there is a more standard way of doing something like this? Something like a unique control id every control gets that is uniform across each launch at each computer?
Advertisement
You'll need a combination of EnumWindows, EnumChildWindows, and GetDlgCtrlID. Note that GetDlgCtrlID may not be reliable depending on how the target application creates the window and control in question.

Also, you will probably need to use DLL injection to insert some of your own code into the memory space of the target program; you cannot directly access the windows of other processes under Windows.

Tools like Spy++ or Winspector will be invaluable as well.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Quote:Original post by ApochPiQ
You'll need a combination of EnumWindows, EnumChildWindows, and GetDlgCtrlID. Note that GetDlgCtrlID may not be reliable depending on how the target application creates the window and control in question.

Also, you will probably need to use DLL injection to insert some of your own code into the memory space of the target program; you cannot directly access the windows of other processes under Windows.

Tools like Spy++ or Winspector will be invaluable as well.


Thank you for your quick reply. I will perform tests to see if GetDlgCtrlID is reliable in my case.

This topic is closed to new replies.

Advertisement