Hej
Potrzebuje sprawdzac na bieŻąco zmiane ukladu okien na pulpicie i w zwiazku z tym potrzebuje zrobic hook'a na komunikat np Wm_MOVE czy WM_SIZE
Wedlug mojej teorii nie wszystkie hook'i sie tego nadaja bo czesc wylapuje tylko np komunikaty mysz, klawiatury itp.
Zgodnie tym wyczytalem ze chyba najlepszym typem hook'a jest w tym wypadku WH_CALLWNDPROCRET
Kto wie cos na ten temat jak to zrobic lub co jest nie tak w kodzie ponizej prosze o znak.
var H:THandle;
function hook1(c0de, wParam, lParam : integer): Lresult; stdcall;
var
hw : hwnd;
pCWPR: PCWPRetStruct;
begin
if c0de>0 then
begin
pCWPR := PCWPRetStruct(lParam);
if (pCWPR.message = WM_MOVE) then
begin
form1.r.Lines.Add('ok'); //cos tam napisz
end;
CallNextHookEx(H, c0de, wParam, lParam);
end else
begin
result := CallNextHookEx(H, c0de, wParam, lParam);
exit;
end;
result := CallNextHookEx(H, c0de, wParam, lParam);
End;
procedure sethook;
begin
H:=SetWindowsHookEx({WH_CBT}WH_CALLWNDPROCRET, @hook1, hInstance, 0);
if H = 0 then messagebox(0,'error','error',mb_iconhand);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
sethook;
end;