CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Questions about WM_MEASUREITEM

    Does anybody know how to force WM_MEASUREITEM? In particular, for a owner drawn menu?

    I googled for it, but couldnt find an answer that works for me. I heard suggestions to modify a menu item, but that didnt work. I finally got it to work with brute force -- recreate the entire menu each time I want it to be re-measured. I was wondering if anyone knew an easier 'trick'?

    Also, when I'm handling WM_MEASUREITEM (for owner drawn popup menu), I cant access the HMENU, unless I saved it in the 'data' field of MENUITEMINFO. Does anyone know of a way to access the HMENU inside WM_MEASUREITEM without having saved the HMENU?

    Thanks,
    -Martin

  2. #2
    Join Date
    Sep 2004
    Location
    Italy
    Posts
    389

    Re: Questions about WM_MEASUREITEM

    I googled for it, but couldnt find an answer that works for me. I heard suggestions to modify a menu item, but that didnt work. I finally got it to work with brute force -- recreate the entire menu each time I want it to be re-measured. I was wondering if anyone knew an easier 'trick'?
    In my experience, the WM_MEASUREITEM message is sent again when the text of all the items in the menu is changed.

    Also, when I'm handling WM_MEASUREITEM (for owner drawn popup menu), I cant access the HMENU, unless I saved it in the 'data' field of MENUITEMINFO. Does anyone know of a way to access the HMENU inside WM_MEASUREITEM without having saved the HMENU?
    Of course you can't access it, there's no HMENU member in the WM_MEASUREITEM... Another solution is a global variable...

  3. #3
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: Questions about WM_MEASUREITEM

    Thanks kkez.

    Quote Originally Posted by kkez
    Of course you can't access it, there's no HMENU member in the WM_MEASUREITEM... Another solution is a global variable...
    I meant to say 'access the HMENU inside WM_MEASUREITEM handler'

    Thanks for the info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured