>hi all
>I have a question and its about to shut down windows from vfp
>
>its possible to write a code in a click of a button of some form i vfp
>and when i click in it tha vfp 5.0 app close an the windows95 too?
>
>thanks to all for all the help that i receive from you
>
>A.M.G
Yes you can shutdown Win 95 from VFP. You need the following:
DECLARE SHORT ExitWindowsEx IN Win32API;
SHORT uFlags, INTEGER dwReserved
uFlags may be one of the following values:
#DEFINE EWX_LOGOFF 0
#DEFINE EWX_SHUTDOWN 1
#DEFINE EWX_REBOOT 2
#DEFINE EWX_FORCE 4
#DEFINE EWX_POWEROFF 8
You may be interested in the following notes:
EWX_LOGOFF - All processes are forced to terminate regardless of whether or not the respond. In VFP, the system then re-starts.
EWX_SHUTDOWN - Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.
EWX_REBOOT Shuts down the system and then restarts Windows.
EWX_FORCE - All processes are forced to terminate regardless of whether or not the respond. In VFP, the system then re-starts.
EWX_POWEROFF - Shuts down the system and turns off the power. The system must support the power-off feature.
dwReserved is reserved and should be 0.
The function returns a Boolean value in the form of an integer. 1 indicates True, 0, False.
Tests indicated the following on a Novell network: Both EWX_LOGOFF and EWX_FORCE produced the same result. Windows reported that a network application (VFP) was not responding, treated it as an error, and restarted Windows.
George
Ubi caritas et amor, deus ibi est