Solved

WM_MEASUREITEM and Owner Draw Menu

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to know only "File created" with EventLog 3 34
viewing source code from eclipse 13 104
Unix Command -- Challenging  question 7 88
Way to decrease size of apk file 9 65
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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