Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shutdown Windows from vfp
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00257880
Message ID:
00257905
Views:
14
>Hi again
>
>I found the API call to shutdown Windows from VFP but the only thing it does is to log off my workstation. I am Using VFP 6 SP3 On Win 98. Anyybody know what i am doing wrong here. Here is my code:
>
>
>
>*--SysShut.Prg
>#define EWX_LOGOFF 0
>#define EWX_SHUTDOWN 0x00000001
>#define EWX_REBOOT 0x00000002
>#define EWX_FORCE 0x00000004
>#define EWX_POWEROFF 0x00000008
>
>declare integer ExitWindowsEx IN Win32Api Integer Code, Integer dwReserved
>
>=ExitWindowsEx(EWX_SHUTDOWN, 0)
>

You need both the EWX_FORCE and EWX_SHUTDOWN values (EWX_SHUTDOWN + EWX_FORCE), and you must have ACPI/APM enabled on the station if you want it to actually power off the system and then use EWX_POWEROFF + EWX_FORCE.)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform