|
Followed the instructions fully, except my call to UpdateMenuBar is in the LoadFrame method of the MainFrm class file. There's no OnUpdateFrameMenu method of ChildFrm for an MDI app that I can see.
I'm using VC6.0 on Win2K.
Any ideas?
|
|
|
|
|
Putting it in a CMDIFrameWnd derived class won't work, at least for me.
CMDIChildWnd does have this method. If the wizard doesn't display it, then override it manually. It's exactly how I implemented it in my copy of VC6.
Also, if you don't automatically open a child window on application start, then read my post above about MDI apps.
|
|
|
|
|
BTW thanks for replying.
Here's what I have:
void CChildFrame::OnUpdateFrameMenu (BOOL bActivate, CWnd* pActivateWnd, HMENU hMenuAlt)
{
CMDIChildWnd::OnUpdateFrameMenu (bActivate, pActivateWnd, hMenuAlt);
CMenuXP::UpdateMenuBar (GetMDIFrame());
}
and
BOOL CChildFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CMDIFrameWnd* pParentWnd, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
// Comment out this line to deactivate the XP Look & Feel
CMenuXP::SetXPLookNFeel (this,TRUE);
return CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext);
}
Not sure what else to try.
|
|
|
|
|
Take a look at the modified version below. The hMenu check isn't required, but it's in there to be safe. You want the SetXPLookNFeel() call in this method. You do not want any of this code in your Create() method as the actual window has not been created yet.
I think you may have confused Create() with OnCreate(). Your CMainFrame should have the SetXPLookNFeel() call in its OnCreate() method AFTER the Create() method has been called. Nothing is required in the OnCreate() on your ChildFrame class.
I hope this clears things up.
//Modified method
void CChildFrame::OnUpdateFrameMenu (BOOL bActivate, CWnd* pActivateWnd, HMENU hMenuAlt)
{
CMDIChildWnd::OnUpdateFrameMenu (bActivate, pActivateWnd, hMenuAlt);
CMenuXP::UpdateMenuBar(GetMDIFrame());
HMENU hMenu = GetSystemMenu(false)->GetSafeHmenu();
if ( hMenu != NULL )
{
CMenuXP::SetXPLookNFeel(this, hMenu, true);
}
}
}
|
|
|
|
|
The download says:
Download source files - 78 Kb (With project files for VC6 and Visual Studio .NET)
I see only a .Net Solution file, I can't locate any other .Net files. Does this not work with .Net?
I need menus just like this but can't find any for .Net without paying out the booty.
|
|
|
|
|
The .Net Solution file contains three VC7 projects.
The CMenuXP class is compatible with VC6 and VC7.
|
|
|
|
|
I'm not sure what that means. I never done any C++ programming. I've only used VB and VB.Net. I'm just looking for a way to be able to use the CMenuXP class in my .net project.
I think I know what you mean. I don't really think I need any project files. I'll look again at the package I downloaded a while ago. If theres a dll file I'll try to reference that in my .net project... but I don't know how to implement anything, if it's even possable.
|
|
|
|
|
For .Net the best Open Source library with XP Look And Feel is dotNetMagic, try it http://www.dotnetmagic.com/
|
|
|
|
|
i found some comercial solutions to make office2003 style-toolbars in c++. is there any free code for doing this? can this really be so difficult??
thanx for any input!
andreas
|
|
|
|
|
Hi,
How should i use these XP Style menu classes in my ATL Composite control that has MFC support.
I am unable to use it there???
Required needful help
Regards,
Susheel
Susheel Chauhan
|
|
|
|
|
The CMenuXP drawed is much wider than default!
so the menubar can not contains many submenu!
Then, when i use SetMenu in CMainFrame to switch mainmenu, there is repaint problom, because default menu length is much more narrow
Is the gap too bigger between menuitem in menubar?
|
|
|
|
|
CMenu menuMain;
menuMain.LoadMenu(m_bLogin == false ? IDR_MENU_USER: IDR_MAINFRAME);
SetMenu(&menuMain);
menuMain.Detach();
CMenuEx::UpdateMenuBar(this);// I use this want the mainmenu redraw
// but failed!!!!!
|
|
|
|
|
I am afraid to say i solve the problem !
i add DrawMenuBar(); at the end of function which switch mainmenu
|
|
|
|
|
Dear Jean Michel,
Congratulation for this menu, it's great!
I added everything as explained, and I also added everything that matches the 'XP' search from the demo to my project. Even though the demo is working perfectly, my project displays XP menus, but the headers are a little different from the expected look : The top of the menu, I mean. It should be in a blue square when the mouse is over it!!!
I have put a screenshot a the following adress, so that you can check it and tell me if you know why!
http://www.gaaia.com/ecran.jpg
Once again, congratulations, I wish I could do the same myself!
Greg
|
|
|
|
|
I think either step 4) or 6) is missed. But I am not sure.
|
|
|
|
|
The problem came from the fact that I renamed each heading of the menu using the following syntax :
It seems that this causes the problem I described.
I don't know how to change this syntax to make it working!
Greg
|
|
|
|
|
Hell there
I have the same problem, if you figure it out, please let me know.
Thanks in advance
Alex
aevans@microknox.com.au
|
|
|
|
|
You should probably not render the shadow when running under Windows XP with menu shadows turned on. It has a strange double-border effect.
- Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Are you planing to release updated WTL port for XP menus?
|
|
|
|
|
upload adialog example with flat menu
the do som thing with the menu about,exit,etc..
i belive in KISS
KEEP IT SIMPLE STUPIT
|
|
|
|
|
How change the system Menu ?
|
|
|
|
|
when i work it on Win2000,and i Create one Popup menu,like this:
void CSwsWnd::OnRButtonDown(UINT nFlags, CPoint point)
{
CPoint pt = point;
ClientToScreen(&pt);
CMenu menu;
VERIFY(menu.LoadMenu(IDR_MENUHTML));
CMenu* pPopup = menu.GetSubMenu(0);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y,
AfxGetMainWnd());
}
and now i click right button,and rclick,rclick ,i find some shader not lost,
why?
(i use SDI MFC appliction)
thank you!
|
|
|
|
|
CMenuXP::SetXPLookNFeel (this);
|
|
|
|
|
I think you should return
CallWindowProc (oldWndProc, hWnd, uMsg, wParam, lParam);
at:
LRESULT CALLBACK CWndMenuXP::SubClassMenuProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCPAINT:
but no return 0, so it will not flash(drawn twice)
and if you return oldWndProc, still have problem: other menu will not drawn shadow.
so how to do?
|
|
|
|
|
Did anyone fix this problem (of the dual menu draw under Windows XP)
If I click on a menu item, it indeed draws the menu twice. Once as the immediate draw, and on ce as the drop down draw.
When I have a submenu open and move to other submenus (without clicking) it draws fine (immediate draw)
|
|
|
|