procedure TForm1.Button1Click(Sender: TObject);
var
hwnd:cardinal;
pid:Dword;
hProcess:cardinal;
x:string;
Num: cardinal;
begin
setlength(X,$10);
hwnd := FindWindow(nil, ‘Cheat Engine 5.3‘);
GetWindowThreadProcessId (hwnd, @pid);
hProcess := OpenProcess(PROCESS_ALL_ACCESS, false, pid);
If hProcess <> 0 Then
begin
if ReadProcessMemory(hprocess,Pointer($1005334),@x,$10,num) then
label1.Caption := string(x)
else
showmessage(‘讀數(shù)失敗~!‘);
end
else
showmessage(‘未啟動游戲‘);
CloseHandle(hProcess);
end;