Thread: TBADDBITMAP nID member

  1. #1
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532

    TBADDBITMAP nID member

    I was wondering, what are the dimensions of the bitmap like the STD_FILENEW you would use for a toolbar? Also, if you made your own bitmaps, would you just assign the nID member's value the ID of your bitmap you want to use? I don't think that's right because MSDN says: "Resource identifier of the bitmap resource that contains the button images.". So it doesn't look like just a regular bitmap you would create that is just one big picture. So basically, what steps would you have to take to tell it to use your custom button images? Thanks.
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544

  3. #3
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532
    This displays blank buttons:
    Code:
        TBBUTTON tbb[2];
        TBADDBITMAP tbab;
        SendMessage(hTool,TB_BUTTONSTRUCTSIZE,(WPARAM)sizeof(TBBUTTON),0);
        tbab.hInst=hInstance;
        tbab.nID=TOOLBAR_ICONS;
        int iOffSet;
        iOffSet=SendMessage(hTool,TB_ADDBITMAP,5,(LPARAM)&tbab);
        ZeroMemory(tbb, sizeof(tbb));
        tbb[0].iBitmap = iOffSet+0;
        tbb[0].fsState = TBSTATE_ENABLED;
        tbb[0].fsStyle = TBSTYLE_BUTTON;
        tbb[0].idCommand = ID_FNEW;
        tbb[1].iBitmap = iOffSet+1;
        tbb[1].fsState = TBSTATE_ENABLED;
        tbb[1].fsStyle = TBSTYLE_BUTTON;
        tbb[1].idCommand = ID_FSAVE;
        SendMessage(hTool, TB_ADDBUTTONS, sizeof(tbb)/sizeof(TBBUTTON), (LPARAM)&tbb);
    Did I miss something?
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Replies: 2
    Last Post: 04-19-2008, 12:06 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM