将窗口设置为Topmost的方法

调用Win32 API SetWindowPos()设置:

  1: void SetTopMost(BOOL topMost)

  2: {

  3: 	HWND insertAfter = topMost?HWND_TOPMOST:HWND_NOTOPMOST;

  4: 	::SetWindowPos(GetSafeHwnd(),insertAfter,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);

  5: }

你可能感兴趣的:(top)