Dynamically Show and Hide Title bar
-
Hi All, I' m writing a Visual C++ MFC dialog-based program. I tried to show and hide the title bar of a modal dialog dynamically but didn't succeed? Could anyone kindly helps me? Thanks! Cheers, Jack
Try using this member function of the dialog
//this will hide the title ModifyStyle(WS_CAPTION,0); //then call SetWindowPos() with cx and cy of your own ::SetWindowPos(m_hWnd,HWND_TOP,0,0,cx,cy,SWP_SHOWWINDOW);
to get it back://this will show the title ModifyStyle(0,WS_CAPTION); ::SetWindowPos(m_hWnd,HWND_TOP,0,0,cx,cy,SWP_SHOWWINDOW);
good luck my friend k_dehairy -
Try using this member function of the dialog
//this will hide the title ModifyStyle(WS_CAPTION,0); //then call SetWindowPos() with cx and cy of your own ::SetWindowPos(m_hWnd,HWND_TOP,0,0,cx,cy,SWP_SHOWWINDOW);
to get it back://this will show the title ModifyStyle(0,WS_CAPTION); ::SetWindowPos(m_hWnd,HWND_TOP,0,0,cx,cy,SWP_SHOWWINDOW);
good luck my friend k_dehairy -
Thanks for your help, k_dehariy! Meanwhile, how can I set the caption of the title bar dynamically?
SetWindowText