SDC

Is it possible to use Autoit to detect when a Windows dialog opens?

7 posts in this topic

This is the scenario. Within Windows, I run a support ticket application that causes an inactivity dialog (Windows OS based dialog) to popup every 5-10min. The dialog allows the user to click "logoff" or "stayed logged in". In most cases, I want to stay logged in. If the "stay logged in" button is clicked, it forces focus to the ticket application. This gets very annoying because most of the time I'm interacting within another window.

Is it possible to write an Autoit script that can detect when this dialog is created (or made visible) and if so, auto click the "stay logged in" button. I would also like to keep focus on the current window.

Any help to point me in the right is greatly appreciated!

SDC

 

Share this post


Link to post
Share on other sites



Is it possible? Yes. The ease with which you do so depends on the way the app was written. If you look in the directory where you installed AutoIt you will find the AutoIt Window Info Tool. Open this and then hover the bullseye icon over the pop up window. Post the information you get from the tool here and we will do our best to assist.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Hi JLogan3o13! As noted in your reply, here is the captured info. None of the other sections within the summary had information it, so I only included the "Window"  details.

Thanks!

>>>> Window <<<<
Title:    Cherwell Inactivity Warning (VWNPR329.bcacd001.atl.**********.ca)
Class:    RAIL_WINDOW
Position:    167, 219
Size:    467, 176
Style:    0x16080000
ExStyle:    0x00040008
Handle:    0x002804AE

Share this post


Link to post
Share on other sites

First off, as a former Cherwell admin, you have my sympathies.  So when you hove over the "Stay logged in option" the Window Info Tool returns nothing, correct?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I'm not a big fan of Cherwell neither. That is correct, nothing is returned within the Window Info Tool when the buttons are hovered over. I've only been messing around with Autoit for the last hour or so. I can initiate some logic when the Cherwell inactivity dialog opens, but I assume I may not have direct access to the dialog buttons after that.

Thanks!

SDC

 

Share this post


Link to post
Share on other sites

I actually wrote an application that I gave the creative name of "KeepCherwellLoggedIn" and it works great. Just looks for the Cherwell login window to open. If you notice, the default button of the two is "Stay Logged In", so I just set it to press the "Enter" key when the window appears. I have several co-workers who use the app as well. It works well. If you want, I can post the code here.


Who lied and told you life would EVER be fair?

Share this post


Link to post
Share on other sites

#7 ·  Posted

save this as keepalive.vbs (vbscript file) and run it inside your citrix desktop (which hopefully you can).
The 60000 is to wait 60.000 milliseconds so 60 seconds = 1 minute before hitting numlock key up and down to keep system alive.

Set WxhShell = CreateObject("WScript.Shell")


while 1
    
    WxhShell.SendKeys "{NUMLOCK}"
    WxhSHELL.sendkeys "{SCROLLLOCK}"
        wscript.sleep(1000)
    WxhSHELL.sendkeys "{SCROLLLOCK}"
    WxhShell.SendKeys "{NUMLOCK}"
    wscript.sleep(60000)

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