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 509419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:00:32+00:00 2026-05-13T07:00:32+00:00

I have a dialog box on which controls are added with resource editor. But

  • 0

I have a dialog box on which controls are added with resource editor. But I am trying to create a toolbar on the fly in WM_INITGDIALOG message but the toolbar is not visible. Is there something else to do make it visible(I dont think so but…). If this is not possible how can add a toolbar in resource editor.

As you guessed I use VS 2008.

CreateButtons(HWND hwnd)
{
    HIMAGELIST m_hTBImageList;
    HIMAGELIST m_hTBHottrack;



    HWND hwndSysButtonTB = CreateWindowEx(0,
        TOOLBARCLASSNAME, 
        _T(""), 
        WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | CCS_NORESIZE | CCS_NOPARENTALIGN,
        toolbarRect.left, toolbarRect.top, toolbarRect.right-toolbarRect.left, toolbarRect.bottom-toolbarRect.top, 
        hwnd,
        (HMENU)IDR_TOOLBAR, 
        (HINSTANCE)hAppInstance, 
        NULL);

    m_hTBImageList = ImageList_LoadImage((HINSTANCE)hAppInstance, 
        MAKEINTRESOURCE(IDB_BITMAP_ICONS), toolbarButtonSize.cx, 1, 
        0, IMAGE_BITMAP, LR_CREATEDIBSECTION|LR_SHARED);
    m_hTBHottrack  = ImageList_LoadImage((HINSTANCE)hAppInstance, 
        MAKEINTRESOURCE(IDB_MOUSEOVER), toolbarButtonSize.cx, 1, 
        0, IMAGE_BITMAP, LR_CREATEDIBSECTION|LR_SHARED);

    SendMessage(hwndSysButtonTB, (UINT) TB_SETIMAGELIST, 0, (LPARAM)m_hTBImageList);
    SendMessage(hwndSysButtonTB, (UINT) TB_SETHOTIMAGELIST, 0, (LPARAM)m_hTBHottrack);
    SendMessage(hwndSysButtonTB, (UINT) TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);

    // win2k: set color of hot tracking frame
    COLORSCHEME scheme;
    scheme.dwSize = sizeof(scheme);
    scheme.clrBtnHighlight = RGB(175,175,175);
    scheme.clrBtnShadow = RGB(175,175,175);
    SendMessage(hwndSysButtonTB, (UINT) TB_SETCOLORSCHEME, 0, (LPARAM)&scheme);

    TBBUTTON ButtonEnd =            {0,ID_BUTTON_END,TBSTATE_ENABLED,TBSTYLE_BUTTON};
    TBBUTTON ButtonRefresh =        {1,ID_BUTTON_REFRESH,TBSTATE_ENABLED,TBSTYLE_BUTTON};
    TBBUTTON ButtonOptions =        {2,ID_BUTTON_PROPERTIES,TBSTATE_ENABLED,TBSTYLE_BUTTON};



    SendMessage(hwndSysButtonTB, (UINT) TB_ADDBUTTONS, 1, (LPARAM)&ButtonEnd);
    SendMessage(hwndSysButtonTB, (UINT) TB_ADDBUTTONS, 1, (LPARAM)&ButtonRefresh);
    SendMessage(hwndSysButtonTB, (UINT) TB_ADDBUTTONS, 1, (LPARAM)&ButtonOptions);

} 
  • 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-13T07:00:32+00:00Added an answer on May 13, 2026 at 7:00 am

    You have to call

    SendMessage(hwndSysButtonTB, TB_AUTOSIZE, 0, 0); 
    ShowWindow(hwndSysButtonTB , SW_SHOW); 
    

    at the end of your function.

    And I think you should use an TBBUTTON array instead of three separate variables. Then you can add them all at once with

    SendMessage(hwndSysButtonTB, (UINT) TB_ADDBUTTONS, 3, (LPARAM)&ButtonArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whenever I use the signal/slot editor dialog box, I have to choose from the
I have a dialog box that the user inserts various data through gui controls,
i have a dialog box in which a edit control and a button is
How can I make that dialog box which most of the applications have that
I have a dialog box that allows users to set hotkeys for use in
I have a v simple dialog box that I would like to display as
Anyone have any experience creating a modal dialog box using AJAX and ASP.NET MVC?
I have a problem with the jquery-ui dialog box . The problem is that
I have a dialog that resizes. It also has a custom background which I
This seems like a fundamentally simple question. I have a WinForms dialog box with

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.