joeslow
asked on
Catching WM_DRAWITEM
I have a SDI app whose view is a CTreeView. I want to have owner drawn popup menus. In order to do this I want to catch the WM_DRAWITEM and WM_MEASUREITEM messages. These are not offered in class wizard for the view so I put them in by hand. But as far as I can tell, neither of these messages are sent to the view. Any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The follows is imformation from the online manual. I am afraid that these messages can not sent to a CTreeView.
The WM_MEASUREITEM message is sent to the owner window of an owner-drawn button, combo box, list box, list view control, or menu item when the control or menu is created.
WM_MEASUREITEM
idCtl = (UINT) wParam; // control identifier
lpmis = (LPMEASUREITEMSTRUCT) lParam; // item-size information
************************** ********** ********** ********** *********
The WM_DRAWITEM message is sent to the owner window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
WM_DRAWITEM
idCtl = (UINT) wParam; // control identifier
lpdis = (LPDRAWITEMSTRUCT) lParam; // item-drawing information
The WM_MEASUREITEM message is sent to the owner window of an owner-drawn button, combo box, list box, list view control, or menu item when the control or menu is created.
WM_MEASUREITEM
idCtl = (UINT) wParam; // control identifier
lpmis = (LPMEASUREITEMSTRUCT) lParam; // item-size information
**************************
The WM_DRAWITEM message is sent to the owner window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
WM_DRAWITEM
idCtl = (UINT) wParam; // control identifier
lpdis = (LPDRAWITEMSTRUCT) lParam; // item-drawing information
ASKER