Jump to content
Sign in to follow this  
chenxu

Sharing: one way to control an application whose control ID changes very time

Recommended Posts

chenxu

I am dealing an application whose controls' control ID or classnameNN changes very time when I restart it these days. At first, I found it hard to control the application since the changing of its controls' control ID and classnameNN. I tried many ways, including get the control ID by position of it, but I failed. At last, I found an effective way to approach my purpose.

Although the controls' control ID or classnameNN changes very time, but the text of the control or 'near' the control remains unchanged which is the most important condition of this method. So, I can control the control directly by using the text. But, the imput box or something like them can not control in this way since there is no text in it. In this situation, you can focus the nearest control of the target control you willing to control to, most of time, it is an Static or an Checkbox or a radio button which is very earily to focus. and you can send the control one or two '{tab}' to switch the focus to the target control. And the last step is use the command: ControlGetFocus to get the control reference to the target control, and you can just do what you want to like controlling a normal control of the other application.

This is an effective and a high efficiency way to quickly control some control which changes control ID very time.

chenxu

Share this post


Link to post
Share on other sites
someone

Can you post a little code? I understand what your saying just interested to see an example... I had an application that sounded similar, (Peregrine Service Center) and ended up grabbing the entire window text, converting it to an array, and sifting through via regxp for known patters of text I was trying to find... from there, I could nab all the other data relative to the position regxp helped me nab.

Glad to hear you got things working though, congrats, thanks for sharing


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.