创建的时候去掉:WS_EX_TOPMOSTWS_EX_TOPMOST : Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.
也可以重载CWnd,处理WM_SHOWWINDOW,在OnShowWindow(BOOL bShow,UINT nStatus);中激活窗口A
HWND hWnd = ::CreateWindowEx(WS_EX_TOPMOST,"11","11",WS_POPUP|WS_BORDER|WS_VISIBLE,rect.left,rect.top,rect.Width(),rect.Height(),m_hWnd,NULL,wndcls.hInstance,NULL);
::ShowWindow(hWnd,SW_SHOWNA);
::ShowWindow(hWnd,SW_SHOWNA);
::SetActiveWindow(m_hWnd);
Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.