Jump to content

Recommended Posts

Posted

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.

Posted

  ejbmail said:

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]

Posted

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.

  Monamo said:

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
Posted

When I add this line into my script I receive this error:

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4095, "Installation Completed", "**** Please reboot the PC ****")"')

  weaponx said:

This is the relevant part:

Run(@AutoItExe & ' /AutoIt3ExecuteLine  "MsgBox(0, ''Notice:'', ''Note that the counter in the background GUI continues incrementing'')"')

post-22821-1196103091_thumb.jpg

Posted

This is the good way :P

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(4096, ''Installation Completed'', ''**** Please reboot the PC ****'')"')

Best Regards.Thierry

Posted

That worked Great, Many thanks to all........

  Valuater said:

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)

  • 2 weeks later...
Posted

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

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...