I Just simply return false when Initial Dialog ,But it Still Show On Screen How To Run this Application(base on Dialog) and Don't show this Dialog.

解决方案 »

  1.   

    hide dialog at startup
    void CHidedlgDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) 
    {
    if (lpwndpos->flags & SWP_SHOWWINDOW) {
    lpwndpos->flags &= ~SWP_SHOWWINDOW;
    PostMessage(WM_WINDOWPOSCHANGING, 0, (LPARAM)lpwndpos);
    ShowWindow(SW_HIDE);
    }
    else
    CDialog::OnWindowPosChanging(lpwndpos);
    }
      

  2.   

    you can also override DoModel、RunModelLoop functions
      

  3.   

    in OnInitDialog()
    this->SetWindowPos(NULL,0,0,0,0,SWP_SHOWWINDOW);
      

  4.   

    BTW: It does not mean that the dialog will be invisible when OnInitDialog returns false.
      

  5.   

    this->EndDialog( IDOK ) ;
    or
    this->EndDialog( IDCANCEL ) ;