1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| function nom (win:hwnd):string ;
var l: byte;
s:string ;
begin
l:=sendmessage(win,wm_getText,255,longint(@s[1]));
s[0]:=chr(l);
nom:=s;
end;
(*Module principal*)
wnd:=gettopwindow(0);
while not (wnd=0) do
begin
if (nom(wnd)='Microsoft Office Outlook') and (IsWindowEnabled(getdlgitem(Wnd,$12A6))) then
begin
Sendmessage(getdlgitem(Wnd,$12A6),Bm_click,1,0);
GetWindowRect(getdlgitem(wnd,$12A6),r);
setactivewindow(getdlgitem(wnd,$12A6));
SetCursorPos(r.left,r.top);
Mouse_Event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Mouse_Event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
enddialog(dlg,0);
end;
wnd:=getnextwindow(wnd,gw_Hwndnext);
end; |
Partager