Set TitleBAr
-
Hi, Is it possible to change the height of titlebar of all Dialogs which are used only in my application using WM_NCCALCSIZE or DrawCaption() and if there is any better way..pls let me know....please suggest me any sample which does the same....
-
Hi, Is it possible to change the height of titlebar of all Dialogs which are used only in my application using WM_NCCALCSIZE or DrawCaption() and if there is any better way..pls let me know....please suggest me any sample which does the same....
Hi, i tried using BEGIN_MESSAGE_MAP(CMyDlg, CDialog) ON_WM_NCCALCSIZE() END_MESSAGE_MAP() void CMyDlg::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp) { CRect& rc = (CRect&)lpncsp->rgrc[0]; rc.top += 20; // Increase the height of tittle bar CWnd::OnNcCalcSize(bCalcValidRects, lpncsp); } but the increased height of the title bar is not shown properly...and even the caption and the close button were not increased...(title bar was increased but not shown properly..)
-
Hi, i tried using BEGIN_MESSAGE_MAP(CMyDlg, CDialog) ON_WM_NCCALCSIZE() END_MESSAGE_MAP() void CMyDlg::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp) { CRect& rc = (CRect&)lpncsp->rgrc[0]; rc.top += 20; // Increase the height of tittle bar CWnd::OnNcCalcSize(bCalcValidRects, lpncsp); } but the increased height of the title bar is not shown properly...and even the caption and the close button were not increased...(title bar was increased but not shown properly..)
kumar sanghvi wrote:
rc.top += 20; // Increase the height of tittle bar
This looks as though it would shrink the height. Why not use the
InflateRect()
method?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Hi, i tried using BEGIN_MESSAGE_MAP(CMyDlg, CDialog) ON_WM_NCCALCSIZE() END_MESSAGE_MAP() void CMyDlg::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp) { CRect& rc = (CRect&)lpncsp->rgrc[0]; rc.top += 20; // Increase the height of tittle bar CWnd::OnNcCalcSize(bCalcValidRects, lpncsp); } but the increased height of the title bar is not shown properly...and even the caption and the close button were not increased...(title bar was increased but not shown properly..)
kumar sanghvi wrote:
but the increased height of the title bar is not shown properly
This is because you are changing the bounding rectangle of the client area not the caption bar. The default window procedure will adjust this rectangle based on the height of the title bar, the height of the menu (if present) and any other non-client component managed by the window. You have however gotten one step close as you now have extra space reserved at the top of the window for your caption bar. The next step is to handle the WM_NCPAINT message and draw your custom caption bar with the desired height.
I am a lean mean ground beef machine!!!