Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 874053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:02:41+00:00 2026-05-15T11:02:41+00:00

I’m trying to create a toolbar where my bitmaps will be 40×40 and I’m

  • 0

I’m trying to create a toolbar where my bitmaps will be 40×40 and I’m trying to make the toolbar 40 pixels in width. I want it to be a vertical toobar. I’m getting nothing but horizontal results from this code:

HWND OGLTOOLBAR::create(HWND parent,HINSTANCE hInst,WNDPROC prc, int *toolWidthPtr)
{
    if (toolhWnd != NULL)
    {
        return toolhWnd;
    }
    int iCBHeight;              // Height of the command bar 
    DWORD dwStyle;              // Style of the toolbar
    HWND hwndTB = NULL;         // Handle to the command bar control 
    RECT rect,                  // Contains the coordinates of the main 
        // window client area         
        rectTB;                // Contains the dimensions of the bounding
    // rectangle of the toolbar control
    INITCOMMONCONTROLSEX iccex; // The INITCOMMONCONTROLSEX structure
TBBUTTON tbButton[8];
wchar_t *txt = L"wii";
for(int i = 0; i < 8; i += 2)
{
    tbButton[i].iBitmap = 0;
    tbButton[i].fsStyle = BTNS_BUTTON;
    tbButton[i].fsState = TBSTATE_ENABLED;
    tbButton[i].iString = (INT_PTR)txt;
    tbButton->idCommand = 0;

}

for(int i = 1; i < 8; i += 2)
{
    tbButton[i].iBitmap = 0;
    tbButton[i].fsStyle = BTNS_BUTTON;
    //tbButton[i].fsState = TBSTATE_ENABLED;
    tbButton[i].iString = (INT_PTR)txt;\
    tbButton->idCommand = 0;

}

    iccex.dwSize = sizeof (INITCOMMONCONTROLSEX);
    iccex.dwICC = ICC_BAR_CLASSES;

    // Register toolbar control classes from the DLL for the common 
    // control.
    InitCommonControlsEx (&iccex);

    // Create the toolbar control.
    dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | TBSTYLE_WRAPABLE |   TBSTYLE_TRANSPARENT | CCS_VERT 
        ;

    if (!(hwndTB = CreateToolbarEx (
        parent,               // Parent window handle
        dwStyle,            // Toolbar window styles
        (UINT) 666,  // Toolbar control identifier
        8,          // Number of button images
        hInst,              // Module instance 
        (UINT)LoadImage(hInst,MAKEINTRESOURCE(IDB_BRUSH),0,0,0,LR_VGACOLOR),        // Bitmap resource identifier
        tbButton,           // Array of TBBUTTON structure 
        // contains button data
        sizeof(tbButton) / sizeof(TBBUTTON),
        // Number of buttons in toolbar
        40,        // Width of the button in pixels
        40,       // Height of the button in pixels
        40,         // Button image width in pixels
        40,        // Button image height in pixels
        sizeof (TBBUTTON))))// Size of a TBBUTTON structure
    {
        return NULL;
    }

    // Add ToolTips to the toolbar.
    SendMessage (hwndTB, TB_SETTOOLTIPS, (WPARAM) NUM_TOOLS, 
        (LPARAM) 8);

    // Reposition the toolbar.
    GetClientRect (parent, &rect);
    GetWindowRect (hwndTB, &rectTB);
    iCBHeight = 40;


    mainWindow = parent;
    toolhWnd = hwndTB;
    return hwndTB;

}

I was sure that CCS_VERT was supposed to make it vertical. How can I make this toobar ~40 pixels wide and have 8 squares going downward instead of horizontal. Thanks

I don’t really want separators, I just thought this would help but it didn’t…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:02:41+00:00Added an answer on May 15, 2026 at 11:02 am

    From the SDK docs:

    Creating a Vertical Toolbar

    The key to creating a vertical toolbar
    is to include CCS_VERT in the window
    style, and to set the TBSTATE_WRAP
    style for each button

    Emphasis added.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.