
Shutdown windows (3.1 / 3.11 / 95)
Quote:
> Is there any way of getting VB4 to shutdown windows properly.
> currently I can reboot the computer or restart windows using the WINAPI
> ExitWindows (or something like that, I can't remember off the top of my
> head) but I'm looking for something that will allow me to exit windows
3.1
> / 3.11 to DOS, and shutdown windows 95 to the "turn off" prompt.
Its all the same. The ExitWindows API function can be used all the way
from Win 3.11 to WinNT 4.0... You just have to use the correct constants.
(NT has security settings and a new function called
InitiateSystemShutdown).
From the Win3.1 Help on ExitWindows:
The ExitWindows function can restart Windows, terminate Windows and return
control to MS-DOS, or terminate Windows and restart the system. Windows
sends the WM_QUERYENDSESSION message to notify all applications that a
request has been made to restart or terminate Windows. If all applications
"agree" to terminate, Windows sends the WM_ENDSESSION message to all
applications before terminating.
EW_REBOOTSYSTEM Causes Windows to terminate and the system to restart.
EW_RESTARTWINDOWS Causes Windows to restart.
see ya.
--
Jim Houghtaling
One-seventh of your life will be spent on Mondays.