1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I make Icons Transparent using C++?

Discussion in 'MFC' started by Panarchy, Apr 24, 2009.

  1. Panarchy

    Panarchy New Member

    Joined:
    Nov 29, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    Hello

    How do I make icon labels transparent using C++?

    More info: Make XP Desktop Icon Label Transparent

    Please tell me if this is possible to do via C++.

    Thanks in advance,

    Panarchy

    PS: I would like whichever method you suggest to me to be able to run without launching of a command-prompt window.
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    This is probably in the Registry somewhere, so what I'd do is to install a utility like RegShot, take a registry snapshot, perform the actions in the page you linked to, take a second registry snapshot and compare the two. RegShot does all that for you and produces a difference report.

    And the way to do this without launching a command prompt window as I've already told you once is to write the program as a Windows program starting with WinMain, not as a simple main() program because the latter will give you a command prompt however briefly. You need to find out how your compiler supports Windows programs so that you don't get an "unresolved symbol: main" error at link time.

    For MinGW for example you need to specify the flag -mwindows. See http://www.osix.net/modules/article/?id=670
     
  3. Panarchy

    Panarchy New Member

    Joined:
    Nov 29, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    Hello

    Thanks for your reply.

    Not a bad idea, to do as you say.

    After thinking about it for a while, since registry changes are involved, it'd probably be best for me to write it into the actual installer.

    NSIS

    What are your thoughts on this?

    Panarchy
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    Dunno, there's a lot of context I haven't got a clue about here. What installer?
     
  5. Panarchy

    Panarchy New Member

    Joined:
    Nov 29, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    NSIS

    (NullSoft)
     
  6. Panarchy

    Panarchy New Member

    Joined:
    Nov 29, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    I've worked it out (with a little help from usenet).

    Add the following to your NSIS script to achieve transparency on your icon text labels;
    Code:
    Section "Icon Text Label"
    
    WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer
    \Advanced" "ListviewShadow" 1
    SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} 0 "STR:Environment" 
    
    SectionEnd
    Enjoy ;)

    Panarchy
     

Share This Page