Private Sub Form_Load()
msg = MsgBox("Il programma sta per riavviare il sistema !!! Premere OK per continuare , Annulla per non Riavviare!!!", vbCritical + vbOKCancel + 256, App.Title)
If msg = vbCancel Then End
ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
End Sub
Non mi funziona:
Se nel msgbox premo cancel mi arresta l'applicazione
se premo Ok mi ritorna all'applicazione e non succede nulla
Riporto il mio codice:
Private Sub Timer1_Timer()
If timeselected.Caption = Time Then
If auto_poweroff_pc.Value = 1 Then
msg = MsgBox("Il programma sta per arrestare il sistema !!! Premere OK per continuare , Annulla per non Riavviare!!!", vbCritical + vbOKCancel + 256, App.Title)
If msg = vbCancel Then End
If msg = vbOK Then ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
Else
Unload frmMain
Unload Me
Unload frmTools
Unload frmInfo
Unload frmUseronline
End
End If
End If
End Sub