Solved

WM_MEASUREITEM and Owner Draw Menu

Posted on 2003-11-17
3
686 Views
Last Modified: 2013-11-20
I am creating a control that pops up a menu when the user clicks on it. One of the properties for the control is MenuFont which sets the font for the menu items. When calling TrackPopupMenu for the first time, WM_MEASUREITEM is sent and the width and height of the menu items are calculated correctly according to the font. If the user selects a different font and call TrackPopupMenu again, then WM_MEASUREITEM is not sent again and the width and height of the menu items are incorrect. How can I force OnMeasureItem to be called everytime the menu pops up. Thanks.
0
Comment
Question by:nabehs
3 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 125 total points
ID: 9762545
Do you create popup menu only once and call TrackPopupMenu for each right-click? Try to create the menu on every right-click. In any case, show your code.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9762642
Find the article "PRB: MeasureItem Not Called for Popup Item on Owner-Draw Menu" in MSDN

Good Luck
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Define unique primary key 9 89
ASCII Non-Printable characters/codes and their HTML equivalents 6 106
VBA "SendKeys" Syntax for Multiple Keystrokes 7 103
wordmultiple challenge 12 121
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

23 Experts available now in Live!

Get 1:1 Help Now