|
-
July 30th, 2005, 05:09 PM
#1
Repaint Items in OwnerDraw Menu
Hello people,
ok i have a big problem. I wil redraw my OwnerDraw Menu every second. So i wrote a Timerproc and start it with SetTimer:
Here are my TimerProc:
void CALLBACK TimerProc(HWND hWnd,UINT nMsg,UINT nIDEvent,DWORD dwTime)
{
count++;
DrawMenuBar(AfxGetMainWnd()->GetSafeHwnd());
}
But it doesn't redraw the MenuItems. The header will redraw but not the Items. Why????
Sorry for my bad english
-
August 1st, 2005, 06:48 AM
#2
Re: Repaint Items in OwnerDraw Menu
The menu bar is a different window to the actual menu being displayed.
If you need a menu to re-drawn then you will have to hook the creation of the menu window (look for WM_CREATE and and window class of #32768). This will give you the HWND of the menu, which you should be able to call Invalidate() on.
There is no known method to go from HMENU to HWND (or visa-versa - I know - I spent a week researching it), so hooking the window creation is the only method I know whcih would work for you.
Some issues may be that there are several class names used for window used by menus. #32768 is the most common, but there are others
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
Please remember to rate useful answers. It lets us know when a question has been answered.
-
August 1st, 2005, 11:34 PM
#3
Re: Repaint Items in OwnerDraw Menu
Hi XYZ44
I am looking for sample of OwnerDraw Menu.
Will you help me by sending Sample application demostrating Drawing menu and its subitem , Either in Win32 Sdk or Mfc.
Thanks in Advance
Anant
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|