chodzi ci o ten faq:
http://4programmers.net/view_faq.php?id=180
zamieniłem ten kod, co mi go dałeś. Odczytuje i zamienia nazwy ale elementów programu (dolny pasek, tytuł, adres). Lecz nie zmienia i nie odczytuje elementów typu pole tekstowe z html.
function SetText(WindowHandle: hwnd):string;
var
txtLength : integer;
buffer: string;
text : string;
begin
TxtLength := SendMessage(WindowFromPoint(Mouse.CursorPos), WM_GETTEXTLENGTH, 0, 0);
txtlength := txtlength + 1;
setlength(buffer, txtlength);
text := 'heroman';
sendmessage (WindowHandle,wm_gettext, txtlength, longint(@buffer[1]));
SendMessage(WindowFromPoint(Mouse.CursorPos),WM_SetText,0,LongInt(text));
result := buffer;
end;
function setURL:string;
var
ie,toolbar,combo,
comboboxex,edit,
worker,toolbarwindow:hwnd;
begin
ie := FindWindow(pchar('IEFrame'),nil);
worker := FindWindowEx(ie,0,'WorkerA',nil);
toolbar := FindWindowEx(worker,0,'rebarwindow32',nil);
comboboxex := FindWindowEx(toolbar, 0, 'comboboxex32', nil);
combo := FindWindowEx(comboboxex,0,'ComboBox',nil);
edit := FindWindowEx(combo,0,'Edit',nil);
toolbarwindow := FindWindowEx(comboboxex, 0, 'toolbarwindow32', nil);
result := setText(WindowFromPoint(Mouse.CursorPos));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(setURL);
end;