Click here to Skip to main content
16,011,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow do you use the combo box? Pin
catngo4-Mar-04 7:43
catngo4-Mar-04 7:43 
AnswerRe: how do you use the combo box? Pin
Like2Byte4-Mar-04 7:54
Like2Byte4-Mar-04 7:54 
GeneralStopping devices in Windows 98 Pin
stasik garifulin4-Mar-04 6:47
stasik garifulin4-Mar-04 6:47 
GeneralRe: Stopping devices in Windows 98 Pin
Mazdak4-Mar-04 7:21
Mazdak4-Mar-04 7:21 
GeneralTAPI + PARALLEL PORT PROGRAMMING IN VC++ 6.0 Pin
Prabha Govind Perumal4-Mar-04 6:23
Prabha Govind Perumal4-Mar-04 6:23 
GeneralRe: TAPI + PARALLEL PORT PROGRAMMING IN VC++ 6.0 Pin
Michael P Butler4-Mar-04 6:47
Michael P Butler4-Mar-04 6:47 
GeneralListControl with shell icons Pin
rrrado4-Mar-04 6:15
rrrado4-Mar-04 6:15 
GeneralRe: ListControl with shell icons Pin
Shog94-Mar-04 7:07
sitebuilderShog94-Mar-04 7:07 
I generally just use the shell's image list, rather than copying the images into my own. First, set the list control to use shared image lists (so you don't delete the shell's list!) by setting the LVS_SHAREIMAGELISTS style. Then:
UINT uFlags = SHGFI_USEFILEATTRIBUTES|SHGFI_SYSICONINDEX|SHGFI_ICON|SHGFI_SMALLICON;
SHFILEINFO sfi;
HIMAGELIST hIL = (HIMAGELIST)::SHGetFileInfo(_T("BogusFilename.dat"), 
   FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), uFlags);
if ( NULL != hIL )
   m_ListCtrl.SetImageList(CImageList::FromHandle(hIL), LVSIL_SMALL);
if ( NULL != sfi.hIcon )
   ::DestroyIcon(sfi.hIcon);


Then, just use the SHGFI_SYSICONINDEX flag in your call to SHGetFileInfo() to find the index into the shell's list of the icon you want.

Oh yeah, one more thing - make sure your program includes a manifest so that the new WinXP controls are used. Otherwise, they won't know how to handle alpha channels... Wink | ;)

How do you move in a world of fog, That's always changing things?
Makes me wish that i could be a dog, When i see the price that you pay.

GeneralRe: ListControl with shell icons Pin
rrrado4-Mar-04 20:33
rrrado4-Mar-04 20:33 
GeneralRe: ListControl with shell icons Pin
rrrado4-Mar-04 21:21
rrrado4-Mar-04 21:21 
General__int64 question Pin
Shay Harel4-Mar-04 5:38
Shay Harel4-Mar-04 5:38 
GeneralRe: __int64 question Pin
basementman4-Mar-04 5:45
basementman4-Mar-04 5:45 
GeneralRe: __int64 question Pin
Shay Harel4-Mar-04 6:18
Shay Harel4-Mar-04 6:18 
GeneralRe: __int64 question Pin
basementman4-Mar-04 6:39
basementman4-Mar-04 6:39 
GeneralRe: __int64 question Pin
Shay Harel4-Mar-04 6:42
Shay Harel4-Mar-04 6:42 
GeneralRe: __int64 question Pin
BlackDice4-Mar-04 5:57
BlackDice4-Mar-04 5:57 
GeneralRe: __int64 question Pin
Steve S4-Mar-04 6:49
Steve S4-Mar-04 6:49 
GeneralRe: __int64 question Pin
BlackDice4-Mar-04 8:47
BlackDice4-Mar-04 8:47 
GeneralRe: __int64 question Pin
Mike Dimmick4-Mar-04 6:08
Mike Dimmick4-Mar-04 6:08 
GeneralRe: __int64 question Pin
David Crow4-Mar-04 7:13
David Crow4-Mar-04 7:13 
GeneralRe: __int64 question Pin
Shay Harel4-Mar-04 7:37
Shay Harel4-Mar-04 7:37 
GeneralRe: __int64 question Pin
jbarton4-Mar-04 10:00
jbarton4-Mar-04 10:00 
GeneralRe: __int64 question Pin
khb5-Jul-09 10:13
khb5-Jul-09 10:13 
GeneralRe: __int64 question Pin
basementman4-Mar-04 9:35
basementman4-Mar-04 9:35 
GeneralRe: __int64 question Pin
David Crow4-Mar-04 9:46
David Crow4-Mar-04 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.