dcsimg
Results 1 to 8 of 8

Thread: ToolTip on Menu Item

  1. #1

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,986

    ToolTip on Menu Item

    Ok here's another I haven't tried to do before.

    I've got a nice ToolTip procedure that puts nice multi-line balloon tooltips on the screen. However, typically, I call it in MouseMove events, and it takes the hWnd of the control I'm putting it on. And I've got neither of those for a menu item.

    Actually, I'm not sure a menu item even has a hWnd. I suspect the overall dropdown list has a hWnd, but I'd need it for each item. I suppose I could make it work with the hWnd to the dropdown window, but I still need a MouseMove event.

    Hmmm, maybe I'm working this out as I type. I suppose I could parse the items on the list and do a bit of 2D geometry to figure out which one I'm hovering over. Argh, that feels messy.

    ---------

    Any ideas on this would be greatly appreciated.

    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #2

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,986

    Re: ToolTip on Menu Item

    Here, I mocked up what I'd like to do:

    Name:  TooTipOnMenu.png
Views: 66
Size:  3.4 KB

    EDIT: Just FYI, that was photoshopped, not programmed.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  3. #3
    Fanatic Member
    Join Date
    Feb 2019
    Posts
    522

    Re: ToolTip on Menu Item

    You might be better of with an owner drawn menu to save your time, like those that can display icons. The standard menu is windowless. You call GetMenu to get hMenu(This can be done with other apps too), then you call GetSubMenu, followed by GetMenuItemRect. You probably looking at more than 100 lines of code to do this. Not to mention subclassing.

  4. #4
    Fanatic Member
    Join Date
    Feb 2019
    Posts
    522

    Re: ToolTip on Menu Item

    Found this sample that adds tooltips:

    http://www.vbforums.com/showthread.p...-to-menu-items

  5. #5

  6. #6

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,986

    Re: ToolTip on Menu Item

    Quote Originally Posted by fafalone View Post
    Elroy I feel like we've had this discussion before...
    Hmmm, interesting. I tried turning that into a true tooltip and it's got some problems, but it's definitely something to work with. qvb6, your link also has some interesting code. I'm working some other stuff right now. But, if I get back to this and get a cleaned up version, I'll post it.

    And it's amazing how little memory I have of that other work. I certainly didn't incorporate it into anything I distributed.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  7. #7
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    2,088

    Re: ToolTip on Menu Item

    Why would a Menu-Item not have a Handle?
    GetMenu to get the Top-Level-Menu-Handle --> https://docs.microsoft.com/en-us/win...ectedfrom=MSDN
    GetSubMenu to get the Handle to Menu-Item --> https://docs.microsoft.com/en-us/win...ser-getsubmenu
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  8. #8
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    2,088

    Re: ToolTip on Menu Item

    Couldn't edit my post:
    WOOOPSS!
    Just saw qvb6 said the same
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width