CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Getting the shell icon for folder...

    Hi all!

    I am writing an application, when I need to use for a TreeView, icons used by explorer for directory & also the icons for different file type displayed within explorer.

    Thanks for your time,
    Regards,
    Usman.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Getting the shell icon for folder...

    Have a look at IShellIcon::GetIconOf
    and other IShellIcon methods.
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Re: Getting the shell icon for folder...

    Thanks for the reply VictorN & also for understanding my post . One additional question, the icon returned from the method you mentioned is an HICON, but for the TreeView/Ctrl, I need to populate the Imagelist, and that expects bmp I believe. Do I need to convert it somehow from icon to bmp??? or I can use icon. Sorry if it's too obvious, I've always used bmps with ImageLists.

    Thanks for your time,
    Regards,
    Usman.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Getting the shell icon for folder...

    From MSDN:
    CImageList::Add
    int Add( CBitmap* pbmImage, CBitmap* pbmMask );

    int Add( CBitmap* pbmImage, COLORREF crMask );

    int Add( HICON hIcon );
    So you don't need to convert anything.

    PS. If you don't use MFC - then use ImageList_AddIcon macro.
    Victor Nijegorodov

  5. #5
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Re: Getting the shell icon for folder...

    super!

    Regards,
    Usman.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured