Einzelnen Beitrag anzeigen

Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: EnumProc - EditFeld in externer Software suchen

  Alt 13. Aug 2018, 10:12
Ich mache es so:
Copy/Paste das wichtigste aus einem Tool von mir
Delphi-Quellcode:
man braucht ein paar variablen
wh = HWND = ist das haupthandle vom target prozess
targetclass und targetcaption = string = gefüllt mit sinnvollem text
TARGETEDCONTROL = (D)WORD = ist das window control handle vom target

  WH := 0; // inititalize this value to 0
  if Length(TARGETCLASS) > 0 then WH := FindWindow( TARGETCLASS, NIL ); // feature, search for targets window by CLASSNAME
  if ((WH = 0) and (Length(TARGETCAPTION) > 0)) then WH := FindWindow( NIL, TARGETCAPTION ); // feature, search for targets window by CAPTION (unsafe)
  if WH <> 0 then // if we find it, lets copy data into that form
  begin
    SendMessage(GetDlgItem(WH, TARGETEDCONTROL), WM_SETTEXT, 0, Integer(PChar('Foobar'))); // send text to target windows edit box
  end;
  FindClose(WH);
Gruß vom KodeZwerg

Geändert von KodeZwerg (13. Aug 2018 um 10:21 Uhr)
  Mit Zitat antworten Zitat