Solved

SetImageList

Posted on 1998-06-07
2
494 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
ID: 1407094
You can retrieve the icons using the SHGetFileInfo function.
0
 

Accepted Solution

by:
dvazquez earned 20 total points
ID: 1407095
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 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