Sign in to follow this  
Followers 0
briang

Autoit starts app without focus

3 posts in this topic

#1 ·  Posted

Using AutoIt 3.3.14.2 to start Entrust etunprot.exe application. The Entrust GUI application starts and displays, but does not have focus. The application is in the foreground, but the title bar is greyed indicating it is not in focus.  After the application starts the AutoIt script is supposed to enter the password, but doesn't because of no focus. When I click on the application to give it focus then the script continues, password is entered and  finishes successfully. I originally used WinWaitActive and replaced it with WinWait and WinActivate to try and fix the problem. Here is the code:

    ; Terminate script if no command-line arguments
    If $CmdLine[0] = 0 Then Exit (1)

    Run("C:\Program Files\Entrust\Password Unprotect\etunprot.exe " & $CmdLine[1])

    WinWait("Entrust Password Unprotect", "OK")
    WinActivate("Entrust Password Unprotect", "OK")

    ; Enter the password text
    Send("password")
    ; Submit the password
    Send("{ENTER}")

    WinWait("Entrust Password Unprotect", "Enter name of output folder")
    WinActivate("Entrust Password Unprotect", "Enter name of output folder")

    ; Enter the name of the output folder
    Send($CmdLine[2])
    ; Unprotect the enp file
    Send("{ENTER}")

Share this post


Link to post
Share on other sites



#2 ·  Posted

I am not familiar with the application, but you may look to see if it uses input controls which can be directly sent messages instead of just automating keyboard, key strokes. 

Try using the AutoIt Window Info Tool (Au3Info) included with AutoIt to see what controls are in use by the GUI.

Share this post


Link to post
Share on other sites

#3 ·  Posted

Have you tried ControlSend ? That way the window doesn't have to be focused.

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