首先设置新建窗口的 z-order 为 HWND_TOPMOST(也就是所有非顶层窗口的最上面) ::SetWindowPos(newWindowHwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); 1 然后再设置主窗口的 z-order 为 HWND_TOP(也就是最顶层窗口) ::SetWindowPos(mainHWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE |...
首先我们看看官方的定义:
这些是始终保持”高于”非最顶层窗口的顶级窗口。要使窗口最顶层,请调用 DeferWindowPos(或其等价函数),HWND_TOPMOST 作为 hWndInsertAfter 参数的值。若要使窗口不在最顶层,请使用 HWND_NOTOPMOST。 由于引入了”最顶层”窗口,HWND_TOP 现在使窗口” 在 Z 顺序中尽可能高,同时不会违反最顶层窗口始终出现在非最顶...
Windows 3.0 added the concept of “topmost” windows. These are top-level windows that always remain “above” non-topmost windows. To make a window topmost, callDeferWindowPos(or one of its moral equivalents) withHWND_TOPMOSTas thehWndInsertAfter. To make a window non-topmost, useHWND_NOTOPMO...