我在HOOK(WH_CALLWNDPROCRET)中可以:(其他的没试)
procedure HookProc(hWnd:integer;uMessage:integer;wParam:WPARAM;lParam:LPARAM);stdcall;
var
ds
drawitemstruct;
begin
if (uMessage=wm_paint) or (uMessage=wm_drawitem) or (uMessage=wm_ncpaint) then
begin
psl^.PaintHandle :=hWnd;
if (uMessage=wm_drawitem) then
begin
psl^.PaintHandle :=hWnd;
ds:=pdrawitemstruct(lparam);
SendMessage(psl^.MainHandle ,wm_GetPaint,wParam,lParam);
// SaveInfo('paint'+timetostr(now)+#13#10);
end;
end;
end;
function GetMessageCall(ncode:integer;wparam:longint;lparam:longint):lresult;stdcall;export;
var
pcs
cwpretstruct;
// pcs
MSG;
hd,uMsg,wP,lP:integer;
begin
pcs:=pcwpretstruct(lParam);
if (nCode>=0) and (pcs<>nil) and (pcs^.hwnd<>0) then
begin
hd:=pcs^.hwnd;
uMsg:=pcs^.message;
wp:=pcs^.wParam;
lp:=pcs^.lParam;
HookProc(hd,uMsg,wp,lp);
end;
Result:=CallNextHookEx(psl^.HHGetMsgProc,nCode,wParam,lParam);
end;