I have used RRUZ's solution to improve the look of disabled images. The excerpt below, as example, however:
procedure HookProc(Proc, Dest: Pointer; var BackupCode: TXRedirCode);
var
n: DWORD;
Code: TXRedirCode;
begin
Proc := GetActualAddr(Proc);
Assert(Proc <> nil);
if ReadProcessMemory(GetCurrentProcess, Proc, @BackupCode, SizeOf(BackupCode), n) then
begin
Code.Jump := $E9;
Code.Offset := PAnsiChar(Dest) - PAnsiChar(Proc) - SizeOf(Code);
WriteProcessMemory(GetCurrentProcess, Proc, @Code, SizeOf(Code), n);
end;
end;
worked well with Delphi 2007, but when I use it in Delphi XE10 I get
E2033 Types of actual and formal var parameters must be identical
when calling ReadProcessMemory and WriteProcessMemory
As far as I an see the types are the same. Can anyone advise me what' need to change?