Re: Chnage color of default title bar , SDI
you might want to see my functions:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{ // Do default processing.
cs.style &=~(LONG)FWS_ADDTOTITLE;
//cs.hMenu=0;
return CFrameWnd::PreCreateWindow(cs);
}
and
BOOL CTbxmMDIFrameWnd::Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName,
DWORD dwStyle ,
const RECT& rect ,
CWnd* pParentWnd ,
LPCTSTR lpszMenuName ,
DWORD dwExStyle ,
CCreateContext* pContext){
m_strTitle = lpszWindowName; // save title for later
if (!CreateEx(dwExStyle, lpszClassName, lpszWindowName, dwStyle,
rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
pParentWnd->GetSafeHwnd(), NULL, (LPVOID)pContext))
{
TRACE(_T("Warning: failed to create CTbxmMDIFrameWnd.\n"));
return FALSE;
}
return TRUE;
}
And
BOOL CTbxmMDIFrameWnd::LoadFrame(UINT nIDResource,
DWORD
dwDefaultStyle ,
CWnd*
pParentWnd ,
CCreateContext* pContext) {
if (!CFrameWnd::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd,
pContext))
return FALSE;
ASSERT(m_hWnd != NULL);
return TRUE;
}
thanks in adv
Neel
On May 22, 3:19 pm, Neel <urn...@gmail.com> wrote:
Thanks Ajay,
I have successfully created custom frame and attached to CMainframe,
reason behind my menu bar hide is
cs.hmenu=0 in CMainFrame::PreCreateWindow()
ok now iam done with VS 6.0 it works great.
same workspace i opened in VS 7.1 (VS 2003) it asked for convertion i
said YES to all.
built with no errors and exited with no menu bar again. ???
do i need to care something to get work exactly like VS 6.0????
what cud be the reason?
On Apr 23, 6:30 pm, Ajay Kalra <ajayka...@yahoo.com> wrote:
On Apr 23, 3:22 am, Neel <urn...@gmail.com> wrote:
On Apr 11, 5:57 pm, "Tom Serface" <tom.nos...@camaswood.com> wrote:
In addition to Ajay's article link you may find this interesting as =
well:
http://www.codeproject.com/KB/dialog/gradienttitlebar.aspx
Also, I think the new Feature Pack for MFC code includes the capabil=
ity to
do some skinning and I know that the XTreme Toolkit (www.codejock.co=
m) has
this capability as well.
The BCGSoft package that the new MFC stuff is based on has this kind=
of
capability:
http://www.codeproject.com/KB/dialog/gradienttitlebar.aspx
I haven't tried that functionality yet, but here is what is in the 2=
008
Feature Pack that will give you lots of UI look and feel options:
http://msdn2.microsoft.com/en-us/library/bb982354.aspx
Tom
"Neel" <urn...@gmail.com> wrote in message
news:e9db815c-35dc-47c4-b3bb-7cf136dda2fb@m1g2000pre.googlegroups.com=
....
Hi all,
In SDI application I require to change default background color of=
title bar (which is blue).
i tried to painting in OnNcPaint() but buttons(X, [], -), caption,=
icon gets behind new color.
please help ...
thanks- Hide quoted text -
- Show quoted text -
Thanks Tom,
Now iam able to draw my own frame by derriving CMainframe from m=
y
custom calss(which overrides almost all message function).
Iam unable to handle MenuBar, it does comeup by default when i give
here
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CValasm_layoutDoc),
RUNTIME_CLASS(CMainFrame), =
// main SDI frame window
RUNTIME_CLASS(CValasm_layoutView));
AddDocTemplate(pDocTemplate);
any suggestions on this regard?
Neel
AFAIK, Menubar cant be owner drawn. You can kill the menubar and
replace it with a toolbar, appearance of which you can control.
---
Ajay- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -