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
Re: Questions about WM_MEASUREITEM
Quote:
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.
Quote:
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...
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.