Valuater Posted May 24, 2005 Share Posted May 24, 2005 (edited) If a user is in the middle of a script ( a script that normally waits for user to finish a process before continuing the script) and the user would like to keep this process open AND continue the script... (say it was in a runwait process) is this posible? here is an example code i am working on expandcollapse popup#include <GUIConstants.au3> #include <File.au3> #include <Array.au3> #include <String.au3>> #notrayicon #include <GuiTab.au3> $My_GUI=GUICreate("My GUI",400,200,50,50,"", $WS_EX_TOPMOST) $Button1= GUICtrlCreateButton("Test", 30,30,100,30) $Button2= GUICtrlCreateButton("Test RunWait", 30,90,100,30) GUICtrlCreateLabel("Use Icon to ""Reset"" and to ""Exit"" this Program", 50,140) GUISetState() Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1); Default tray menu items (Script Paused/Exit) will not be shown. TraySetClick (16) $Resetitem = TrayCreateItem("Reset Focus on GUI") TrayItemSetOnEvent(-1,"Reset") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"ExitScript") TraySetState() GUISetState(@SW_SHOW, $My_GUI) While 1 $msg = GUIGetMsg() Select Case $msg = $Button1 MsgBox(0, "GUI Event", "Script has the Focus") Case $msg = $Button2 $val = RunWait("Notepad.exe", "C:\WINDOWS", @SW_SHOWNORMAL) EndSelect WEnd Exit ; Functions Func Reset() Msgbox(0,"Reset Focus","Re-setting Focus on GUI from RunWait") ;_GUICtrlTabDeselectAll ($tab, 0); resets tab buttons WinSetState("My GUI", "", @SW_RESTORE) WinActivate("My GUI") ControlFocus ("My GUI", "",$My_GUI) EndFunc Func ExitScript() Exit EndFunc requires 3.1.1++ any help would be appreciated thanks Edited May 24, 2005 by Valuater Link to comment Share on other sites More sharing options...
CyberSlug Posted May 24, 2005 Share Posted May 24, 2005 You would need to use Run instead of RunWait. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Mr. Crimson Posted May 24, 2005 Share Posted May 24, 2005 You could implement a While loop that checks in on the user every once in a while to see if they'd like more time with a MsgBox, or maybe even make a hotkey to interrupt the process if the user would like. -Crim Link to comment Share on other sites More sharing options...
Valuater Posted May 24, 2005 Author Share Posted May 24, 2005 You would need to use Run instead of RunWait.<{POST_SNAPBACK}>I had a secondary use in mind for this... basically to handle a "lock-up" , "conflct" or "crash" and could use something like this to "reset" the script programany ideas?thanks again 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