PDA

View Full Version : Getting to controls of existing applications



RPrinceton711
27-04-2019, 20:24
Hello,
I have combed the help files looking for the means in which
to send a mouse click to a specific tab of a piece of software
running on my desktop. I am able to get the hWnd of the Window
thru its title, however I do not know how to "find" i.e., get to the tab
control and then ultimately the specific tab. I looked at the
Win_GetDlgCtrlId and Win_GetDlgItem but I do not think that's what I
need. Most of the other help always assumes that I created the control.
This is an application that I did not author.
Thank you in advance for any assistance.
RPrinceton711

ErosOlmi
28-04-2019, 10:17
Ciao RPrinceton711 and welcome to thinBasic community.

thinBasic is not designed to automate windows but I think you can get something.
Have a look at this post: https://www.thinbasic.com/community/showthread.php?11852-Control_GetText-and-Control_SetText&highlight=winspy
At page 3 there is post #22 (https://www.thinbasic.com/community/showthread.php?11852-Control_GetText-and-Control_SetText&p=87122&viewfull=1#post87122) with a MSPaint automation example from rjp74 user.

You can get it and see how to adapt to your needs.
Just start MSPaint and then execute the script to see how it works.

Maybe you need WinSpy++ utility to find the ControlID (the unique identifier of the control) of your tab control and make some change in the source code.
If you do not have WinSpy++, le me know and I will attach here later.

Ciao
Eros