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. CFrameWnd and CToolBar and tooltips. Should be simple but.. [modified]

CFrameWnd and CToolBar and tooltips. Should be simple but.. [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
question
1 Posts 1 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.
  • F Offline
    F Offline
    FloatingMarc
    wrote on last edited by
    #1

    I have now been strugling since several days, but I can't get my tooltips to show. I have a CFrameWnd that I dynamically create, which contains a CToolBar for which I want tooltips to show up. Here is what I have so far: CFrameWnd creation:

    HINSTANCE aa=AfxGetInstanceHandle();
    LPCTSTR theClass=AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_OWNDC|CS_DBLCLKS,0,0,LoadIcon(aa,MAKEINTRESOURCE(IDR_MY_ICON)));
    MyCFrameWnd->Create(theClass,"MyAppName",WS_TABSTOP|WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS);

    CToolBar creation (in MyCFrameWnd):

    EnableDocking(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM|CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT);
    MyCToolBar=new CToolBar();
    MyCToolBar->CreateEx(this,TBSTYLE_FLAT,WS_CHILD|WS_VISIBLE|CBRS_SIZE_DYNAMIC|CBRS_TOP|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|CBRS_TOOLTIPS);//|CBRS_FLYBY );
    MyCToolBar->LoadToolBar(IDR_TOOLBAR);
    MyCToolBar->SetWindowText("Navigation");
    MyCToolBar->EnableDocking(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM);
    MyCToolBar->SetButtons(toolbarStruct(containing command IDs),toolbarItemNb);
    MyCToolBar->SetButtonStyle(MyCToolBar->CommandToIndex(TOOLBAR_CMD_1),TBBS_CHECKBOX);
    ... (similar for the other buttons as above line)
    DockControlBar(CMyToolBar,AFX_IDW_DOCKBAR_TOP);

    Then for every toolbar image in the toolbar editor, I added the tooltip text under "Prompt" (in the properties view). e.g. "hello world\nhello world" Finally, my MyCFrameWnd has a custom message handler (WindowProc) and at the end of that routine I call:

    return (CFrameWnd::WindowProc(uMsg,wParam,lParam));

    When I look at messages that my toolbar generates/receives (using spy++), I cannot see any WM_NOTIFYFORMAT, WM_NOTIFY or WM_TIMER like other applications showing tooltips. Does anyone have a small clue why my tooltips don't show?

    modified on Monday, August 31, 2009 11:44 PM

    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