Announcement

Collapse
No announcement yet.

MenuItemFromPoint

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MenuItemFromPoint

    I have a menu bar that shows both popup menus and direct commands. I liked to use the status bar to show a help tip when the cursor passes over the menu bar commands. To do so I have the following:

    1- On a %WM_NCMOUSEMOVE message I check wParam = %HTMENU. If true then
    2- I pass the screen coordinates to MenuItemFromPoint. This API call works on a point (cursor position):
    POINT structure specifying the location to test. If hMenu specifies a menu bar, this parameter is in window coordinates. Otherwise, it is in client coordinates.
    This function does not work (Win NT4). May be there are problems on the "window coordinates": I tried with both client and screen coordinates, and with coordinates related on the top-left corner of the window.

    This moment my program works correctly using a GetMenuItemRect loop (I don't like this since it is a slower method). Since both MenuItemFromPoint and GetMenuItemRect are new entries on NT4, I think they should both work (or not work). Any ideas?

    Aldo

    ------------------
    Rgds, Aldo

  • #2
    What about triggering your status bar messages on the WM_MENUSELECT message?

    [This message has been edited by Matthew Berg (edited May 07, 2001).]
    If you try to make something idiot-proof, someone will invent a better idiot.

    Comment


    • #3
      Matthew,

      I get the %WM_MENUSELECT message only after I clicked on the menu bar. I want to show the help tip as the cursor passes over the menu bar (without clicks).

      Thanks anyway.

      Aldo

      ------------------
      Rgds, Aldo

      Comment

      Working...
      X