Solved

SetImageList

Posted on 1998-06-07
2
504 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
[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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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 brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

628 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