ReExitWindowsEx
Publicado por Julián (2 intervenciones) el 09/12/2002 15:25:40
Tengo el siguiente Código:
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long
Public Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, _
ByVal dwReserved As Long) As Long
Public Declare Function AdjustTokenPrivileges Lib "advapi32.dll" (ByVal TokenHandle As Long, ByVal DisableAllPrivileges As Long, NewState As TOKEN_PRIVILEGES, ByVal BufferLength As Long, PreviousState As TOKEN_PRIVILEGES, ReturnLength As Long) As Long
Sub main()
Dim privilegExit As TOKEN_PRIVILEGES
AdjustTokenPrivileges TOKEN_ASSIGN_PRIMARY, TOKEN_ADJUST_PRIVILEGES, privilegExit, &O0, privilegExit, &O0
ExitWindowsEx EWX_SHUTDOWN, EWX_LOGOFF
End Sub
Este código no sé donde puede estar mal, el caso es que no me apaga
el sistema, si me podeis echar una mano, os lo agradezco, gracias
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long
Public Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, _
ByVal dwReserved As Long) As Long
Public Declare Function AdjustTokenPrivileges Lib "advapi32.dll" (ByVal TokenHandle As Long, ByVal DisableAllPrivileges As Long, NewState As TOKEN_PRIVILEGES, ByVal BufferLength As Long, PreviousState As TOKEN_PRIVILEGES, ReturnLength As Long) As Long
Sub main()
Dim privilegExit As TOKEN_PRIVILEGES
AdjustTokenPrivileges TOKEN_ASSIGN_PRIMARY, TOKEN_ADJUST_PRIVILEGES, privilegExit, &O0, privilegExit, &O0
ExitWindowsEx EWX_SHUTDOWN, EWX_LOGOFF
End Sub
Este código no sé donde puede estar mal, el caso es que no me apaga
el sistema, si me podeis echar una mano, os lo agradezco, gracias
Valora esta pregunta


0