ejbmail Posted November 26, 2007 Share Posted November 26, 2007 I need HELP on how to display a message box but the script will continue to finish with the message box still remaining on the Remote PC. I can not use a time out function because I want to leave the message box for the user to reboot when he can. Link to comment Share on other sites More sharing options...
Monamo Posted November 26, 2007 Share Posted November 26, 2007 I need HELP on how to display a message box but the script will continue to finish with the message box still remaining on the Remote PC. I can not use a time out function because I want to leave the message box for the user to reboot when he can. I believe what you're looking for is /AutoIt3ExecuteLine (check for it in the help file under "Search") Here's an example: #include <GUIConstants.au3> GUICreate("Background process",500,500) GUICtrlCreateLabel("Counter:",10,10,50,20) $counter = GUICtrlCreateLabel("",10,25,50,20) $start = 1 $stop = 10 GUICtrlSetData($counter,$start) GUISetState() While 1 Do Sleep (1000) GUICtrlSetData($counter,GUICtrlRead($counter)+1) If GUICtrlRead($counter) = 3 Then Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Notice:'', ''Note that the counter in the background GUI continues incrementing'')"') EndIf Until GUICtrlRead($counter) = $stop Exit WEnd - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
ejbmail Posted November 26, 2007 Author Share Posted November 26, 2007 A quick question..... Do you mean that I should run my script exe with this run command or add this to my script as a command line for the message box. I believe what you're looking for is /AutoIt3ExecuteLine (check for it in the help file under "Search") Here's an example: #include <GUIConstants.au3> GUICreate("Background process",500,500) GUICtrlCreateLabel("Counter:",10,10,50,20) $counter = GUICtrlCreateLabel("",10,25,50,20) $start = 1 $stop = 10 GUICtrlSetData($counter,$start) GUISetState() While 1 Do Sleep (1000) GUICtrlSetData($counter,GUICtrlRead($counter)+1) If GUICtrlRead($counter) = 3 Then Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Notice:'', ''Note that the counter in the background GUI continues incrementing'')"') EndIf Until GUICtrlRead($counter) = $stop Exit WEnd Link to comment Share on other sites More sharing options...
weaponx Posted November 26, 2007 Share Posted November 26, 2007 This is the relevant part: Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Notice:'', ''Note that the counter in the background GUI continues incrementing'')"') Link to comment Share on other sites More sharing options...
ejbmail Posted November 26, 2007 Author Share Posted November 26, 2007 When I add this line into my script I receive this error: Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4095, "Installation Completed", "**** Please reboot the PC ****")"') This is the relevant part: Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Notice:'', ''Note that the counter in the background GUI continues incrementing'')"') Link to comment Share on other sites More sharing options...
Tlem Posted November 26, 2007 Share Posted November 26, 2007 This is the good way Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4096, ''Installation Completed'', ''**** Please reboot the PC ****'')"') Best Regards.Thierry Link to comment Share on other sites More sharing options...
Valuater Posted November 26, 2007 Share Posted November 26, 2007 Maybe... Run(@AutoItExe & ' /AutoIt3ExecuteLine "If MsgBox(262209,''Ready to Re-Start'',''The Installation is completed and ready to re-start. '' & @CRLF & @CRLF & ''Press OK to restart now.'' & @CRLF & @CRLF) = 1 Then Shutdown(6)"') 8) Link to comment Share on other sites More sharing options...
ejbmail Posted November 26, 2007 Author Share Posted November 26, 2007 That worked Great, Many thanks to all........ Maybe... Run(@AutoItExe & ' /AutoIt3ExecuteLine "If MsgBox(262209,''Ready to Re-Start'',''The Installation is completed and ready to re-start. '' & @CRLF & @CRLF & ''Press OK to restart now.'' & @CRLF & @CRLF) = 1 Then Shutdown(6)"') 8) Link to comment Share on other sites More sharing options...
MrCreatoR Posted December 6, 2007 Share Posted December 6, 2007 This method is good for returning values: $iCount = 0 ;Only for the example AdlibEnable("SetData", 1000) $iRet = _MsgBoxEx(36, "My Title", "Message") MsgBox(64, "", "Returned Value is: " & $iRet) Func SetData($sData) $iCount += 1 ConsoleWrite("The script is not paused " & $iCount & " second(s)" & @LF) EndFunc Func _MsgBoxEx($iType, $sTitle, $sText, $iTimeOut=0) Local $sAu3Line = '"ConsoleWrite(MsgBox(' & $iType & ', ''' & $sTitle & ''', ''' & $sText & ''', ' & $iTimeOut & '))"' Local $iAu3PID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $sAu3Line, '', @SW_SHOW, 6) WinWait($sTitle, $sText) Local $iStdOutRead While ProcessExists($iAu3PID) $iStdOutRead = StdoutRead($iAu3PID, 5, True) If Number($iStdOutRead) Then Return $iStdOutRead Sleep(10) WEnd If Number($iStdOutRead) Then Return $iStdOutRead Return SetError(1, 0, -1) EndFunc Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team 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