1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
HWND CreateToolbar(BOOL flat, HWND parent)
{
DWORD styles = WS_VISIBLE | CCS_NODIVIDER | CCS_NOPARENTALIGN | TBSTYLE_TOOLTIPS | TBSTYLE_WRAPABLE | WS_CHILD;
if (flat)
styles |= TBSTYLE_FLAT | TBSTYLE_TRANSPARENT;
HWND hwnd = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, styles,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
parent, NULL, GetModuleHandle(NULL), NULL);
SendMessage(hwnd, TB_SETEXTENDEDSTYLE, 0, (LPARAM)TBSTYLE_EX_DOUBLEBUFFER | TBSTYLE_EX_DRAWDDARROWS);
SendMessage(hwnd, TB_SETMAXTEXTROWS, 0, 0);
SendMessage(hwnd, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
return hwnd;
}
|