| | |
How do I use custom icons for toolbar?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 45
Reputation:
Solved Threads: 1
Okay, I have been googling and looking on MSDN for this for a couple hours or so, and I will continue to do so until somebody replies. I need some help on a program I am making in my free time.
Can sombody tell me what would be a good way to create my own icon list to use in a toolbar. I have a toolbar, and I don't like the look of the IDB_STD_SMALL_COLOR icon list. I would really like to make my own, and I can make the icons, I just need to know how I can create my own list of icons. But there is a catch, it can't use any resource scripts.
I am not looking for somebody to just hand me a script and say "here you go", I would like either a small tutorial by you, or a link to a tutorial.
I have an idea of how I could do it:
But this doesn't work, because iBitmap is an integer. So there must be some way. I have heard of image lists, and looked them up on MSDN, but I don't understand them. They are just numbers, where do the actual filenames come into play?
Summary: How to set my own icons for a toolbar.
Can sombody tell me what would be a good way to create my own icon list to use in a toolbar. I have a toolbar, and I don't like the look of the IDB_STD_SMALL_COLOR icon list. I would really like to make my own, and I can make the icons, I just need to know how I can create my own list of icons. But there is a catch, it can't use any resource scripts.
I am not looking for somebody to just hand me a script and say "here you go", I would like either a small tutorial by you, or a link to a tutorial.
I have an idea of how I could do it:
CPP Syntax (Toggle Plain Text)
TBBUTTON btn[12]; TBADDBITMAP bmp; HINSTANCE hInst = GetModuleHandle(NULL); bmp.hInst = hInst; //bmp.nID = IDB_STD_LARGE_COLOR; // Can I just not set nID? SendMessage(toolbar, TB_ADDBITMAP, 0, (LPARAM)&bmp); ZeroMemory(btn, sizeof(btn)); btn[0].iBitmap = LoadIcon(hInst, "new.ico"); btn[0].fsState = TBSTATE_ENABLED | TBSTATE_WRAP; btn[0].fsStyle = TBSTYLE_BUTTON; btn[0].idCommand = CTRL_MENU_FILE_NEW; // ...
But this doesn't work, because iBitmap is an integer. So there must be some way. I have heard of image lists, and looked them up on MSDN, but I don't understand them. They are just numbers, where do the actual filenames come into play?
Summary: How to set my own icons for a toolbar.
•
•
Join Date: Jul 2008
Posts: 45
Reputation:
Solved Threads: 1
Why isn't anybody answering me? This was the last place I looked and still nobody cares. It's not like I haven't tried, I have worked my ass of trying to do this. I know somebody knows how to do this, and several people who do saw my thread and didn't bother to help.
I got my icons, and I define the bitmap an define the offset in the iBitmap property, but it still doesn't work, and I was following a tutorial. I can't find any other place that has information on this.
They all use the STD library.
So seriously, somebody answer me please.
I got my icons, and I define the bitmap an define the offset in the iBitmap property, but it still doesn't work, and I was following a tutorial. I can't find any other place that has information on this.
They all use the STD library.
So seriously, somebody answer me please.
![]() |
Similar Threads
- Internet Explorer Favorites, custom website icons disappearing (Web Browsers)
- Custom IE Toolbar Development, Custom Firefox Toolbar Development (Web Hosting Deals)
- ALL Desktop Icons and toolbar disappear (Windows NT / 2000 / XP)
- Help with Icons (C#)
- Duplicate icons on toolbar! Please help. (Viruses, Spyware and other Nasties)
- toolbar Icon (Windows 95 / 98 / Me)
- no icons or toolbar visible (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: std::map with char*
- Next Thread: WinAPI Dialogs class without MFC
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete deploy desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelp homeworkhelper iamthwee ifstream input int integer lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree unix url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





