函数原型:
BOOL SetWindowPos(
HWND hWnd, // handle of 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
);
TOPMOST:
SetWindowPos(Form2->Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
//SWP_NOMOVE|SWP_NOSIZE表示不重设大小和位置,也就是忽略X,Y,cx,cy四个参数
取消TOPMOST:
SetWindowPos(Form2->Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);