Sign in to follow this  
Followers 0
gte

How do I trigger an event off of this?

9 posts in this topic

I have a program gui open, and after a certain amount of time, it will time out. (below is the small window it opens) in front of the main gui, and it also opens a second window in the task bar that is labeled "active notes"

What command can I use to have events trigger off of this? I checked in task manager and they all are using the same process and PID, the only difference I see is that it is popping open the active notes window in the task bar. Can an event be triggered when a window with the title 'active notes' opens up in the task bar?

Ultimately I want to have it close these windows and restart the program automatically. The active notes window is a warning, and then service center - your inactive ... is the confirmation that the program has frozen and needs to be killed and restarted.

Thanks

Posted Image

Posted Image

Share this post


Link to post
Share on other sites



What have you tried so far? try testing WinActive ("Active Notes").

Put in a loop and...

Do
Until WinActive ("Active Notes")
;Do Event

Share this post


Link to post
Share on other sites

I was thinking of trying winlist, after searching through the forums, but that didn't seem correct?

Let me research winactive

What have you tried so far? try testing WinActive ("Active Notes").

Put in a loop and...

Do
Until WinActive ("Active Notes")
;Do Event

Share this post


Link to post
Share on other sites

Maybe this helps; you can detect when a window is created and then check the window title, but it's probably easier to follow mdiesel's suggestion.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Using a winlist command, I'm able to get the handle

Do the handles ever change?

It appears as if it's given the handle 0x00860610 to the window in front that says it must be restarted, and 0x00490644 to the main window behind it?

Posted Image

I was thinking of trying winlist, after searching through the forums, but that didn't seem correct?

Let me research winactive

Share this post


Link to post
Share on other sites

I also was able to gather this information from it, which is the most useful that will stay the same each time, and I can trigger off of?

Posted Image

It is almost certain that the next time the application runs the window handle will be different IMO.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

What about something like this?

While 1
    WinWait("Active Notes", "Your inactive process") ; <-- need to check if AutoIt can see this text
    _DoStuffToWindow()
WEnd

Func _DoStuffToWindow()
; Actions to take when the window appears.
EndFunc

BlueBearrOddly enough, this is what I do for fun.

Share this post


Link to post
Share on other sites

I wrote something like that, and it worked, thank you!

What about something like this?

While 1
    WinWait("Active Notes", "Your inactive process"); <-- need to check if AutoIt can see this text
    _DoStuffToWindow()
WEnd

Func _DoStuffToWindow()
; Actions to take when the window appears.
EndFunc

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