Standard (kann auch in Packages verwendet werden)
Delphi-Quellcode:
function WrappedGetLastInputInfo(var plii: TLastInputInfo): BOOL; stdcall;
type
TFNGetLastInputInfo = function(var plii: TLastInputInfo): BOOL; stdcall;
var
FNGetLastInputInfo: TFNGetLastInputInfo;
begin
FNGetLastInputInfo := TFNGetLastInputInfo(
GetProcAddress(GetModuleHandle(user32), 'GetLastInputInfo'));
if not Assigned(FNGetLastInputInfo) then
begin
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
Result := False;
end
else
Result := FNGetLastInputInfo(plii);
end;
Beschleunigt
Delphi-Quellcode:
type
TFNGetLastInputInfo = function(var plii: TLastInputInfo): BOOL; stdcall;
var
FNGetLastInputInfo: TFNGetLastInputInfo;
function WrappedGetLastInputInfo(var plii: TLastInputInfo): BOOL; stdcall;
begin
if not Assigned(FNGetLastInputInfo) then
begin
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
Result := False;
end
else
Result := FNGetLastInputInfo(plii);
end;
initialization
FNGetLastInputInfo := TFNGetLastInputInfo(
GetProcAddress(GetModuleHandle(user32), 'GetLastInputInfo'));