Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to detect when the cursor is over a specific menu item

24 views
Skip to first unread message

Wolfgang Stahn

unread,
Oct 23, 1999, 3:00:00 AM10/23/99
to
Hello from Germany,
i have the following problem: I Have to detect, when the mouse cursor
is over a specific main menu item. WM_NCMOUSEMOVE only gives me the
information, that the cursor is over the menu at all, but not over
which specific item. Maybe if i could get the pixel positions of all
menu items i could decide (on a WM_NCMOUSEMOVE message) over which
item the cursor is. But how do i get these pixel positions?
Any ideas are welcome!
Thanks in advance
Wolfgang

Chris Becke

unread,
Oct 23, 1999, 3:00:00 AM10/23/99
to
Wolfgang Stahn wrote:

I take it you want something deeper than the WM_MENUSELECT message...

hmm, WM_MENUSELECT won't help you perfrom mouse hover detection of
non-selected top level menu's. If thats what you want - sorry. no clue.

Chris

--
Please keep newsgroup correspondence within the newsgroups.
Off topic correspondence can be directed to <mailto:chr...@mvps.org>
<http://www.mvps.org/vcfaq> Visual C & Win32 FAQ
<http://users.lia.net/chris/win32> My Win32 Development Page

Frank Kintrup

unread,
Oct 25, 1999, 3:00:00 AM10/25/99
to
In article <3811a427...@news.btx.dtag.de>, Wolfg...@gmx.net says...

Maybe you can try to use an owner-drawn menu and track the position of the
menu items as they are drawn?

Taskin Ucpinar

unread,
Oct 26, 1999, 3:00:00 AM10/26/99
to
I've done this some time ago and it was not an easy solution. I used an
owner drawn menu. It tells you which item is selected and its drawing
coordinates. For main menu items you can use NCMouseMove. For the items
in the popups I used a system wide mouse move hook.

Hope this helps.

Taskin

Christian ASTOR

unread,
Oct 27, 1999, 3:00:00 AM10/27/99
to Wolfgang Stahn
Why don't you use GetMenuItemRect() ?

Wolfgang Stahn a écrit :

Wolfgang Stahn

unread,
Oct 27, 1999, 3:00:00 AM10/27/99
to
Hello,
i can't believe it! That's the API-Call i'm looking for!!!
GetMenuItemRect() is a relativly new function, available
since Win95, and my documentation was outdated,
so it didn't contain this!
Thanks alot!
Wolfgang
0 new messages