shut down from vfp 
Author Message
 shut down from vfp

is there a way to shut down a computer via vfp?? suppose there is a button
called shut down, and if the user clik it then the computer will be shut
down. any idea??


Sat, 19 May 2001 03:00:00 GMT  
 shut down from vfp
Gunawan:

#define EWX_LOGOFF   0
#define EWX_SHUTDOWN 1
#define EWX_REBOOT   2
#define EWX_FORCE    4
#define EWX_POWEROFF 8

DECLARE INTEGER ExitWindowsEx IN win32api INTEGER, INTEGER

ExitWindowsEx(EWX_REBOOT, 0)

Substitute any of the constants for the desired action.

David Dunetz
SweetWARE

Quote:

>is there a way to shut down a computer via vfp?? suppose there is a button
>called shut down, and if the user clik it then the computer will be shut
>down. any idea??



Sun, 20 May 2001 03:00:00 GMT  
 shut down from vfp
I tried in windows 95, it works, but with Nt4.0 with SP4, it doesn't,
I wonder if my win32api file is no good.

Thanks

On Wed, 2 Dec 1998 09:27:26 -0800, "David Dunetz"

Quote:

>Gunawan:

>#define EWX_LOGOFF   0
>#define EWX_SHUTDOWN 1
>#define EWX_REBOOT   2
>#define EWX_FORCE    4
>#define EWX_POWEROFF 8

>DECLARE INTEGER ExitWindowsEx IN win32api INTEGER, INTEGER

>ExitWindowsEx(EWX_REBOOT, 0)

>Substitute any of the constants for the desired action.

>David Dunetz
>SweetWARE


>>is there a way to shut down a computer via vfp?? suppose there is a button
>>called shut down, and if the user clik it then the computer will be shut
>>down. any idea??



Mon, 28 May 2001 03:00:00 GMT  
 shut down from vfp
Ahkit,

The ExitWindowsEx function is available in NT. TO use it you have to have
the correct privileges. The following is from the function description:

Windows NT: To shut down or restart the system, the calling process must use
theAdjustTokenPrivileges function to enable the SE_SHUTDOWN_NAME privilege.
For more information about security privileges, seePrivileges.

David Dunetz
SweetWARE

Quote:

>I tried in windows 95, it works, but with Nt4.0 with SP4, it doesn't,
>I wonder if my win32api file is no good.

>Thanks

>On Wed, 2 Dec 1998 09:27:26 -0800, "David Dunetz"

>>Gunawan:

>>#define EWX_LOGOFF   0
>>#define EWX_SHUTDOWN 1
>>#define EWX_REBOOT   2
>>#define EWX_FORCE    4
>>#define EWX_POWEROFF 8

>>DECLARE INTEGER ExitWindowsEx IN win32api INTEGER, INTEGER

>>ExitWindowsEx(EWX_REBOOT, 0)

>>Substitute any of the constants for the desired action.

>>David Dunetz
>>SweetWARE


>>>is there a way to shut down a computer via vfp?? suppose there is a
button
>>>called shut down, and if the user clik it then the computer will be shut
>>>down. any idea??



Mon, 28 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Shutting down Win95 from VFP 3.0b

2. Shut down application at midnight

3. Fatal Exception Error and Shut Down

4. Shutting down an external program

5. Closing application when Windows shut down

6. Shut down Windows 95 programmatically

7. VFP5 shuts down machine

8. Shutting down Windows from foxpro

9. Shut Down Windows

10. Executable keeps shutting down

11. Shut down application if no activity

12. Can you shut down an ole server

 

 
Powered by phpBB® Forum Software