Results 1 to 3 of 3

Thread: List View Icons

  1. #1

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024

    List View Icons

    I have a list view that I am listing files in a directory along their the corresponding icons. The problem I have is that some of the icons are not getting a transparent background (see attached).

    The window is a modal dialog with the ListView control on it.

    I am using:
    g_hImageLst = ImageList_Create(16,16,ILC_MASK | ILC_COLORDDB, 1, 0);
    To setup my ImageList

    I am using:
    ListView_SetExtendedListViewStyle(hWnd,LVS_EX_SUBITEMIMAGES);
    To setup the list view

    Then:
    SHGetFileInfo(dirInfo.cFileName,FILE_ATTRIBUTE_NORMAL, &shInfo, sizeof(shInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ICON | SHGFI_SMALLICON);
    To Get The Files Icon

    Finally:
    ImageList_AddIcon(g_hImageLst, hIcon );
    ListView_SetImageList(m_hWnd, g_hImageLst, LVSIL_SMALL)
    To push the icons on the list and set the list.

    Any suggestions on how to fix the icons so they look better?
    Attached Images Attached Images  
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  2. #2

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    ^Bump^
    Anyone?
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  3. #3

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    After much searching and asking the question EVERYWHERE, I am closer to fixing this problem. I had to create a manifest file for the .exe.

    Inside the file I put:
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
    manifestVersion="1.0">
        <assemblyIdentity
            version="1.0.0.0"
            processorArchitecture="X86"
            name="Test.exe"
            type="win32"
        />
        <description>Test</description>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity
                    type="win32"
                    name="Microsoft.Windows.Common-Controls"
                    version="6.0.0.0"
                    processorArchitecture="X86"
                    publicKeyToken="6595b64144ccf1df"
                    language="*"
                />
            </dependentAssembly>
        </dependency>
        </assembly>
    Plus changed:
    g_hImageLst = ImageList_Create(16,16,ILC_COLOR32, 1, 0);
    ImageList_SetBkColor(g_hImageLst,CLR_NONE);

    Now about 2/3s of the icons look correct. But there still are a few that are wrong, for example .rar.

    Anyone know how to fix this?
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


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