Sign in to follow this  
Followers 0

Using WinWait or WinClose Auto It script causing issues in Outlook

1 post in this topic

I have a small exe I created in AutoIt that seems to be causing some problems in OutLook when people go to save a PDF or Reply to emails.

Here is my code.

WinWait("[CLASS:#32770]", "Make sure that your sign-in address, user name, and password are correct and try again.", 0)
WinClose( "Lync")


So this works just fine, it closes these message prompts we are trying to suppress.  But if the autoit executable is running when someone is using Outlook and they go to Save as PDF.  When they click "Save As" and go to type in the name of the file to save, they can't type in the box.  So if they close the autoit executable that's running only the code above, then they can use type in the name of the file.  So we know the EXE is preventing users from saving documents.

Now, I'm sure it could be the way I've written this code, but I'm new to AutoIt and I'm not sure what could be causing this.  This little script seems like it' targeting the correct CLASS # and Window TItle and exact message.  So I don't understand why it's interfering with other applications.

Any ideas?

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

  • Similar Content

    • feelie75
      By feelie75
      Hi. i googled and searched a lot before posting this. thanks for any help.
      I need to locate a window that has no title or discernible text, BUT is always the same size. The autoit documentation says:
      "X \ Y \ W \ H - The position and size of a window
      One or more properties are used in the title parameter of a window command in the format:
      [PROPERTY1 : Value1; PROPERTY2:Value2]"
      However, i can't figure out exactly how to do that. i tried:
      Local $winAW = WinWait("[W:506;H:288]", "", 30);
      That didn't work. I couldn't find an example of the specific format I need to use. Can someone provide a proven working example? Maybe that example can be added to the documentation? Thanks!
    • DeeJay7
      By DeeJay7
      I'm looking possible ways to optimize sleep time in a script which has multiple sleep times for save, refresh etc.
      The sleep duration varies from 5 secs to 17 secs time to time (depending upon the record, computer performance etc).
      Currently I set max sleep duration. ie sleep(17000).
      I'm looking possible ways to dynamically change sleep duration rather than fixed maximum duration.
      Note: winwait is not helpful in my script.
      Thanks in advance for your responses
    • badapple89
      By badapple89
      I basically want to create a Windows 8 Training script for new users, so need a popup to show when they open the start menu.
        WinWait and WinWaitActive are never detecting on my Win8 64 bit computer when waiting for the new start screen window.
      I have used "Start menu" and "[CLASS:ImmersiveLauncher]" for the title, even "[CLASS:DirectUIHWND]"
      Below is the Window info the the Start Screen
      >>>> Window <<<< Title: Start menu Class: ImmersiveLauncher Position: 1920, 0 Size: 1920, 1080 Style: 0x96000000 ExStyle: 0x00200008 Handle: 0x0000000000010190 >>>> Control <<<< Class: DirectUIHWND Instance: 0 ClassnameNN: DirectUIHWND0 Name: Advanced (Class): [CLASS:DirectUIHWND; INSTANCE:0] ID: Text: Position: 0, 0 Size: 1920, 1080 ControlClick Coords: 138, 174 Style: 0x56000000 ExStyle: 0x00000000 Handle: 0x0000000000010192 >>>> Mouse <<<< Position: 2058, 174 Cursor ID: 0 Color: 0x180053 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<< Explorer Browser Control   I have this setup to run as a test when I press a hotkey:
      $title = WinGetTitle ("[ACTIVE]")
      $state = WinGetState  ($title)
      ConsoleWrite ($title &" "& $state)
      I get "Start menu 0" its always 0 no matter what (it works correctly with other programs)
      I can get the PID of start menu but how can I then check when its active from that?
      Any help appreciated
      EDIT: I can only get the PID, Handle or anything else if the Start window is open. I cannot use win wait with any of this info though.
    • cassetti
      By cassetti
      Hello All!
      Longtime user of AutoIt - LOVE the language.
      Right now I'm running into a bit of an issue and I need some help. I'm attempting to automate some processes in an open-source 3D model software called meshlab ( - It's quite processor intensive. Though I've run into an issue where my work computer is MUCH faster than my home computer.
      When I execute WinWait("MeshLab") it won't wait, nor will it wait when I run one of the 'filters' - Filters > Remeshing > Surface Reconstruction: VCG  -  WinWait("Surface Reconstruction: VCG")
      I found something called "ProcessWait" in the helpfile (never had to use it before) - but when I run   ProcessWait("meshlab.exe") - it doesn't work!
      Is there an alternative method to check/poll the system ever X milliseconds to determine if the process is finished executing? Some of these filters I run on my CAD models can take minutes to execute, and it varies drastically from computer to computer.
      Here's what I'm making - I take my 3D models, and run them through a bunch of filters to create this effect, called a "Voronoi Tessellation"

    • atnextc
      By atnextc
      Hello All,

      This is my test script i've been messing around with to get the syntax correct for my real script that I am working on. Simply, this script will:

      The problem that I am having is my loop that I have isn't waiting for a user to input new data into the "username" input box.

      How to replicate:

      1. Input Project Name "TESTING-01A-Q1-2013"
      2. Number of Projects Can be any number more than 1
      3. Third input box is looking for a name "can be anything."
      4. Click Next Project
      5. When Next project button is dim click submit
      6. Look in the script directory where you ran it from for "testing.txt"

      You will notice something similar to the following:

      Project TESTING-01A-Q1-2013
      This is my username

      Project TESTING-01B-Q1-2013
      This is my username TEST USER

      Project TESTING-01C-Q1-2013
      This is my username TEST USER

      Project TESTING-01D-Q1-2013
      This is my username TEST USER

      Project TESTING-01E-Q1-2013
      This is my username TEST USER

      What needs to happen is the script will wait for the username input box to have data in it before filewrite.

      code is below

      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1_1 = GUICreate("Test", 615, 438, 215, 170) $RDCNextProjectButton = GUICtrlCreateButton("Next Project", 183, 241, 99, 33) GUICtrlSetState(-1, $GUI_DISABLE) $ProjectNameInputBox = GUICtrlCreateInput("", 35, 104, 193, 21) $ProjectNameLabel = GUICtrlCreateLabel("Please Input Your Project Name", 27, 80, 200, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $NumberOfProjectsLabel = GUICtrlCreateLabel("Please Input The Number Of Projects You Have Of This Kind", 19, 160, 364, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $RDCNumberOfProjectsInput = GUICtrlCreateInput("", 49, 198, 193, 21) $RDCSubmitButton = GUICtrlCreateButton("Submit", 72, 240, 99, 33) GUICtrlSetState(-1, $GUI_ENABLE) Global $ProjectNameRead = GUICtrlRead($ProjectNameInputBox) $username = GUICtrlCreateInput("", 48, 290, 193, 21) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $RDCNumberOfProjectsInput ;$RDCProjectSiteRead = GUICtrlRead ($ProjectSiteCombo) $RDCProjectNameRead = GUICtrlRead($ProjectNameInputBox) $RDCNumberOfProjectsRead = GUICtrlRead($RDCNumberOfProjectsInput) $usernameread = GUICtrlRead($username) If $RDCNumberOfProjectsRead > 1 Then GUICtrlSetState($RDCNextProjectButton, $GUI_ENABLE) GUICtrlSetState($RDCSubmitButton, $GUI_DISABLE) FileOpen("testing.txt", 1) FileWrite("testing.txt", @CRLF & @CRLF) FileWrite("testing.txt", "Project ") FileWrite("testing.txt", $RDCProjectNameRead & @CRLF) FileWrite("testing.txt", "This is my username " & $usernameread & @CRLF) FileClose("testing.txt") guictrlsetdata($username,"") ElseIf $RDCNumberOfProjectsRead = 1 Then GUICtrlSetState($RDCNextProjectButton, $GUI_DISABLE) GUICtrlSetState($RDCSubmitButton, $GUI_ENABLE) EndIf $CapacityInput = ($RDCNumberOfProjectsRead * 10) Case $RDCNextProjectButton $ProjectNameRead = GUICtrlRead($ProjectNameInputBox) $RDCNumberOfProjectsRead = GUICtrlRead($RDCNumberOfProjectsInput) $usernameread = GUICtrlRead($username) If guictrlread($username) = ("") Then MsgBox(0,"WAIT","Please Input A Name.") EndIf For $I = 1 To $RDCNumberOfProjectsRead - 1 FileOpen("testing.txt", 1) ConsoleWrite("'" & StringRegExpReplace($ProjectNameRead, "(?<=-\d{2})([A-Z])(?=-Q)", "' & Chr(Asc('$1') + $I) & '") & "'" & @LF) Local $soutput = Execute("'" & StringRegExpReplace($ProjectNameRead, "(?<=-\d{2})([A-Z])(?=-Q)", "' & Chr(Asc('$1') + $I) & '") & "'") GUICtrlSetData($ProjectNameInputBox, $soutput) FileWrite("testing.txt", @CRLF & @CRLF) FileWrite("testing.txt", "Project ") FileWrite("testing.txt", $soutput & @CRLF) FileWrite("testing.txt", "This is my username " & $usernameread & @CRLF) FileClose("testing.txt") guictrlsetdata($username,"") Next GUICtrlSetState($RDCNextProjectButton, $GUI_DISABLE) GUICtrlSetState($RDCSubmitButton, $GUI_ENABLE) Case $RDCSubmitButton MsgBox(0, "TESTING", "END OF SCRIPT") Exit EndSwitch WEnd
      Thanks to all for helping.