Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 23-11-2006
pjmedina pjmedina is offline
Miembro
 
Registrado: abr 2006
Posts: 84
Poder: 21
pjmedina Va por buen camino
Prueba con esta funcion a ver que tal te va...

Código Delphi [-]
function ShutDownWindows(Flag: word): Boolean;
var
  TokenPriv: TTokenPrivileges;
  H: DWord;
  HToken: THandle;
begin 
  if Win32Platform = VER_PLATFORM_WIN32_NT then 
    begin 
      OpenProcessToken(GetCurrentProcess,
          TOKEN_ADJUST_PRIVILEGES,HToken);
      LookUpPrivilegeValue(NIL, 'SeShutdownPrivilege',
          TokenPriv.Privileges[0].Luid);
      TokenPriv.PrivilegeCount := 1;
      TokenPriv.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
      H := 0;
      AdjustTokenPrivileges(HToken, FALSE,
         TokenPriv, 0, PTokenPrivileges(NIL)^, H);
      CloseHandle(HToken);
    end; 
  Result := ExitWindowsEx(Flag, 0);
end;

La llamada a la función es:

Código Delphi [-]
ShutDownWindows(EWX_SHUTDOWN)

Suerte
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
El ordenador no se apaga del todo con ExitWindowsEx() en Win2000 aram2r API de Windows 4 18-11-2008 18:39:38


La franja horaria es GMT +2. Ahora son las 00:34:53.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi