im a noob so i may look stupid but why are there so many errors in this and when i compile it the file ndef pops up and the compiler shows errors from that too so please help...
and i havent added in all the options yet because of i want to test it first
#include <windows.h>
#include <iostream>
#include <PowrProf.h>
#pragma comment(lib, "PowrProf.lib")
usingnamespace std;
int main()
{
int choice;
cout << "Power Manager V1" << endl
<< "To Hibernate == 1" << endl
<< "To power off == 2" << endl
<< "To stand == 3" << endl
<< "To restart == 4" << endl;
cin >> choice;
if(choice == 1)
SetSuspendState(true, false, false);
getchar();
// just use this instead of your keep_window_open()
// function, which I doubt is better than getchar()
return 0;
}
To call a function, the syntax is FunctionName(parameters); for example: SetSuspendState /*function name*/ (true, false, false /*parameters*/)
Also, the reason you had so many errors (apart from your syntax) is probably that you didn't include windows.h, it contains definitions that PowrProf.h uses.