I would like to implement a listview in my program with a background image. I have seen it done before on these forums and I did search but I could not locate it. Any help is appreciated.


RIF
Posted on 2004-11-04 00:04:48 by resistance_is_futile
I don't know from personal experiance, but it seems to me that if you override the default WM_ERASEBKGND message by simply painting your background image over the entire component's DC (then returning 1 of course), it should do what you're wanting.

Spara
Posted on 2004-11-04 00:29:40 by Sparafusile
okay thus far I have:



LVBKIMAGE struct
ulFlags ULONG ?;Flags (no comment)
hbm dd ?;Not used currently
pszImage dd ? ;Address to 0 term string (URL bkg image)
cchImageMax dd ? ;Size of buffer URL (ignore while sending to cntrl)
xOffsetPercent dd ? ;Percentage X
yOffsetPercent dd ? ;Percentage Y
LVBKIMAGE ends

.const
LVM_SETBKIMAGE equ 4096 + 68

.data
IMAGENAME db "file:///C:\RADASM\Masm\Projects\cment\project2\dvsc1.bmp", 0

wndproc blah blah blah

LOCAL lvb :LVBKIMAGE

invoke CoInitialize,NULL

mov lvb.ulFlags,LVBKIF_SOURCE_URL
mov lvb.pszImage,offset IMAGENAME
mov lvb.cchImageMax,128
mov lvb.xOffsetPercent,0
mov lvb.yOffsetPercent,0
invoke SendMessage,hList2,LVM_SETBKIMAGE,0,addr lvb
invoke SendMessage,hList2,LVM_SETBKCOLOR,0,CLR_NONE
invoke SendMessage,hList2,LVM_SETTEXTBKCOLOR,0,CLR_NONE



I only get one error...

project2.asm(446) : error A2006: undefined symbol : LVBKIF_SOURCE_URL


pls help!!
Posted on 2004-11-04 01:29:04 by resistance_is_futile
okay guys got it working thanks a bunch
Posted on 2004-11-04 01:34:25 by resistance_is_futile
Could you post a sample project here?
Posted on 2004-11-04 09:00:55 by Mikky
I would like to implement a listview in my program with a background image. I have seen it done before on these forums and I did search but I could not locate it. Any help is appreciated.


RIF

You're right, at least I had posted an example and now I can't find it :(
And I'm sure there were more examples too.
Anyway, here's my code:
Posted on 2004-11-04 09:56:38 by QvasiModo
Edit: Problem Solved
Posted on 2004-11-04 17:41:27 by resistance_is_futile