Mega Code Archive

 
Categories / Delphi / Examples
 

How to jump to a specific edit component in a foreign application

Title: How to jump to a specific edit component in a foreign application function jmpwnd(hand: hwnd; anz: Integer): hwnd; var i: Integer; begin for i := 1 to anz do hand := getwindow(hand, gw_hwndnext); jmpwnd := hand; end; Usage Example: Sample use //Find the handle of the first edit field history := FindWindowEx(hMDIChildAccHis, 0,'_T_Edit', nil); //...jump to the second one (having the same name) history := jmpwnd(history, 2); // write something in this field SendMessage(history, WM_SETTEXT, 0,Integer(PChar('ComboBox3.Text)));