|
Continuous asked several times, and have never had a viable answer.
I would like to draw from the menu program. Before self-painted, you must first get a handle on the current window menus.
According to the handle and then, self-drawing property. And reload the OnDrawItem () and OnMeasureItem () two functions, specifically provided from painted.
But I get the menu using the following two handles, always wrong. (May CMainFrame class)
However, in view OnInitUpdate () function used in error:
CMenu * pMenu = GetMenu (); // pointer can be obtained
HMENU hMenu = pMenu-> GetSafeHmenu (); // get a handle when mistakes? ? ?
My intention is when opening a new document, you get the current menu and then overloads the above two functions, using the obtained handles settings from the painting property, but does not work.
problem:
(1) Why get a pointer to the menu, but the menu was not handle.
(2) When you open a document (click New). No matter what time of the currently loaded document. You can get the current menu, and set the self-painted property. How to achieve? ? ? Thank you |
|