Sign in to follow this  
Followers 0
suthern101

Watch a non-AutoIt control for events?

3 posts in this topic

With non-AutoIt created controls, I can hide, show, enable, disable, set text, and do a number of other things.

That is quite handy.

Is there a way to WATCH non-AutoIt controls with either GUIGetMsg (in a loop) or another method? Currently GUIGetMsg only seems to pickup on events from the AutoIT created GUI, not other windows or controls. And it STOPS receiving events if something other than the AutoIT created GUI has focus.

I've tried setting GUISwitch to the handle of the non-AutoIT window, but it still can't seem to catch non-AutoIT control events.

What would you guys suggest?

Share this post


Link to post
Share on other sites



AutoIt is a freeware automation language for Microsoft Windows.

Example:

Open notepad writing anything then run this script, by the way there are many more examples in AutoIt help file!

$var = ControlGetText("[CLASS:Notepad]", "", "Edit1")
MsgBox(0,'',$var)

best regards

.

Share this post


Link to post
Share on other sites

Thanks. I've been using AutoIt for a while now. Currently I'm designing an interface which 'assists' an older database program which we use. My interface (a dropdown, input box, and a couple labels) sits in empty realestate within the other programs window. It moves when the other program window moves. It looks like it belongs there.

My goal is so the end user can do what they normally do, as well as have two more input boxes which are easy to use.

One thing that I wish AUtoIt had was array management like php. I LOVE php's arrays! I'm using a scripting dictionary instead. This works, but of course is far from optimal. :)

I use ControlGetTxt. The issue that I'm having right now is that I don't want to call ControlGetTxt within a tight loop, just to check the status of two inputs. I'd rather do one call to GUIGetMsg, then use the return value from that to determine if a control within the parent window has changed.

Thanks for your help though!

I think I'll make a small internal timer, something like

If mod(TimerInit(),500) = 0 AND ControlGetText("window title",'',$some_handle) Then
    ; do something. Note that having the mod(TimerInit(),500) = 0 IN FRONT of the 
        ;  'AND' keywords should cause the 2nd condition to only be checked every 500 milliseconds
EndIf

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  
Followers 0