我想实现几个界面分层次显示,要主界面显示在最上层,CREAT()出来的子窗口在主窗口下一层显示,请高手指点一下!!

解决方案 »

  1.   

    如果你非要这么做的话也可以!请看下面的函数:
    BOOL SetWindowPos(
      HWND hWnd,             // handle to window
      HWND hWndInsertAfter,  // placement-order handle
      int X,                 // horizontal position
      int Y,                 // vertical position
      int cx,                // width
      int cy,                // height
      UINT uFlags            // window-positioning flags
    );
    把其中的hWndInsertAfter指定为你所谓的"主窗口"句柄就可以了.它还可以是以下值:
    HWND_BOTTOM 
    HWND_NOTOPMOST 
    HWND_TOP 
    HWND_TOPMOST 
      

  2.   

    我这样做是因为界面的需要,你说的方法我试过了,不行啊,这个函数是应该在主窗口初始化的时候调用还是CREAT子窗口的时候调用呢?