Поддерживает ли система suspend?
Falk0ner, вс, 06/07/2008 - 15:34.
function SuspendAllowed: Boolean;
type
TIsPwrSuspendAllowed = function: Boolean;
stdcall;
var
hPowrprof: HMODULE;
IsPwrSuspendAllowed: TIsPwrSuspendAllowed;
begin
Result := False;
hPowrprof := LoadLibrary('powrprof.dll');
if hPowrprof <> 0 then
begin
try
@IsPwrSuspendAllowed := GetProcAddress(hPowrprof, 'IsPwrSuspendAllowed');
if @IsPwrSuspendAllowed <> nil then
begin
Result := IsPwrSuspendAllowed;
end;
finally
FreeLibrary(hPowrprof);
end;
end;
end;
type
TIsPwrSuspendAllowed = function: Boolean;
stdcall;
var
hPowrprof: HMODULE;
IsPwrSuspendAllowed: TIsPwrSuspendAllowed;
begin
Result := False;
hPowrprof := LoadLibrary('powrprof.dll');
if hPowrprof <> 0 then
begin
try
@IsPwrSuspendAllowed := GetProcAddress(hPowrprof, 'IsPwrSuspendAllowed');
if @IsPwrSuspendAllowed <> nil then
begin
Result := IsPwrSuspendAllowed;
end;
finally
FreeLibrary(hPowrprof);
end;
end;
end;
Взято с сайта http://www.swissdelphicenter.ch/en/tipsindex.php
Отправить комментарий