直接SetParent过去,比较简单<br>但如果你还要把Caption去掉之类的动作,就要进一步研究了。 :)<br><br>uses<br> ShellApI;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> HWnd: THandle;<br>begin<br> HWnd := FindWindow(nil, 'Untitled - Notepad');<br> if HWnd <> 0 then<br> begin<br> Windows.SetParent(HWnd, Panel1.Handle);<br> SetWindowPos(Hwnd, 0, 0, 0, Panel1.ClientWidth, Panel1.ClientHeight, 0);<br> end;<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> ShellExecute(Handle, 'open', 'Notepad.exe', nil, nil, 1);<br>end;<br><br>