[求助]dll注入,处理多线程
Function keyproc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): DWORD; stdcall; //键盘HOOK回调函数
var
game:hwnd;
cn : Array[0..255] of char;
begin
game:=0;
if nCode = HC_ACTION then
begin
if (wParam = VK_F9) and ((1 shl 31) and lParam = 0) then
begin
if form1 = nil then
game:=GetForegroundWindow();
getclassname(game ,cn,255);
if lstrcmpi(cn,'GameCaption') = 0 then
form1 := Tform1.Create(nil);
form1.Visible:=not form1.Visible;
end;
end;
Result := CallNextHookEx(keyhhk, nCode, wParam, lParam);
end;
改为这样的话 如果当前焦点的类名不是GameCaption你按热键是呼不出 但是 你焦点为游戏类名的话再按热键就呼不出了 请问怎么处理?