#include <iostream>
#include <Windows.h>
#include <process.h>
//#include "windowstate.cpp"
//DWORD WINAPI MyThreadFunction( LPVOID lpParam );
using namespace std;
int Zeit;
unsigned int __stdcall wfshutdown() {
Sleep(Zeit*60000);
system("shutdown -s -t 2");
return 0;
}
void shutdown() {
cout << "When I should shut down your PC(in minutes)" << endl;
cin >> Zeit;
if(Zeit==0) {
return;
}
// windowstate(0);
HANDLE hThread;
DWORD threadID;
hThread = (HANDLE)_beginthreadex( NULL, 0, &wfshutdown, NULL, 0, &threadID );
}
我无法运行该程序。我收到此错误,我不明白:
错误 1 错误 C2664: '_beginthreadex' : 无法将参数 3 从 'unsigned int (__stdcall *)(void)' 转换为 'unsigned int (__stdcall *)(void *)'32
我不小心在网上搜索了一个多小时以找到解决方案,因此非常希望您能提供帮助。