title: Grey background toolbar C++
body: <p>I am trying to create a toolbar in C++ using Win32 API (no MFC or VC++). I am able to create a toolbar which looks like this and has no background, just the basic window color.</p>
  
  <p><img src="https://i.stack.imgur.com/Z0ZLe.png" alt="enter image description here"></p>
  
  <p>I would like it to look like picture below with the glossy bar and a grey gradiant</p>
  
  <p><img src="https://i.stack.imgur.com/mS4au.png" alt="enter image description here"></p>
  
  <p>I have tried using <code>TBSTYLE_FLAT</code> when I got an undefined error, I declared it as equal to <code>0x0800</code> which still did not make any difference. Do I need to add more properties? I will paste my code below.</p>
  
  <pre><code>HWND hTbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, (HMENU)12, GetModuleHandle(NULL), NULL);
          SendMessage(hTbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
  
          TBBUTTON tb[5];
          TBADDBITMAP tBmp;
  
          tBmp.hInst =  HINST_COMMCTRL;
          tBmp.nID = IDB_STD_SMALL_COLOR;
          SendMessage(hTbar, TB_ADDBITMAP, 0, (LPARAM)&amp;tBmp);
          ZeroMemory(tb, sizeof(tb));
  
          tb[0].iBitmap = STD_FILEOPEN;
          tb[0].fsState = TBSTATE_ENABLED;
          tb[0].fsStyle = TBSTYLE_BUTTON;
  
          SendMessage(hTbar, TB_ADDBUTTONS, sizeof(tb)/sizeof(TBBUTTON), (LPARAM)&amp;tb);
  </code></pre>
  
  <p>I am using Windows 7 and the Win32 C++ API. Thanks.</p>