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