api里面什么函数可以让窗口OnTop?

解决方案 »

  1.   

    若要想窗口始终在前,在初始化时加上:m_pMainWnd->SetWindowPos(&CWnd::wndTopMost,0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
      

  2.   

    BringWindowToTop
    The BringWindowToTop function brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated. BOOL BringWindowToTop(
      HWND hWnd   // handle to window
    );
     
      

  3.   

    BringWindowToTop(HWND hWnd);
    SetWindowPos((&CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);嗯,总结完毕。