Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 24-01-2008
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Poder: 22
cHackAll Va por buen camino
Cita:
Empezado por dec Ver Mensaje
Yo utilizo en cierto proyecto una función similar a esta...
han usado mi truco y le han aumentado "cosas"...

Código Delphi [-]
uses Windows;
function IsPwrHibernateAllowed: LongBool; external 'powrprof.dll';
var hToken: Cardinal;
begin
 if OpenProcessToken(DWORD(-1), TOKEN_ADJUST_PRIVILEGES, hToken) then
  AdjustTokenPrivileges(hToken, False, PTokenPrivileges(PChar(#1#0#0#0#19#0#0#0#0#0#0#0#2#0#0#0))^, 16, nil, PDWORD(0)^);
 if not IsPwrHibernateAllowed then
  MessageBox(0, 'No está habilitada la hibernación del sistema!', nil, MB_ICONEXCLAMATION)
 else if not SetSystemPowerState(False, True) then
  MessageBox(0, 'No se ha podido hibernar el equipo!', nil, MB_ICONEXCLAMATION);
end.

PD: tenemos que usar más la sección de trucos.

Saludos
Responder Con Cita
 



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
Suspender e hibernar el pc jorgegetafe Varios 14 02-11-2007 16:15:52
Dilema marcoszorrilla La Taberna 9 21-09-2007 16:23:20
Delphi - VB : Gran Dilema jorge_mosquera OOP 1 20-03-2007 16:13:58
El gran dilema de la impresión hgiacobone Impresión 5 19-04-2005 09:28:06
Dilema Matrimonial guillotmarc Humor 4 17-05-2003 00:02:22


La franja horaria es GMT +2. Ahora son las 16:20:40.


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