Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ExitWindowsEx doesn't seem to work Correctly
Message
From
08/09/1997 19:35:59
 
 
To
08/09/1997 14:16:10
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00048937
Message ID:
00049084
Views:
53
>>Hi Scott!
>>
>>Instead of ExitwindowEx function you should use InitiateSystemShutdown
>>function (the prototype shown below):
>>
>>BOOL InitiateSystemShutdown(
>> LPTSTR lpMachineName, // address of name of computer to shut down
>> LPTSTR lpMessage, // address of message to display in dialog box
>> DWORD dwTimeout, // time to display dialog box
>> BOOL bForceAppsClosed, // force applications with unsaved changes flag
>> BOOL bRebootAfterShutdown // reboot flag
>> );
>>
>>
>>>I'm trying to implement a full NT 4.0 shutdown from a Vis. Fox 5.0
>>>App. I've found info on DECLAREing the ExitWindowsEx function and
>>>according to the WINUSER.H file, by passing a 2 to the function
>>>should signal a system shutdown. Instead it only cycles to the login
>>>screen (Press Ctrl+ALt+Del to Login)
>>>
>>>Am I missing something?
>>>
>>>Scott O'Donnell
>>>scotto@iworksys.com
>
>I hope this isn't to much to ask, I've just started using the API functions
>under VFP and don't know it too well yet. I've tried this, but it doesn't work
>Am I not mapping types correctly?
>
>Declare integer InitiateSystemShutdown in win32api as DownIt STRING,STRING,Long,INTeger ,INTeger

Always pass strings as reference:

Declare integer InitiateSystemShutdown in win32api as DownIt;
STRING @, STRING @, INTEGER, INTEGER, INTEGER

>Does the STRING Keyword map back to LPTSTR?

Yes, but you must pass it by reference (also, declare it as passed by reference).

>Does INTEGER Keyword Map back to BOOL?

Yes.

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform