Solved

WM_MEASUREITEM and Owner Draw Menu

Posted on 2003-11-17
3
683 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

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

25 Experts available now in Live!

Get 1:1 Help Now