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;