Discussion:
TrackPopupMenu(), menu rect
(too old to reply)
Banner
2004-08-13 16:15:03 UTC
Permalink
I am calling TrackPopupMenu() for a popup menu. I need to know what the
menu size and position (the menu rect) will be when TrackPopupMenu() is
called. I essentially wish that I had the source code to TrackPopupMenu() so
that I could break it into two pieces, the first would get far enough that
the "rect" would be known, then I could do my other processing, and then
perform the remainder of the TrackPopupMenu() processing.

This seems like a tough one.
Ian Semmel
2004-08-13 20:20:22 UTC
Permalink
I don't really know, but you could investigate owner-drawn menus and CMenu::DrawItem
�I am calling TrackPopupMenu() for a popup menu. �I need to know what the
�menu size and position (the menu rect) will be when TrackPopupMenu() is
�called. �I essentially wish that I had the source code to TrackPopupMenu() so
�that I could break it into two pieces, the first would get far enough that
�the "rect" would be known, then I could do my other processing, and then
�perform the remainder of the TrackPopupMenu() processing.
�This seems like a tough one.
Jeff Partch [MVP]
2004-08-15 02:12:45 UTC
Permalink
Post by Banner
I am calling TrackPopupMenu() for a popup menu. I need to know what the
menu size and position (the menu rect) will be when TrackPopupMenu() is
called. I essentially wish that I had the source code to TrackPopupMenu() so
that I could break it into two pieces, the first would get far enough that
the "rect" would be known, then I could do my other processing, and then
perform the remainder of the TrackPopupMenu() processing.
This seems like a tough one.
No promises in general, and certainly since I have no idea what your 'other
processing' entails, but you might look into WM_ENTERIDLE/MSGF_MENU. The
LPARAM appears to be the HWND of the popup menu's window and you might could
get the info you're after using GetWindowRect.
--
Jeff Partch [VC++ MVP]
Loading...