Information générale
Catégorie:
Codage, syntaxe et commandes
>>>>I put this code into xboot.prg and then ran it... nothing happened.
>>>>
>>>>Is there more I need to know / do?
>>>>
>>>>Thanks
>>>>
>>>>>>I need to lock a PC so that it runs my app on startup and reboots when my app exits...
>>>>>>
>>>>>>Any ideas?
>>>>>
>>>>>DECLARE INTEGER ExitWindowsEx IN WIN32API INTEGER uFlags, INTEGER nReserved
>>>>>ExitWindowsEx(2 + 4 + 16, 0)
>>>>>
>>>
>>>It worked on the machine I tested at home; try using 6 (drop the ForceIfHung flag, 0x10, from the flag mix) rather than 22, since that might not be in whatever version of the API you're using. It's a relatively late addition to the API.
>>>
>>>>>>
>>>>>>TIA
>>
>>Is this what you mean......
>>
>>DECLARE INTEGER ExitWindowsEx IN WIN32API INTEGER uFlags, INTEGER nReserved
>>*ExitWindowsEx(2 + 4 + 16, 0)
>>ExitWindowsEx(6,0)
>>
>>?????????????????
>>
>>Still didn't reboot... Where can I find API help?
>
>The MSDN documentation on the Platform SDK entry for ExitWindowsEx(); the flag values are defined in WINBASE.H, and there were threads on this API call in the last few days that included the list of flags.
>
>If this is NT, you may need to be running with a different set of permissions in order to get the API call to work - not all users and applications have the necessary permissions to force a reboot. You might want to check the return code from ExitWindowsEx (it will return a numeric value) and see what that value is.
Yep, it's NT... I thought that if I could do a *physical* reboot with ctl+alt+del, then I could do a programmatic reboot... not that simple, I guess. Thanks for your help, I will check out the documentation.
Larry
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement