Solved

WM_MEASUREITEM and Owner Draw Menu

Posted on 2003-11-17
3
703 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
[X]
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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 56
MFC Dialog 9 54
how to monitor remote shell execution on linux 9 113
I could not set window to top 4 63
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seveā€¦
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.

739 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