Solved

Add custom bitmap to new toolbar button

Posted on 2006-10-27
4
1,115 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

Industry Leaders: 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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

696 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