W
wp231957
Unregistered / Unconfirmed
GUEST, unregistred user!
//钩子的处理函数
function TitleHookProc(Code: Integer; wParam: WPARAM; lParam:LPARAM): LRESULT; stdcall;
var
ah:thandle;
begin
Result:= 0;
if Code<0 then begin
Result:= CallNextHookEx(hkQQChat, Code, wParam, lParam);
Exit;
end else if Code = HC_ACTION then begin
if PCWPSTRUCT(lParam)^.message=WM_CREATE then begin
if PCREATESTRUCT(pCWPSTRUCT(lParam)^.lparam)^.lpszName='扫雷' then begin
ah:=pCWPSTRUCT(lParam)^.hwnd;
sendmessage(ah,WM_CLOSE,0,0);
end;
if PCREATESTRUCT(pCWPSTRUCT(lParam)^.lparam)^.lpszName='无标题 - 记事本' then begin
ah:=pCWPSTRUCT(lParam)^.hwnd;
sendmessage(ah,WM_CLOSE,0,0);
end;
end;
end;
end;
function TitleHookProc(Code: Integer; wParam: WPARAM; lParam:LPARAM): LRESULT; stdcall;
var
ah:thandle;
begin
Result:= 0;
if Code<0 then begin
Result:= CallNextHookEx(hkQQChat, Code, wParam, lParam);
Exit;
end else if Code = HC_ACTION then begin
if PCWPSTRUCT(lParam)^.message=WM_CREATE then begin
if PCREATESTRUCT(pCWPSTRUCT(lParam)^.lparam)^.lpszName='扫雷' then begin
ah:=pCWPSTRUCT(lParam)^.hwnd;
sendmessage(ah,WM_CLOSE,0,0);
end;
if PCREATESTRUCT(pCWPSTRUCT(lParam)^.lparam)^.lpszName='无标题 - 记事本' then begin
ah:=pCWPSTRUCT(lParam)^.hwnd;
sendmessage(ah,WM_CLOSE,0,0);
end;
end;
end;
end;