Thursday, July 30, 2009

How to shut down or restart pc(windows) using a C program?

only C, not C++





please give me the code for starting %26amp; restarting pc


and tell the libraries to be included


and how to do linking if needed


i don't have user32.lib and windows.h


from where can i get it


thanks

How to shut down or restart pc(windows) using a C program?
windows.h and user32.lib can de found online at microsoft by downloading the visual c++ express edition. You can also get these files by downloading mingw and it w32-lib package.





To restart the computer in C do:


ExitWindowsEx(EWX_REBOOT,0);





to shutdown:


ExitWindowsEx(EWX_POWEROFF,0);
Reply:winuser.h


= http://doc.ddart.net/msdn/header/include... .html


No comments:

Post a Comment