I have used
ExitWindows(EWX_LOGOFF|EWX_REBOOT,0);
but it logs of and waits for logon
I also tried
EWX_REBOOT only and also with EWX_FORCE nothing happens same result what to do?
I have used
ExitWindows(EWX_LOGOFF|EWX_REBOOT,0);
but it logs of and waits for logon
I also tried
EWX_REBOOT only and also with EWX_FORCE nothing happens same result what to do?
http://msdn.microsoft.com/library/de...xitwindows.asp
msdn'ness!! ^^^
anyways, here's what i saw there:
ExitWindows
The ExitWindows function logs off the current user. It sends the WM_QUERYENDSESSION message to determine if they can be terminated.
To shut down the system, or shut down and restart the system, use the ExitWindowsEx function.
note the italicized/bolded sentence...
I used ExitWindowsEx but i give me error for reasons macro it says it is not defined
Please provide me the definations of macros(all)
are you linking the user32 lib? cause it just needs windows.h
try something like this
Code:ExitWindowsEx( EWX_REBOOT, SHTDN_REASON_MAJOR_APPLICATION );
Woop?
I want Defination of SHTDN_REASON_MAJOR_APPLICATION macro
i.e
#define SHTDN_REASON_MAJOR_APPLICATION ????
Like I said in one of your other threads, you can't just go round grabbing random declarations from other peoples header files (and/or libraries to match), and expect it all to work.
If your OS/Compiler is too old, then either upgrade or find another way to achieve what you want.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Youve stated that you have VC++6.
In that case download the Platform SDK from here...http://www.microsoft.com/msdownload/...sdk/sdkupdate/
That will give you current headers and libs for all of the general APIS
The calling thread has to have the SE_SHUTDOWN_NAME privilege in order to shutdown or reboot.
How to Shut Down the System
gg