Announcement

Collapse
No announcement yet.

Win32/SDK Status Bar Text/Menu Browsing

Collapse
X
 
  • 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:

    Code:
        CASE %WM_MENUSELECT
               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
          ELSE
             ' 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
          EXIT FUNCTION
    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.

    But...

    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?

    Thanks,



    ------------------
    Michael Mattias
    Racine WI USA
    [email protected]
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

  • #2

    Michael,

    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.

    Regards,


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

    Comment


    • #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.

      Comment

      Working...
      X