I have a program in which I want to provide shutdown facility so that the user can shutdown the computer from my program without going to the start menu. How to perform this task? Can anybody help!!!!
m.v. suresh
Printable View
I have a program in which I want to provide shutdown facility so that the user can shutdown the computer from my program without going to the start menu. How to perform this task? Can anybody help!!!!
m.v. suresh
You should learn to find answers to your question by using the VisualStudio help.
In Visual Studio 6.0, goto menu help->search..
In the MSDN search dialogbox, click on the "Contents" tab. Go to
-->Platform SDK->Reference->Win32 functions by category->System shut down functions. And there you can find all you need to shut down the system.
I hate fat programs as much as I hate being fat myself. I am lean and mean and so is my program.
Use this function ExitWindowsEx
What parametes are need in that function(ExitWindowsEx)? How do I use it in my code?
Thanx steve, Your suggestion has solved my problem.
m.v. suresh
Call the windows API ExitWindows or ExitWindowEx for shutting down windows.
A sample is
[ccode]
::ExitWindowsEx(EWX_LOGOFF,0) will logoff the computer;.
::ExitWindowsEx(EWX_SHUTDOWN,0) will shutdown the computer.
See the MSDN for more details about the ExitWindows and ExitWindowsEx.