Sign in to follow this  
Followers 0
Clever1mba

Next And Reboot Buttons

4 posts in this topic

hello

i want to promte user for Reboot and Next Buttons

if user select reboot system restart and if user click Next Button

then go for this Func OKButton()

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

Thanks scriptkitty

and how with gui

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0