编写调用外部程序的时候,发现被调用的程序虽然可以运行.但是却会被主窗体遮住.

解决方案 »

  1.   

    哦,我写的没有,调用EXE文件遮住了原来窗体啊。Shellexecute函数啊
      

  2.   

    Shellexecute(main_fm.Handle,'open',Pchar(filename),'',nil,SW_SHOWNORMAL);
      

  3.   

    转帖
    uses shellapi;
    procedure TForm1.Button2Click(Sender: TObject);
    var hSndrec32: HWND;
    begin
      hSndrec32 := WIndows.FindWindow(nil, '声音 - 录音机');
      if hSndrec32<>0 then
      begin
      Windows.SetParent(hSndrec32, Panel1.Handle);
      Windows.MoveWindow(hSndrec32, 0, 0,panel1.Width,panel1.Height,true);
      end
      else
      showmessage('未发现该程序!');
    end;在提问以前,最好先搜一下有没有类似的问题别人提过