procedure TForm1.BitBtn1Click(Sender: TObject);
var
Handle: Integer;
tmpHandle,tmphandle1: Integer;
rchedt:trichedit;
begin
rchedt:=TrichEdit(PopupMenu1.PopupComponent);
Handle := FindWindow(nil,'对话模式');
if Handle<>0 then
begin
tmpHandle := Handle;
tmpHandle1 := Handle;
EnumChildWindows(Handle,@GetButtonHandle,Integer(@Handle));
FButtonHandle := Handle;
EnumChildWindows(tmpHandle,@GetEditHandle,Integer(@tmpHandle));
FTextHandle := tmpHandle;
//showwindow(tmpHandle1,SW_HIDE);
//setwindowlong(tmpHandle1,GWL_EXSTYLE,WS_EX_TOOLWINDOW);
end;
SendMessage(FTextHandle,WM_SETTEXT,0,Integer(pchar(rchedt.text)));
SendMessage(FButtonHandle,WM_LBUTTONDOWN,0,0);
SendMessage(FButtonHandle,WM_LBUTTONUP,0,0);
rchedt.clear;
end;