Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WM_MEASUREITEM and Owner Draw Menu

Posted on 2003-11-17
3
Medium Priority
?
732 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
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 375 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

824 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