vc中如何隐藏标题栏、显示标题栏?

void CDlg::ShowCaption()                //显示标题
{
    LONG style 
= GetWindowLong(m_hWnd,GWL_STYLE);
    style     
|= WS_CAPTION;
    SetWindowLong(m_hWnd,GWL_STYLE,style);
    RECT     r;   
    GetWindowRect(
&r);   
    r.bottom
++;   
    MoveWindow(
&r);
}

void CDlg::HideCaption()                //隐藏标题
{
    
long style = GetWindowLong(m_hWnd,GWL_STYLE);   
    style     
&= ~(WS_CAPTION);   
    SetWindowLong(m_hWnd,GWL_STYLE,style);
    RECT     r;   
    GetWindowRect(
&r);   
    r.bottom
++;   
    MoveWindow(
&r);
}
posted @ 2007-02-08 17:50  虚幻  阅读(2869)  评论(0编辑  收藏  举报