Click to See Complete Forum and Search --> : permanent desktop icon text color change


sv13
October 18th, 2009, 08:15 AM
hi

i can change color with


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.

sv13
October 20th, 2009, 02:30 PM
ok, now tell me how can i detect desktop refresh ^^, i've been googling for hours with no success

VladimirF
October 20th, 2009, 04:56 PM
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?

hoxsiew
October 20th, 2009, 11:21 PM
How are you setting the icons? Are you using an imagelist? If so, are you using ILC_MASK with ILC_COLOR32 or ILC_COLOR24?

sv13
October 21st, 2009, 06:24 AM
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


Are you sure that only that "Refresh" command will restore original color? no, i am not, but its first thing i noticed :)
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

hoxsiew
October 21st, 2009, 09:17 AM
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.