你把一个窗口设置为TOPMOST不行么?

解决方案 »

  1.   

    设置为TOPMOST当然不行,那样该窗口就是顶级窗口啦!
    关键是如何:change the owner window’s position in the Z-order.
      

  2.   

    你可以先设置好下面的窗口A,然后窗口A的句柄传递给另一个窗口的SetWindowPos()函数第一个参数,这样不可以吗?
      

  3.   

    只想改变窗口的zOrder状态可以调用函数时
    uFlags 设置为 SWP_NOSIZE|SWP_NOMOVE,第一个参数事要放置在后面的窗口句柄,第二个
    参数为放置在前面的窗口句柄。x y cx cy可以随便填。
    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 options
    );
    可以加定时器来反复执行,活处理下面一个窗口的事件,使得一旦下面的窗口到上面则执行该函数。