//随手写了几行代码,你看能用上不<br>1取最近一次鼠标选中edit中的内容<br>var<br> sText : string;<br> bSelect : Boolean;<br><br>procedure TForm1.Edit1MouseDown(Sender: TObject; Button: TMouseButton;<br> Shift: TShiftState; X, Y: Integer);<br>begin<br> bSelect := True;<br>end;<br><br>procedure TForm1.Edit1MouseUp(Sender: TObject; Button: TMouseButton;<br> Shift: TShiftState; X, Y: Integer);<br>begin<br> if bSelect then<br> begin<br> //ShowMessage(Edit1.SelText);<br> sText := Edit1.SelText;<br> bSelect := False;<br> end;<br>end;<br><br>2取另一个窗体form1中的edit1中的内容<br>procedure TForm1.btn1Click(Sender: TObject);<br>var<br> h, h2 : HWND;<br> s1 : string;<br> m : PChar;<br>begin<br> GetMem(m, 255);<br> h := FindWindow('TForm1', 'Form1');<br> if h <> 0 then<br> begin<br> h2 := FindWindowEx(h, 0, 'TEdit', 'Edit1');<br> GetWindowText(h2, m, 255);<br> s1 := m;<br> ShowMessage(s1);<br> end;<br> FreeMem(m);<br>end;