项目中需要将第三方程序的窗口嵌入到自己的Winform窗口的Panel中,就像自己窗口的一部分一样

解决方案 »

  1.   

    你可以用一个PictureBox把它盖住
      

  2.   

    可能你要使用WindowAPI来解决这个问题,参考SetWindowLong方法.
      

  3.   

    可能你要使用WindowAPI来解决这个问题,参考SetWindowLong方法.[DllImport("user32.dll", EntryPoint="SetWindowLong", CharSet=CharSet.Auto)]
    public static extern IntPtr SetWindowLongPtr32(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
     
      

  4.   

    可能你要使用WindowAPI来解决这个问题,参考SetWindowLong方法.[DllImport("user32.dll", EntryPoint="SetWindowLong", CharSet=CharSet.Auto)]
    public static extern IntPtr SetWindowLongPtr32(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
     
      

  5.   

    谢谢了先。该问题已用如下方法解决
    long style = GetWindowLong(hWnd3Part, -16);
    style &= ~0x00C00000;
    SetWindowLong(hWnd3Part, -16, style);
    但还有另外三个问题
    1.如何模拟点击第三方程序的菜单项以执行其相应功能?用以下语句只能显示出菜单项列表    
    SendMessage(Handle, WM_SYSCOMMAND, TrackPopupMenu(
            GetMenu(Handle,nPosition),
            TPM_RETURNCMD | TPM_LEFTBUTTON, vPoint.X, vPoint.Y, 
            0, Handle, out vRect), 0);2.如何去掉第三方程序ToolBar中的一部分按钮?
    3.如何去掉第三方程序的状态栏?先把这个帖子结了