GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


win32 toolbar by JordanH
bool MasterWin32::CreateToolbar()
{
    toolHwnd = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | CCS_BOTTOM , 0, 0, 0, 0,
                           hWnd, (HMENU)ID_TOOL_FRAME_PROP, hInstance, NULL);

    if(!toolHwnd)
        return false;

    SendMessage(toolHwnd, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);

    TBBUTTON addFrameButton;
    ZeroMemory(&addFrameButton, sizeof(addFrameButton));
    addFrameButton.iBitmap = I_IMAGENONE;
    addFrameButton.fsState = TBSTATE_ENABLED;
    addFrameButton.fsStyle = TBSTYLE_BUTTON | BTNS_SHOWTEXT | TBSTYLE_NOPREFIX;
    addFrameButton.idCommand = ID_TOOL_FRAME_PROP_ADD;
    addFrameButton.iString = (INT_PTR)"Add Frame";

    if(!SendMessage(toolHwnd, TB_ADDBUTTONS, 1, (LPARAM)&addFrameButton))
        return false;
    SendMessage(toolHwnd, TB_AUTOSIZE, 0, 0);

    return true;
}