Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shut down win95 from VFP5.0
Message
 
To
29/04/1998 09:14:53
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00095648
Message ID:
00095649
Views:
24
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform