如上!我想使我的程序运行的时候能够在所有程序的最上面,就跟realplayer播放的时候的那种效果!

解决方案 »

  1.   

    在窗口初始化时调用SetWindowPos( const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags ),把pWndInsertAfter设为wndTopMost,具体可以去看msdn
      

  2.   

    CRect rc;
    GetWindowRect(&rc);
    AfxGetMainWnd()->SetWindowPos(&wndTopMost, rc.left, rc.top, rc.Width(), rc.Height(), SWP_SHOWWINDOW);
      

  3.   

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    if( !CFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs         cs.dwExStyle=WS_EX_TOPMOST; return TRUE;
    }
      

  4.   

    如果是Dialog一句就可以了
    this->SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|NO_SIZE);