I have problem setting images in these two common controles, actually I manage to do it well but when I change windows appearance then image backgrounds become visible which is unwanted behaviour

before changing appearance (cool)

after changing appearance (yuck)

you can see that background of hdd images is white, which is fine if control background is white but if one changes color of background (control panel->display->appearance) it does not look that neat anymore
any solutions?
Posted on 2003-04-06 20:21:50 by Mikky
You have to catch WM_SYSCOLORCHANGE and change background color for an image list

and tree/list-view control.

I do it like this for treeview:

local bck:COLORREF

. . .
.elseif eax == WM_SYSCOLORCHANGE
mov bck, $invoke(GetSysColor, COLOR_WINDOW)
invoke ImageList_SetBkColor, g_hImageListNrm, bck
TreeView_SetBkColor g_hwndTreeView, bck
Posted on 2003-04-07 03:32:01 by Four-F
Mikky: do you mean changing the color while your app is running or not? Four-F's code will work if your icons are transparent and you change the color scheme while your program is running but I think your icons aren't transparent.
Just use an imagelist and its AddMasked function to create one with transparent icons.

Posted on 2003-04-07 06:09:17 by Thomas
Hi guys,
Thomas I just wanted to make background of my images transparent on whatever color scheme
I will try out your suggestions now

Also one more question about this two controles, they are somehow not being repainted always, for example when I add somthing to listview and then minimaze main window, and after I restore main window listview is not repainted or if you like refreshed

this is part of main window with listview control with no items (cool)

this is same place after I set to foreground some other window and then returned to this (yuck)

you can see that right part of listview is not repainted, the place and size of other window that was foreground few seconds ago
I really dont know what is the problem, am I missing some style or extended style??
this does not happen with regular controls, like buttons
this listview and treeview are on tab control and they are created from resource (not sure if that has to do anything with this problem)
Posted on 2003-04-07 19:40:44 by Mikky