Typing Rundll32 User,ExitWindows (or something like that... I can't remember it exactly) into the Run command works, so with the right header file (system.h i think) you can use the ShellExecute command:
I think its User,ExitWindows. Try User32 if User doesn't work... I can't remember the exact contect of the command... but that's one way of shutting down a system from C++ (Or from the Run command, and hence from a .LNK shortcut file as well, should the need arise).Code:#include <system.h> ... ... ShellExecute(this->Handle,"open","rundll32 User,ExitWindows",NULL,"",SW_SHOWNORMAL); ... ...




Reply With Quote