bool API_ReStartComputer(int nWaitTime /*= 30*/)
{
USES_CONVERSION;
CString strExec;
strExec.Format(_T("\"Shutdown\" -r -t %d"), nWaitTime);
return ::WinExec(W2A(strExec), 0) > 31;
}
bool API_CloseComputer(int nWaitTime /*= 30*/)
{
USES_CONVERSION;
CString strExec;
strExec.Format(_T("\"Shutdown\" -s -t %d"), nWaitTime);
return ::WinExec(W2A(strExec), 0) > 31;
}
c++关机/重启
最新推荐文章于 2024-08-09 18:50:22 发布