Jump to content

Next And Reboot Buttons


Recommended Posts

You can do it with the gui functions, or just the standard msgbox if you like:

$msg=msgbox(4,"Reboot, or continue?", "Click yes to reboot, no to continue")
if $msg=7 then okbutton()
   

if $msg=6 then 
   msgbox(1,"info","I would reboot now")
  ;Shutdown(6)  
  ;Force a reboot remove; in front of shutdown 
EndIf


Func OKButton()
   msgbox(1,"info","Pressed ok")
EndFunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

most right from help file:

#include <GUIConstants.au3>

GUICreate("Reboot, or continue?", 200, 100) ; will create a dialog box that when displayed is centered

Opt("GUICoordMode",2)
$reboot=GUICtrlCreateButton ("Reboot",  10, 30, 50)
$next=GUICtrlCreateButton ( "Next",  0, -1)

GUISetState ()    ; will display an  dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE or $msg = $reboot or $msg = $next Then ExitLoop
Wend
GUIDelete ()
If $msg = $reboot Then reboot()
If $msg = $next then OKButton()
  

func reboot() 
   msgbox(1,"info","I would reboot now")
  ;Shutdown(6)  
  ;Force a reboot remove; in front of shutdown 
Endfunc


Func OKButton()
   msgbox(1,"info","Pressed ok")
EndFunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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