added wxShutdown (patch 547443)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-05-05 14:18:36 +00:00
parent 32b5be3d67
commit f6ba47d997
8 changed files with 139 additions and 4 deletions

View File

@@ -290,6 +290,29 @@ bool wxShell(const wxString& command, wxArrayString& output)
return wxExecute(wxMakeShellCommand(command), output);
}
// Shutdown or reboot the PC
bool wxShutdown(wxShutdownFlags wFlags)
{
wxChar level;
switch ( wFlags )
{
case wxSHUTDOWN_POWEROFF:
level = _T('0');
break;
case wxSHUTDOWN_REBOOT:
level = _T('6');
break;
default:
wxFAIL_MSG( _T("unknown wxShutdown() flag") );
return FALSE;
}
return system(wxString::Format(_T("init %c"), level).mb_str()) == 0;
}
#if wxUSE_GUI
void wxHandleProcessTermination(wxEndProcessData *proc_data)