Solved

Catching WM_DRAWITEM

Posted on 1998-07-02
3
880 Views
Last Modified: 2008-03-04
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?
0
Comment
Question by:joeslow
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
trestan earned 50 total points
ID: 1167068
You have to go to class info tab in class wizard and change the message filter comboBox and set the option as window. Then you will find what you want.
0
 

Author Comment

by:joeslow
ID: 1167069
Changing the filter to a Window does show the WM_DRAWITEM and WM_MEASUREITEM messages as choices now.  However, they still aren't being sent to the CTreeView.  Someone told me that those messages never get sent to a view but are "control" specific.
0
 
LVL 8

Expert Comment

by:trestan
ID: 1167070
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
 

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now