How can I make a program which makes my computer shutdown?? I'm using Borland 5.02... I tryed exwindowexit or something liek that but it didnt work ..... Hope u will help me .. thanx
How can I make a program which makes my computer shutdown?? I'm using Borland 5.02... I tryed exwindowexit or something liek that but it didnt work ..... Hope u will help me .. thanx
ExitWindowsEx(EWX_POWEROFF,NULL) should shut it down. If you are using windows 9x, it wont work from the console though.
So what should I do? I'm using win 98????
write it as a windows app and not a console app. Use ExitWindowsEx() as zen has said. Why do you want to do this?
If all you want is a one-click shutdown icon there is an easier way using Rundll32.exe to run the shutdown function.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
yet when I tell him this, he yells at me...
Speaking of Shutting down and such, how would you call another .exe from your program? Like once you excute it, it would execute something else?
C:\Windows\rundll.exe,user.exe exitwindowsexec will restart.
C:\Windows\rundll.exe,user.exe exitwindows will shutdown.
But im sure most of you already knew that