Solved

SetImageList

Posted on 1998-06-07
2
480 Views
Last Modified: 2013-12-03
Does anybody knows... how come the colour of my icons were so ugly... as in not enough colour
when it's displayed on either a CListCtrl. It doesn't turns out to be as colourful as the actual *.ico file.
Instead, it becomes greyish... Is there a way to solve the problem.

The CListCtrl is supposed to list all files...juz like the Windows explorer. Thus, I loaded the *.ico for
File Folder, Text Document, Application and for the rest of file type, I use a generic icon file. Is there
a way to get the system's icon instead of loading every icons which may be rather tedious for me to
hard-code those file type.

Thanx in advance.
0
Comment
Question by:zhenteng
2 Comments
 
LVL 23

Expert Comment

by:chensu
Comment Utility
You can retrieve the icons using the SHGetFileInfo function.
0
 

Accepted Solution

by:
dvazquez earned 20 total points
Comment Utility
1. to get the colors right, experiment with the flags parameter that you pass to ImageList.Create.  I currently use ILC_MASK|ILC_COLOR, and my icons look fine.
2. Use SHGetFileInfo to a handle to the icon that goes with the files.  This function will even take care of the file folder icons if you pass it the file attributes.

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now