Einzelnen Beitrag anzeigen

Razor
(Gast)

n/a Beiträge
 
#3

Re: Change text of other App Edit Control

  Alt 4. Okt 2009, 12:12
Well clearly its not working toms...I want to specify what i want to search from delphi app to the find file dialog directory is not enough.Thats why this way..

Delphi-Quellcode:
uses ddeman;

procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

  var
  wndMain, wndChild: HWND;
    msg : String;

begin
  wndMain := FindWindow('CabinetWClass','Search Results');
  if wndMain <> 0 then
  begin
    wndChild := FindWindowEx(wndMain, 0, 'WorkerW', nil);
    wndChild := FindWindowEx(wndChild, 0, 'ReBarWindow32', nil);
    wndChild := FindWindowEx(wndChild, 0, 'UniversalSearchBand', nil);
    wndChild := FindWindowEx(wndChild, 0, 'Search Box', nil);
    wndChild := FindWindowEx(wndChild, 0, 'SearchEditBoxWrapperClass', nil);

msg := 'search for this';



    if wndChild <> 0 then
    begin
      ShowMessage('Window Handle: ' + IntToStr(wndChild));
       SendMessage(wndchild, WM_SETTEXT, 0, LongInt(PChar(msg)));

  end;

  end;
end;



procedure TForm1.FormCreate(Sender: TObject);
begin
  with TDDEClientConv.Create(Self) do begin
   ConnectMode := ddeManual;
   ServiceApplication := 'explorer.exe';
   SetLink( 'Folders', 'AppProperties') ;
   OpenLink;
   ExecuteMacro
       ('[FindFolder(, C:\DelphiTips)]', False) ;
   CloseLink;
   Free;
  end;


end;