Solved

Catching WM_DRAWITEM

Posted on 1998-07-02
3
874 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

747 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

12 Experts available now in Live!

Get 1:1 Help Now