Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shutdown the Computer
Message
De
13/07/2002 04:57:17
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Shutdown the Computer
Divers
Thread ID:
00678377
Message ID:
00678377
Vues:
47
Hi, I need help to shutdown the system, I'm working under W2k, and the system haven't got a keyboard and mouse, it has a Touch Screen, the user has problems to shutdown the system with her finger, beacause the "Start" button are down-left in the screen.

In the MSDN I was found this function:
BOOL MySystemShutdown()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;

// Get a token for this process.

if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return( FALSE );

// Get the LUID for the shutdown privilege.

LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,
&tkp.Privileges[0].Luid);

tkp.PrivilegeCount = 1; // one privilege to set
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

// Get the shutdown privilege for this process.

AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
(PTOKEN_PRIVILEGES)NULL, 0);

if (GetLastError() != ERROR_SUCCESS)
return FALSE;

// Shut down the system and force all applications to close.

if (!ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE, 0))
return FALSE;

return TRUE;
}

This code is C, I don't know how to convert to Vfp code.

I was try to run the W9x function:

DECLARE INTEGER ExitWindowsEx IN WinApi32 AS SalirWindows;
INTEGER nValorApagado

SalirWindows(0)

But this code under W2k and WXp only close the user, and show the windows to change the active user

Please I need help!!!!

Thanks in avance
Miguel Angel
madiaz@ono.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform