|
-
September 2nd, 2009, 07:33 PM
#5
Re: load wordpad icons into an imagelist
Hello motobizio
Yes, the icons in my imagelist are 16x16.
I'm setting up my toolbar in a slightly different way than you suggested. My toolbar is basically the code here on MSDN
Except in my case, instead of using the IDB_STD_SMALL_COLOR, I imported an imagelist from wordpad as a resource.
Another difference is that I can't specify which image from the bitmap image list I want to use in the TBBUTTON by calling MAKELONG(STD_FILENEW, ImageListID), my imported imagelist doesn't have a STD_FILENEW button. I specify by this by using MAKELONG(1, ImageListID). Where 1 is the index of the first image in the image list.
so instead of calling....
Code:
ImageList_Create
LoadImage
ImageList_Add
SendMessage(..., TB_SETIMAGELIST, ...)
SendMessage(..., TB_ADDBUTTONS, ...)
I'm callling
Code:
ImageList_Create
SendMessage(..., TB_SETIMAGELIST, ...)
SendMessage(..., TB_LOADIMAGES, ...)
TBBUTTON tbButtons[numButtons]
SendMessage(..., TB_BUTTONSTRUCTSIZE, ...)
SendMessage(..., TB_ADDBUTTONS, ...)
This worked perfectly fine when I was using the IDB_STD_SMALL_COLOR imagelist, but it does not work with my imported imagelist. I tried your method, but it was not successful. I'm guessing that I either imported the imagelist improperly or I'm calling the index of the images in the imagelist improperly. I'm pretty sure that I imported it properly though because I can see the entry in my .rc file and on my resource.h file. Also, the code runs fine, no compile errors, there just isn't any icon in the button.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|