CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Posts
    20

    permanent desktop icon text color change

    hi

    i can change color with

    Code:
    	HWND dh = FindWindow("ProgMan",0);
    	dh=GetWindow(dh,GW_CHILD);
    	dh=GetWindow(dh,GW_CHILD);
                ListView_SetTextBkColor(dh, CLR_NONE);  // icon background to transparent
                ListView_SetTextColor (dh, RGB(0,255,0));  // icon text color to rgb()
                ListView_RedrawItems (dh, 0, ListView_GetItemCount(dh) - 1); // redraw all icons
    everything works fine, but icon background and text color gets back to normal when i refresh desktop(F5), is there a way to change it permanent. Any registry entry where that color is stored?
    my program closes itself when it gets the job done, so i cant monitor for desktop refresh and change color then.

  2. #2
    Join Date
    Aug 2009
    Posts
    20

    Re: permanent desktop icon text color change

    ok, now tell me how can i detect desktop refresh ^^, i've been googling for hours with no success

  3. #3
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: permanent desktop icon text color change

    Are you sure that only that "Refresh" command will restore original color?
    Anyway, with a help from Spy++ you can see that refresh sends WM_USER+3152 message to the list view.
    Now you "only" need to somehow hook into that list's window proc and monitor that message
    But if you can hook into it - you might also hook into its parent and handle the custom draw messages.
    But why would you want to change that color?
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  4. #4
    Join Date
    Feb 2005
    Posts
    2,160

    Re: permanent desktop icon text color change

    How are you setting the icons? Are you using an imagelist? If so, are you using ILC_MASK with ILC_COLOR32 or ILC_COLOR24?

  5. #5
    Join Date
    Aug 2009
    Posts
    20

    Re: permanent desktop icon text color change

    Quote Originally Posted by hoxsiew View Post
    How are you setting the icons? Are you using an imagelist? If so, are you using ILC_MASK with ILC_COLOR32 or ILC_COLOR24?
    don't know what are you referring to, i am talking about icons on desktop here


    Quote Originally Posted by VladimirF View Post
    Are you sure that only that "Refresh" command will restore original color?
    no, i am not, but its first thing i noticed
    Quote Originally Posted by VladimirF View Post
    But why would you want to change that color?1888644
    my wallpaper changes every few hours, and i want black icon font color on light wallpaper and
    white font on dark one ^^ ofc. drop shadow is disabled

    second thoughts: i will probably stick with drop shadow for now(su.x hard on white background), cause i never played with hooks and dont have much time now

  6. #6
    Join Date
    Feb 2005
    Posts
    2,160

    Re: permanent desktop icon text color change

    Quote Originally Posted by sv13 View Post
    don't know what are you referring to, i am talking about icons on desktop here
    Oops. For some reason I thought you were dealing with a ListCtrl. I must have confused this with another thread. Sorry.

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