Click here to Skip to main content
13,141,286 members (80,985 online)
Click here to Skip to main content
Add your own
alternative version


16 bookmarked
Posted 23 Aug 2006

A raw toolbar for Dialog and Property page with plenty nice styles (version 1.01)

, 23 Aug 2006
Rate this:
Please Sign up or sign in to vote.
A raw toolbar for Dialog and Property page with plenty nice styles

Download source program (version 1.01)

Update information

Only new features and bug-fixed are displayed bellow.
Please visit previous version 1.00 for more information.

  • FunctionCreate() function has been changed to:
    BOOL Create(CWnd*pMum,int iBmpID,int cx,int iBarID=-1,COLORREF clrBkgnd=RGB(192,192,192));
    In version 1.00, the function is:
    BOOL Create(CWnd*pMum,int iBmpID,int cx,int iBarID=-1);
    clrBkgnd : transparent color of bitmap resource, similar to the color in CImageList
    I developed 1.00 on Win98, but when I tested on XP, I found the problem: bitmap background is not transparent to COLOR_BTNFACE, this parameter allows to fit the color to COLOR_BTNFACE - automatically done by CImageList.
  • MessagesA new message is added to the toolbar: 
    If user right clicks a button, the new message is distribute to parent window.
    To process multiple messages in parent widow, a message class has to be used.
    Message signature is:
    message: WM_COMMAND, wParam: toolbar's ID (same as in version 1.00).
    lParam: a pointer to class ToolbarMine::Message.
    The inner message class contains following members:
    class Message
    UINT uMessage;//see bellow
    intiIndex;//index of the button clicked
    CRectrcButton//rectangle of the button clicked 
    uMessage has 2 cases:
      It is the same as the only message in version 1.00.
      Please note: 
      The message is actually distributed at WM_LBUTTONUP for independent buttons.
      It is almost unnecessary to define new message constant, so I simply use this existing Windows constant.
      This is similar to Windows' common buttons, which tell us a button is clicked rather than down or up.
      The message is distributed when user clicks a button by right-button of mouse.
      Right-clicking a button does not change button situations (checked or pressed) at all.
      The message allows us to do some interesting things with it.
      In my application (not sample program), I display a popup menu associated with the message, which contains "Help", "Edit", "Submit" and "Close" menu items, so my application can offer more options with a button.
    Please check source program for more.

7 interfaces on XP with different toolbar styles

(Every interface displays 14 toolbars which represent 14 button styles).

1. Toolbar style: NONE

2. Toolbar style: RAISED

3. Toolbar style: STRONG RAISED

4. Toolbar style: SUNKEN

5. Toolbar style: STRONG SUNKEN

6. Toolbar style: COLORED

7. Toolbar style: STRONG COLORED


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
Australia Australia

Please visit our Download Home to obtain many interesting software for free ...

You may also be interested in...

Comments and Discussions

GeneralCode will not compile with VS2005 Pin
DevaRoo20-Dec-06 10:02
memberDevaRoo20-Dec-06 10:02 
QuestionDo you have any idea how can I have on mouse over image? Pin
thruthesky28-Oct-06 12:49
memberthruthesky28-Oct-06 12:49 
QuestionIs it okay to hold 24x24 bmp images? Pin
thruthesky28-Oct-06 2:43
memberthruthesky28-Oct-06 2:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170915.1 | Last Updated 23 Aug 2006
Article Copyright 2006 by includeh10
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid