> Given only the resource ID of a drop-down menu item, can I figure out the
> CRect of that menu item, or even the CRect of its parent menu?
> Actually I'm
> trying to get the CPoint of the mouse click on the menu, but the
> associated
> CRect would be close enough.
To my knowledge it isn't possible; can you tell us a bit more about what
you're trying to achieve (why knowing the position of the mouse when a menu
item is selected is important), in case we have some alternative ideas?
One possible way to fix it so that you get what you want is to make it an
owner draw menu. That way, you get passed a rectangle for drawing in during
WM_DRAWITEM. Since the menu always has to be re-drawn when shown (in order
for you to click on it), you can store a map of CRect / menu ID pairs
somewhere in your app in screen co-ordinates as you draw each item. If the
window gets moved, no problem - the drop-down menu would have been hidden by
then and needs reshowing (and thus redrawing, and thus renewed CRect / menu
ID pairs). That way, when they do click on your item you can grab the
mouse's current screen co-ordinates and compare them to your saved menu
rects to calculate the offset into the menu item.
--
Jason Teagle
[EMAIL PROTECTED]
