如把d:\abc.exe(现有)加载到form1.panel1上面

解决方案 »

  1.   

    http://expert.csdn.net/Expert/TopicView1.asp?id=1760499
    看看这个吧
      

  2.   

    我觉得不是所有的程序都可以这么做,这个程序必须是一个COM组件,对于EXE来讲是一个进程外服务器,并且提供了这个接口出来,你才可以这么做吧。不知道对不对
      

  3.   

    To linzhisong(無聊) :好像没多大用处
      

  4.   

    procedure TForm1.Button2Click(Sender: TObject);
    var h:hwnd;
    begin
    h:=findwindow(nil,pchar('d:\abc.exe');
    if h<>0 then
    begin
     windows.SetParent(h,form1.Panel1.Handle);
    end;
    end;
    给分吧!!!!!
      

  5.   

    to:l0f(凌风) 
    谢谢。分肯定是你的了。只是还有一个问题。如何将标题栏隐掉我的代码:
     WinExec('D:abc.exe',0);
     HWnd := FindWindow(nil, 'abc');
      if HWnd <> 0 then
      begin
        Windows.SetParent(HWnd, Panel1.Handle);
        SetWindowPos(Hwnd, 0, 0, 0, Panel1.ClientWidth, Panel1.ClientHeight, 0);
      end;
      

  6.   

    var h:hwnd;
    begin
    h:=findwindow(nil,'form1');
    showmessage(inttostr(h));
    SetWindowLong(h,GWL_STYLE,GetWindowLong(h,GWL_STYLE)//关键就是这个函数!
                     and not WS_CAPTION);
    end;
      

  7.   

    只是观念问题
    把自己的EXE放到自己的界面上,就是程序的高级编写
    把别人的程序加载到自己的界面上就是剽窃上面的代码无法执行啊。
    HWnd能够直接被赋值??????????