Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to use TTS_ALWAYSTIP with CToolBarCtrl?

How to use TTS_ALWAYSTIP with CToolBarCtrl?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bin8922
    wrote on last edited by
    #1

    Hello, I need to have the Tooltip displayed on the ToolBar even when its parent window is not active. I posted a message yesterday. I was told that I can set the TTS_ALWAYSTIP on the CToolTipsCtrl. But there is no CToolTipCtrl in my program I am using the following code and don't know how to set the TTS_ALWAYSTIP. BOOL CToolBarTipTestDialog::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult) { ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW); // if there is a top level routing frame then let it handle the message if (GetRoutingFrame() != NULL) return FALSE; // to be thorough we will need to handle UNICODE versions of the message also !! TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; TCHAR szFullText[512]; CString strTipText; UINT nID = pNMHDR->idFrom; Please help me. Thanks a lot in advance. Bin

    I 1 Reply Last reply
    0
    • B bin8922

      Hello, I need to have the Tooltip displayed on the ToolBar even when its parent window is not active. I posted a message yesterday. I was told that I can set the TTS_ALWAYSTIP on the CToolTipsCtrl. But there is no CToolTipCtrl in my program I am using the following code and don't know how to set the TTS_ALWAYSTIP. BOOL CToolBarTipTestDialog::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult) { ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW); // if there is a top level routing frame then let it handle the message if (GetRoutingFrame() != NULL) return FALSE; // to be thorough we will need to handle UNICODE versions of the message also !! TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; TCHAR szFullText[512]; CString strTipText; UINT nID = pNMHDR->idFrom; Please help me. Thanks a lot in advance. Bin

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      You've obviously got a CToolBar control being created somewhere (In your CMainFrame, or Dialog). You can use:

      CToolBar::GetToolBarCtrl
      CToolBarCtrl& GetToolBarCtrl( ) const;

      Return Value

      A reference to a CToolBarCtrl object

      Then:

      CToolBarCtrl::GetToolTips
      CToolTipCtrl* GetToolTips( ) const;

      Return Value

      A pointer to the CToolTipCtrl object associated with this toolbar or NULL if the toolbar has no associated tool tip control.

      And Bob's your uncle. Iain.

      A 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        You've obviously got a CToolBar control being created somewhere (In your CMainFrame, or Dialog). You can use:

        CToolBar::GetToolBarCtrl
        CToolBarCtrl& GetToolBarCtrl( ) const;

        Return Value

        A reference to a CToolBarCtrl object

        Then:

        CToolBarCtrl::GetToolTips
        CToolTipCtrl* GetToolTips( ) const;

        Return Value

        A pointer to the CToolTipCtrl object associated with this toolbar or NULL if the toolbar has no associated tool tip control.

        And Bob's your uncle. Iain.

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        I still don't understand. Will you please give me more details? Where can I put the TTS_ALWAYSTIP in? There is not CTooltipCtrl in my project.

        I 1 Reply Last reply
        0
        • A Anonymous

          I still don't understand. Will you please give me more details? Where can I put the TTS_ALWAYSTIP in? There is not CTooltipCtrl in my project.

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          Anonymous wrote: There is not CTooltipCtrl in my project. No there isn't, but I showed you how to get from your CToolbar object [*] to its CToolBarCtrl child object, to its child CToolTipCtrl object. You can then use ModifyStyle(Ex?) to set the TSS_ALWAYSTIP style. Read my previous message, and look the commands up in MSDN for exact details. Iain. [*] You must have one of these, or you wouldn't have a toolbar to worry about!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups