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

I have a jquery dialog box which contains an image (img). I am trying
I have a list a simple dialog box which contains a few checkboxes, I
I have a very basic question. Scenario: 2 forms Form1, Form2- Dialog box which
I'm coding an MFC application in which i have a dialog box with multiple
I have the below code for my a Dialog box for a which contains
I have a dialog box with controls that is popped up and when a
I have a dialog box which appears on top of a SurfaceView. I would
In my android application I have a dialog box in which the user inputs
I have built an executable which launches a dialog box in which is embedded
I have created a Vb application/exe using ADODC components and common dialog box. but

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.