How to shutdown a computer?
I am a beginner programmer. I would like to make a windows program that will shut down the computer. First the user double clicks on the application and a dialog box pops up saying that windows will shutdown. The user clicks ok and the computer then shutsdown immediately. I have made a dos program that does this. But when I try to do the same thing for a windows application, I only get the dialog box and a dos prompt pops up real quick and goes away. Here is the key figure of my code responsible for shuting the computer:
system("Shutdown -s -t00"); Any way maybe you could help me fiqure out how to do this.