如果知道一个窗体的句柄,能不能把一个Form或或vc的窗体资源嵌在里面?(100分)

  • 主题发起人 主题发起人 Siney
  • 开始时间 开始时间
var
h:HWND;

//把计算器作为自己程序的子窗口(事先要打开附件中的计算器程序)
procedure TForm1.Button10Click(Sender: TObject);
begin
WinExec('calc.exe',SW_SHOW);
h := FindWindow('SciCalc',nil);
Windows.SetParent(h,Panel1.Handle); //将计算器放入panel中
//SetWindowLong (h, GWL_STYLE, GetWindowLong (h, GWL_STYLE) AND NOT WS_CAPTION);
SetWindowPos(h,HWND_BOTTOM,-2,-22,600,200,0); //设定位置
//EnableWindow(h,false);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
PostMessage(h, WM_CLOSE, 0, 0);
end;
 
接受答案了.
 
后退
顶部