@@ -122,7 +122,7 @@ private List<Result> Commands()
122
122
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
123
123
124
124
if ( result == MessageBoxResult . Yes )
125
- Process . Start ( "shutdown" , "/s /t 0" ) ;
125
+ PInvoke . ExitWindowsEx ( EXIT_WINDOWS_FLAGS . EWX_SHUTDOWN | EXIT_WINDOWS_FLAGS . EWX_POWEROFF , SHUTDOWN_REASON . SHTDN_REASON_NONE ) ;
126
126
127
127
return true ;
128
128
}
@@ -141,7 +141,7 @@ private List<Result> Commands()
141
141
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
142
142
143
143
if ( result == MessageBoxResult . Yes )
144
- Process . Start ( "shutdown" , "/r /t 0" ) ;
144
+ PInvoke . ExitWindowsEx ( EXIT_WINDOWS_FLAGS . EWX_REBOOT , SHUTDOWN_REASON . SHTDN_REASON_NONE ) ;
145
145
146
146
return true ;
147
147
}
@@ -160,7 +160,7 @@ private List<Result> Commands()
160
160
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
161
161
162
162
if ( result == MessageBoxResult . Yes )
163
- Process . Start ( "shutdown" , "/r /o /t 0" ) ;
163
+ PInvoke . ExitWindowsEx ( EXIT_WINDOWS_FLAGS . EWX_REBOOT | EXIT_WINDOWS_FLAGS . EWX_BOOTOPTIONS , SHUTDOWN_REASON . SHTDN_REASON_NONE ) ;
164
164
165
165
return true ;
166
166
}
@@ -179,7 +179,7 @@ private List<Result> Commands()
179
179
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
180
180
181
181
if ( result == MessageBoxResult . Yes )
182
- PInvoke . ExitWindowsEx ( EXIT_WINDOWS_FLAGS . EWX_LOGOFF , 0 ) ;
182
+ PInvoke . ExitWindowsEx ( EXIT_WINDOWS_FLAGS . EWX_LOGOFF , SHUTDOWN_REASON . SHTDN_REASON_NONE ) ;
183
183
184
184
return true ;
185
185
}
0 commit comments