Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Catching WM_DRAWITEM

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

809 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