No announcement yet.

Win32/SDK Status Bar Text/Menu Browsing

  • Filter
  • Time
  • Show
Clear All
new posts

  • Win32/SDK Status Bar Text/Menu Browsing

    I am trying to put some "help text" in a status bar window.

    I am using a top level menu; each top level item has a POPUP menu associated with it.

    Currently, I intercept the WM_MENUSELECT message, with this code:

               LOCAL szsText AS ASCIIZ * 60
          ' see if browsing a top-level menu
          ' this works, but does not show anything unless the user is currently browsing a menu
          IF lParam = getMenu(hwnd) THEN       'it's a top level menu
             SELECT CASE LOWRD(wParam)
                    CASE %IDM_INDEX_FILE
                       szsText = "File and Database Commands"
                    CASE %IDM_INDEX_OPTIONS
                       szsText = "Output Options"
                    CASE %IDM_INDEX_REPORTS
                       szsText = "Reports and Queries"
                    CASE %IDM_INDEX_HELP
                       szsText = "Help and 'About' information"
              END SELECT
             ' this works good for the items in the popups
             LoadString GetWindowLong(hWnd, %GWL_HINSTANCE), wParam, szsText, SIZEOF(szsText)
          END IF
          SendMessage hStatus, %WM_SETTEXT, 0, VARPTR(szsText)
          FUNCTION = 0
    As noted in the comments, this works fine as long as the user has "selected" a menu, and the associated popup menu has been displayed; and when the user actually selects an item from the popup, I get the correct text as well by intercepting WM_COMMAND.


    I am trying to get text to display when the user just passes the mouse over the top-level menu item, when Windows makes the item "currently under the mouse" appear to be in a 'raised' button. That is, be able to change the help text even though the user has not yet 'selected' a menu item.

    I have looked through MSDN and the Win32 kit, and can't seem to find a message to intercept which says, "the cursor is currently over a top-level menu item."

    Can anyone point me in the correct direction?


    Michael Mattias
    Racine WI USA
    [email protected]
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]

  • #2


    I don't think thats possible, I tried looking for top level menu messages and none are sent.

    You could try intercepting %WM_NCHITTEST and look up the cursor in relation to the required menu item, that seems workable.


    Kev G Peel
    KGP Software, Bridgwater, UK.
    mailto:[email protected][email protected]</A> | Slam DBMS | PrpT Control | Other Downloads | Contact Me


    • #3
      ...can't seem to find a message to intercept which says, "the cursor is currently over a top-level menu item."
      Does Windows not generate WM_NCMOUSEMOVE messages for this situation?
      If you try to make something idiot-proof, someone will invent a better idiot.