这样不可以呀 , 那个写回复信息的窗体 Handle 找不到<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> h,hParent, hButton, hMemo: HWND;<br> ClassName : String ;<br> hRichEdit : HWND ;<br>begin<br> Memo1.SelectAll;<br> Memo1.CopyToClipboard;<br> try<br> ClassName:='TRICHEDIT';<br> hRichedit :=FindWindowEx(hParent,0,PChar(ClassName),'');<br> hParent := FindWindow(nil, '发送消息');<br> // hMemo := ChildWindowFromPointEx(hParent, Point(50,100), CWP_ALL);<br> hButton := FindWindowEx(hParent, 0, nil, '送讯息(&S)');<br> if (hParent = 0) or (hMemo = 0) or (hButton = 0) then<br> MessageBox(Handle, ' NoForm ', ' 提示', MB_ICONWARNING)<br> else<br> begin<br> SendMessage(hRichedit, WM_PASTE, 0, 0);<br> SendMessage(hButton, BM_CLICK, 0, 0);<br> end;<br> except<br> MessageBox(Handle, 'Wrong ', ' wrong', MB_ICONWARNING);<br> end;<br>end;