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. Customizing a toolbar

Customizing a toolbar

Scheduled Pinned Locked Moved C / C++ / MFC
csharphelpquestion
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.
  • W Offline
    W Offline
    Ward 0
    wrote on last edited by
    #1

    I've used the following code to create the toolbar window: hToolbar = CreateWindowEx(0,TOOLBARCLASSNAME,"MyToolbar",CCS_ADJUSTABLE|WS_CHILD|WS_VISIBLE|TBS_TOOLTIPS,0,0,0,0,hWnd/*this is a dialog*/,0,g_hInstance,NULL); SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); SendMessage(hToolbar,TB_SETBITMAPSIZE, 0,(LPARAM)MAKELONG(32,32)); SendMessage(hToolbar, TB_AUTOSIZE,0,0); I've added some bitmaps to the toolbar using several calls of SendMessage(hToolbar,TB_ADDBITMAP,1,(LPARAM)&bit); with bit of type TBADDBITMAP Finally added all my buttons to the toolbar using SendMessage(hToolbar, TB_ADDBUTTONS, NUMBEROFTOOLBARBUTTONS, (LPARAM)&tbb); I've added 5 buttons to the toolbar. The toolbar is perfectly visible and I've even managed to show a toolbar for each button by returning the appropriate data in the TTN_GETDISPINFO notification message. Now when I send the TB_CUSTOMIZE to the toolbar, I receive following notifications: TBN_BEGINADJUST: I simply return TRUE here Then 7(?!: I have only five buttons) TBN_QUERYINSERT notification I've printed the iItem value of the structure NMTOOLBAR for each notification: iItem = 5 iItem = 5 (why is this one send twice) iItem = 4 iItem = 3 iItem = 2 iItem = 1 iItem = 0 I return TRUE for each TBN_QUERYINSERT. And finally I get the notification TBN_ENDADJUST. Now where did the notifications TBN_QUERYDELETE and above all TBN_GETBUTTONINFO gone too?? I hope someone can help me out here, kind regards, Ward

    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