我看了你这段代码:
function EnumWinproc(h: HWND; lParam: LPARAM): boolean; stdcall;
var
huoqubiaoti: pchar;
begin
windows.GetClassName(h, huoquleiming, 256);
if (StrLComp(huoquleiming, youxileiming, 13) = 0) then
begin
huoqubiaoti := Allocmem(200);
GetWindowText(h, huoqubiaoti, 200);
if (huoqubiaoti <> '此游戏已经注入外挂') then
begin
WndThreadHook(h); //这个时候就调用了keyproc,但是hz还未赋值
SetWindowText(h, '此游戏已经注入外挂');
hhh := h;
hz := inttostr(hhh);
end
end;