我是菜鸟级别的
我做了一个对话框
想让他在所有窗口的最上层显示,
而且要不改变大小,确定在左上角显示
这个用什么函数可以实现啊

解决方案 »

  1.   

    BOOL SetWindowPos(
      HWND hWnd,             // handle to window you want to adjust
      HWND hWndInsertAfter,  // placement-order handle
      int X,                 // horizontal position
      int Y,                 // vertical position
      int cx,                // width
      int cy,                // height
      UINT uFlags            // window-positioning options
    );
    hWndInsertAfter=HWND_TOPMOST;
    uFlags=SWP_NOSIZE|SWP_SHOWWINDOW;
    x=0;
    y=0;
      

  2.   

    1.对话框不改变大小
             CMenu* pTopMenu = GetSystemMenu(FALSE);
    pTopMenu -> RemoveMenu(4,MF_BYPOSITION); //Maximize
    pTopMenu -> RemoveMenu(2,MF_BYPOSITION); //Size
    pTopMenu -> RemoveMenu(1,MF_BYPOSITION); //Move
    2.总是在最上
    SetWindowPos(&CWnd::wndTopMost  , 
    0, 0, 0, 0,
    SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
      

  3.   

    这个函数要加在什么地方
    是BOOL CDemoDlg::OnInitDialog()
    下面玛?