Arrêter l'ordinateur
Publié : mar. 17/févr./2004 18:00
Salut, j'ai un petit prob avec la fonction ExitWindowsEx_()
voila les paramètres (en anglais)
mais j'arrive pas à arrêter l'ordinateur, c'est normalement ce code ci mais marche pas
j'ai essayé de combiner les flag sans résultat alors un petit cou p de main, ce serai pas de refus
Merci
voila les paramètres (en anglais)
j'arrive à déconnecter l'utilisateur· uFlags
Specifies the type of shutdown. This parameter must be some combination of the following values:
EWX_FORCE
Forces processes To terminate. When this flag is set, Windows does not send the messages WM_QUERYENDSESSION And WM_ENDSESSION To the applications currently running in the system. This can cause the applications To lose Data. Therefore, you should only use this flag in an emergency.
EWX_LOGOFF
Shuts down all processes running in the security context of the process that called the ExitWindowsEx function. Then it logs the user off.
EWX_POWEROFF
Shuts down the system And turns off the power. The system must support the power-off feature.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
Windows 95: Security privileges are not supported Or required.
EWX_REBOOT
Shuts down the system And then restarts the system.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
Windows 95: Security privileges are not supported Or required.
EWX_SHUTDOWN
Shuts down the system To a point at which it is safe To turn off the power. All file buffers have been flushed To disk, And all running processes have stopped.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
Windows 95: Security privileges are not supported Or required.
· dwReserved
Reserved; this parameter is ignored.
Code : Tout sélectionner
ExitWindowsEx_(#EWX_LOGOFF, 0) ; Déconnecter

Code : Tout sélectionner
ExitWindowsEx_(#EWX_POWEROFF, 0)
Merci