JonF Posted August 11 Author Posted August 11 This works: $WindowTitle = "Npcap " & $Version & " Setup" WinWait($WindowTitle,"License Agreement",10) ControlClick($WindowTitle,"",1) WinWait($WindowTitle,"Installation Options") If $Pause = "False" Then ControlClick($WindowTitle,"",1) EndIf WinWait($WindowTitle,"Setup was completed successfully") ; Wait for the "Next" button to be active Sleep(2000) ControlClick($WindowTitle,"",1) WinWait($WindowTitle,"Thank you for installing Npcap") ControlClick($WindowTitle,"",1) If the second argument is not a null string the ControlClick calls do not work.
Nine Posted August 11 Posted August 11 (edited) The only use for "text" argument that truly matters is when you have 2 windows with identical titles and you want to distinguish between them based on its content. Take the following example, I don't have to use the "text" parameter for all win* and control* functions until I have 2 windows with identical title. Then I can distinguish them by their content : Run("notepad") ; start first instance WinWaitActive("Sans titre") ; don't need to specify any text since there is only 1 window with that title ControlSend("Sans titre", "", "Edit1", "123") Run("notepad") ; start second instance WinWaitActive("Sans titre") ; again only 1 window with that title since first change title to add * (no need for text) ControlSend("Sans titre", "", "Edit1", "456") ControlSend("*Sans titre", "123", "", "^s") ; now we got 2 windows with identical titles -- need to specify text to refer to the right window WinWait("Enregistrer sous") ; no need for text as this is a unique window title ControlClick("Enregistrer sous", "", 2) ; id 2 = cancel Sorry my Notepad is in french ! ps. I always prefer using handle instead of title, there's a reduced chance of creating a bug with handle cause they are uniquely defined. Edited August 11 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now