编程怎么实现win窗口置顶且不覆盖其他窗口?说明原理即可。

来源:百度知道 编辑:UC知道 时间:2024/05/15 10:55:32
编程怎么实现win窗口置顶且不覆盖其他窗口?说明原理即可。

SetWindowPos
其中设置HWND_TOPMOST

以下来MSDN
------------------------------------------------------
SetWindowPos
The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.

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
);

Parameters
hWnd
Handle to the window.
hWndInsertAfter
Handle to the window to precede the positioned window in the Z order. This parameter must be a window handle or one of the following values: Value Meaning
HWND_BOTTOM Places the window at the bo