Listview icon not transparent

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Listview icon not transparent

18 Dec 2013, 14:53

Example code:

Code: Select all

#Include <Class_LV_AltColoredRows> ; http://www.autohotkey.com/board/topic/76844-class-lv-altcoloredrows-ahk-l/

Gui, Add, ListView, h200 w180 +LV0x2 hwndHLV Grid, Col1|Col2
	; Create ImageList
	ImageListID := IL_Create(1)
	LV_SetImageList(ImageListID)
	IL_Add(ImageListID, "shell32.dll", 5)

	; Add rows to the ListView
	Loop 10
		LV_Add("Icon9999", A_Index, A_Index)

	; Set icon to column 2 of row 2
	LV_SetSI( HLV, 2, 2, 1 )
Gui Show

LV_AltColoredRows.OnMessage()
LV_AltColoredRows.Attach(HLV)
Return

; http://www.autohotkey.com/board/topic/72072-listview-icons-in-more-than-first-column-example/
LV_SetSI(hList, iItem, iSubItem, iImage){
	VarSetCapacity(LVITEM, 60, 0)
	LVM_SETITEM := 0x1006 , mask := 2   ; LVIF_IMAGE := 0x2
	iItem-- , iSubItem-- , iImage--		; Note first column (iSubItem) is #ZERO, hence adjustment
	NumPut(mask, LVITEM, 0, "UInt")
	NumPut(iItem, LVITEM, 4, "Int")
	NumPut(iSubItem, LVITEM, 8, "Int")
	NumPut(iImage, LVITEM, 28, "Int")
	result := DllCall("SendMessage", UInt, hList, UInt, LVM_SETITEM, UInt, 0, UInt, &LVITEM)
	return result
}

GuiClose:
ExitApp
Screenshot:
1.png
1.png (3.62 KiB) Viewed 1542 times
Is it possible to make the icon transparent?

I even changed the icon background color, but still have 1 pixel white color between icon and text.
2.png
2.png (1.52 KiB) Viewed 1542 times
just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Listview icon not transparent

19 Dec 2013, 02:34

I tried to change change LV_AltColoredRows.On_NM_CUSTOMDRAW():

Code: Select all

         If (NumGet(L + ITEMSpecP, 0, "UPtr") & 1) {
            NumPut(This[H].AltColor, L + NCDSize,  4, "UInt") ; clrTextBk
            NumPut(This[H].AltColor, L + NCDSize, 16, "UInt") ; clrFace - added!!!
         }
but didn't succeed here. It seems that the modified colors are only used to draw the text part of the (sub)items.
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Listview icon not transparent

19 Dec 2013, 03:07

Also didn't succeed here. Thanks for help.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Holarctic, ishida20, jameswrightesq, Lem2001 and 409 guests