Banker Posted January 30, 2008 Share Posted January 30, 2008 Im new to autoit and have made a script which i need to run minimized(only tray icon showing) The script looks like this pt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Run('C:\Program Files\QPR 7\Utilities\wlt.exe') WinWait("QPR Product Activation Wizard - Welcome Page","") If Not WinActive("QPR Product Activation Wizard - Welcome Page","") Then WinActivate("QPR Product Activation Wizard - Welcome Page","") WinWaitActive("QPR Product Activation Wizard - Welcome Page","") Send("{ENTER}") WinWait("QPR Product Activation Wizard - License Agreement","") If Not WinActive("QPR Product Activation Wizard - License Agreement","") Then WinActivate("QPR Product Activation Wizard - License Agreement","") WinWaitActive("QPR Product Activation Wizard - License Agreement","") Send("{ALTDOWN}a{ALTUP}{ENTER}") WinWait("QPR Product Activation Wizard - Customer Information","") If Not WinActive("QPR Product Activation Wizard - Customer Information","") Then WinActivate("QPR Product Activation Wizard - Customer Information","") WinWaitActive("QPR Product Activation Wizard - Customer Information","") Send("{ENTER}") WinWait("QPR Product Activation Wizard - Activate Licenses","") If Not WinActive("QPR Product Activation Wizard - Activate Licenses","") Then WinActivate("QPR Product Activation Wizard - Activate Licenses","") WinWaitActive("QPR Product Activation Wizard - Activate Licenses","") Send("{ENTER}") WinWait("QPR Product Activation Wizard - Activation Method","") If Not WinActive("QPR Product Activation Wizard - Activation Method","") Then WinActivate("QPR Product Activation Wizard - Activation Method","") WinWaitActive("QPR Product Activation Wizard - Activation Method","") Send("{ENTER}") WinWait("QPR Product Activation Wizard - Finish","") If Not WinActive("QPR Product Activation Wizard - Finish","") Then WinActivate("QPR Product Activation Wizard - Finish","") WinWaitActive("QPR Product Activation Wizard - Finish","") Send("{ENTER}") Im pretty new to scripting so bare over with me :-) Link to comment Share on other sites More sharing options...
martin Posted January 30, 2008 Share Posted January 30, 2008 Im new to autoit and have made a script which i need to run minimized(only tray icon showing)The script looks like thispt("WinWaitDelay",100)Opt("WinTitleMatchMode",4)Opt("WinDetectHiddenText",1)Opt("MouseCoordMode",0)Run('C:\Program Files\QPR 7\Utilities\wlt.exe')WinWait("QPR Product Activation Wizard - Welcome Page","")If Not WinActive("QPR Product Activation Wizard - Welcome Page","") Then WinActivate("QPR Product Activation Wizard - Welcome Page","")WinWaitActive("QPR Product Activation Wizard - Welcome Page","")Send("{ENTER}")WinWait("QPR Product Activation Wizard - License Agreement","")If Not WinActive("QPR Product Activation Wizard - License Agreement","") Then WinActivate("QPR Product Activation Wizard - License Agreement","")WinWaitActive("QPR Product Activation Wizard - License Agreement","")Send("{ALTDOWN}a{ALTUP}{ENTER}")WinWait("QPR Product Activation Wizard - Customer Information","")If Not WinActive("QPR Product Activation Wizard - Customer Information","") Then WinActivate("QPR Product Activation Wizard - Customer Information","")WinWaitActive("QPR Product Activation Wizard - Customer Information","")Send("{ENTER}")WinWait("QPR Product Activation Wizard - Activate Licenses","")If Not WinActive("QPR Product Activation Wizard - Activate Licenses","") Then WinActivate("QPR Product Activation Wizard - Activate Licenses","")WinWaitActive("QPR Product Activation Wizard - Activate Licenses","")Send("{ENTER}")WinWait("QPR Product Activation Wizard - Activation Method","")If Not WinActive("QPR Product Activation Wizard - Activation Method","") Then WinActivate("QPR Product Activation Wizard - Activation Method","")WinWaitActive("QPR Product Activation Wizard - Activation Method","")Send("{ENTER}")WinWait("QPR Product Activation Wizard - Finish","")If Not WinActive("QPR Product Activation Wizard - Finish","") Then WinActivate("QPR Product Activation Wizard - Finish","")WinWaitActive("QPR Product Activation Wizard - Finish","")Send("{ENTER}")Im pretty new to scripting so bare over with me :-)You will only have the tray icon. You have no gui so there's no need to worry about minimising it. 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. Link to comment Share on other sites More sharing options...
Banker Posted January 30, 2008 Author Share Posted January 30, 2008 You will only have the tray icon. You have no gui so there's no need to worry about minimising it.I have the tray icon but i also have the windows maximized. I have made a cmde file which calls for the script qpr.exe Link to comment Share on other sites More sharing options...
BrettF Posted January 30, 2008 Share Posted January 30, 2008 I have the tray icon but i also have the windows maximized. I have made a cmde file which calls for the script qpr.exeWinSetState Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Banker Posted January 30, 2008 Author Share Posted January 30, 2008 WinSetStatePlease Xplain a bit more Link to comment Share on other sites More sharing options...
MHz Posted January 30, 2008 Share Posted January 30, 2008 (edited) Please Xplain a bit moreAllow me to show you. If you use Control* functions which do not need active windows then you can minimize as well as use other options to do your actions. This is a modification incomplete and needs the ControlIDs for the ControlClicks. Hopefully you can get that data with AutoIt Info Tool. Note that AutoItMacrogenerator within Scite is worth using for generating a script from scratch for tasks like this as it records using Control* functions. $pid = Run('"' & @ProgramFilesDir & '\QPR 7\Utilities\wlt.exe"') If WinWait("QPR Product Activation Wizard - Welcome Page", "", 60) Then WinSetState("QPR Product Activation Wizard - Welcome Page", "", @SW_MINIMIZE) ControlClick("QPR Product Activation Wizard - Welcome Page", "", "") ; WinWait("QPR Product Activation Wizard - License Agreement") ControlClick("QPR Product Activation Wizard - License Agreement", "", "") ControlClick("QPR Product Activation Wizard - License Agreement", "", "") ; WinWait("QPR Product Activation Wizard - Customer Information") ControlClick("QPR Product Activation Wizard - Customer Information", "", "") ; WinWait("QPR Product Activation Wizard - Activate Licenses") ControlClick("QPR Product Activation Wizard - Activate Licenses", "", "") ; WinWait("QPR Product Activation Wizard - Activation Method") ControlClick("QPR Product Activation Wizard - Activation Method", "", "") ; WinWait("QPR Product Activation Wizard - Finish") ControlClick("QPR Product Activation Wizard - Finish", "", "") EndIf ProcessWaitClose($pid) Edit: Added a pair of missing quotes. Edited January 30, 2008 by MHz Link to comment Share on other sites More sharing options...
Banker Posted January 30, 2008 Author Share Posted January 30, 2008 Allow me to show you. If you use Control* functions which do not need active windows then you can minimize as well as use other options to do your actions. This is a modification incomplete and needs the ControlIDs for the ControlClicks. Hopefully you can get that data with AutoIt Info Tool. Note that AutoItMacrogenerator within Scite is worth using for generating a script from scratch for tasks like this as it records using Control* functions. $pid = Run('"' & @ProgramFilesDir & '\QPR 7\Utilities\wlt.exe"') If WinWait("QPR Product Activation Wizard - Welcome Page", "", 60) Then WinSetState("QPR Product Activation Wizard - Welcome Page", "", @SW_MINIMIZE) ControlClick("QPR Product Activation Wizard - Welcome Page", "", "") ; WinWait("QPR Product Activation Wizard - License Agreement") ControlClick("QPR Product Activation Wizard - License Agreement", "", "") ControlClick("QPR Product Activation Wizard - License Agreement", "", "") ; WinWait("QPR Product Activation Wizard - Customer Information") ControlClick("QPR Product Activation Wizard - Customer Information", "", "") ; WinWait("QPR Product Activation Wizard - Activate Licenses") ControlClick("QPR Product Activation Wizard - Activate Licenses", "", "") ; WinWait("QPR Product Activation Wizard - Activation Method") ControlClick("QPR Product Activation Wizard - Activation Method", "", "") ; WinWait("QPR Product Activation Wizard - Finish") ControlClick("QPR Product Activation Wizard - Finish", "", "") EndIf ProcessWaitClose($pid) Edit: Added a pair of missing quotes. Thx for all help i tried your script, it minimizes the windows, but does not finish Link to comment Share on other sites More sharing options...
MHz Posted January 30, 2008 Share Posted January 30, 2008 Thx for all help i tried your script, it minimizes the windows, but does not finishI did mention incomplete script. It needs ControlIDs added to the 3rd parameter of the ControlClicks to make it work correct. Link to comment Share on other sites More sharing options...
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