procedure TMyForm1.ToolButton2Click(Sender: TObject);//捕捉计算器 var HWndwin: HWnd; begin inherited; winexec('calc.exe',SW_SHOWDEFAULT); HWndwin:=findwindow(nil,'计算器'); if HWndwin=null then application.MessageBox('没找到!','提示',0) else begin if windows.SetParent(HWndwin,self.Panel2.Handle)=null then application.MessageBox('失败了','提示',0); end; end;
The detail please browse http://expert.csdn.net/Expert/TopicView1.asp?id=1326665
提供几个函数:
var
temp:tresourcestream;
begin
temp:=tresourcestream.create(...);//忘了,查帮助吧。
resource文件的建立。建议安装rxlib,
给我一个谢谢!!!!!!!
var
HWndwin: HWnd;
begin
inherited;
winexec('calc.exe',SW_SHOWDEFAULT);
HWndwin:=findwindow(nil,'计算器');
if HWndwin=null then
application.MessageBox('没找到!','提示',0)
else
begin
if windows.SetParent(HWndwin,self.Panel2.Handle)=null then
application.MessageBox('失败了','提示',0);
end;
end;