Solved

Add custom bitmap to new toolbar button

Posted on 2006-10-27
4
1,116 Views
Last Modified: 2009-05-20
There is an existing toolbar created with CreateToolBarEx and I have added a button after the creation of this toolbar with the TB_ADDBUTTONS message and a TBBUTTON struct containing my new button's information. I need to be able to modify the imagelist of this toolbar and add a custom bitmap to it, then assign my button this new image index which I would do in the iBitmap member of the TBBUTTON struct prior to adding my new button I would assume. I need some code which can do this because I am having problems doing this.

int2strcpy
0
Comment
Question by:int2strcpy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:jhshukla
ID: 17824834
what development environment / IDE are you using?
0
 

Author Comment

by:int2strcpy
ID: 17825746
I'm using GCC on windows with Dev-C++ as an IDE.
0
 
LVL 9

Expert Comment

by:jhshukla
ID: 17828106
sorry buddy. not familiar with it.
0
 
LVL 5

Accepted Solution

by:
Rok Brnot earned 350 total points
ID: 17866351
define bitmap in .rc file
...
TB_ICN1  BITMAP "C:/Dev-Cpp/Icons/tb_icn1.bmp"
..
here is fragment of code from one of my progs, where I use custom tb icons
...
tbicn=LoadBitmap(hinst,"TB_ICN1");
dicn.hInst=NULL;
dicn.nID=(UINT)tbicn;
x=SendMessage(hwndToolBar,TB_ADDBITMAP,1,(LPARAM)&dicn);
x=SendMessage(hwndToolBar,TB_CHANGEBITMAP,ID_CMDTB1,(LPARAM)MAKELPARAM(15, 0));
...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question