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. ATL / WTL / STL
  4. Adding bitmap images to toolbar buttons programmatically

Adding bitmap images to toolbar buttons programmatically

Scheduled Pinned Locked Moved ATL / WTL / STL
graphicsc++comhelpquestion
2 Posts 2 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.
  • R Offline
    R Offline
    rindam
    wrote on last edited by
    #1

    Hi I am creating a toolbar for IE in ARL,COM and WTL.I want to add bitmap images to the toolbar buttons programmatically.previously I was adding the images on the toolbar buttons by hand drawing.But these images obviously do not look good.I want to add bitmap images to the buttons programmatically.Can anybody help me with code?Thanks in advance.

    K 1 Reply Last reply
    0
    • R rindam

      Hi I am creating a toolbar for IE in ARL,COM and WTL.I want to add bitmap images to the toolbar buttons programmatically.previously I was adding the images on the toolbar buttons by hand drawing.But these images obviously do not look good.I want to add bitmap images to the buttons programmatically.Can anybody help me with code?Thanks in advance.

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      /*Here, hInst is your HINSTANCE, like: HINSTANCE hInst = _Module.GetResourceInstance();*/ /*IDB_SOME is the resource ID of your new bitmap added to the project*/ /*hWnd is the HWND of the toolbar*/ TBADDBITMAP bmpNew; bmpNew.hInst = hInst; bmpNew.nID = IDB_SOME; ::SendMessage(hWnd,TB_ADDBITMAP,1,LPARAM(&bmpNew)); TBBUTTONINFO tb; memset(&tb,0,sizeof(TBBUTTON)); tb.cbSize = sizeof(TBBUTTONINFO); tb.dwMask = TBIF_IMAGE; /*Here, set this number to the next value after the end of your bitmapped toolbar*/ tb.iImage = 6; /*ID_FIRST_BUTTON is the ID of the toolbar button you want to set the image of*/ ::SendMessage(hWnd,TB_SETBUTTONINFO,ID_FIRST_BUTTON,LPARAM(&tb));

      this is this.

      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