Поддерживает ли система suspend? |
Previous Top Next |
Code: |
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; |
©Drkb::01705
Взято с сайта http://www.swissdelphicenter.ch/en/tipsindex.php