BkgndColor of disabled ListIcon
BkgndColor of disabled ListIcon
I'm looking for a way to get the background color of a listicongadget when it is disabled.
I didn't find a solution, i try with some API but without succes.
It is possible to have two ways, one with themes, the oder one without.
Tks
I didn't find a solution, i try with some API but without succes.
It is possible to have two ways, one with themes, the oder one without.
Tks
A+
Denis
Denis
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Code: Select all
color = SendMessage_(<listicon>,#LVM_GETBKCOLOR,0,0)BERESHEIT
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Not so easy, eh? When the going gets tough, the tough... cheat!
Code: Select all
OpenWindow(0,0,0,320,240,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ListIconGadget(0,0,0,200,200,"Column 0",200)
DisableGadget(0,1)
color = SendMessage_(gadgetid(0),#LVM_GETBKCOLOR,0,0):Debug color ; wrong
; Ok, another try:
hdc = GetDC_(gadgetid(0))
color = GetPixel_(hdc, 2,30)
ReleaseDC_(gadgetid(0), hdc)
Debug color ; looks right
quit=0
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
quit=1
EndSelect
Until quit
BERESHEIT
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Yes, it is.srod wrote:Is it not just the #COLOR_BTNFACE system color which you can retrieve with GetSysColor_() ?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
We *almost* believe Srod, but as he is known to delve into the deep and dark recesses of the human mind (and appearently meets the likes of us down there
) we do put some question marks around his (or our
) soberness...
Well, at least it did not involve hamsters.
Well, at least it did not involve hamsters.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
no. there was something lately in the german forums...srod wrote:Is it not just the #COLOR_BTNFACE system color which you can retrieve with GetSysColor_() ?
if I remember correctly, it strongly depends on the skinning.
if it's the same as ButtonFace, it's just a coincidence.
oh... and have a nice day.
Well yes if you skin a control then you cannot rely on any color value. By default Windows will use the #COLOR_3DFACE (#COLOR_BTNFACE) for these things.Kaeru Gaman wrote:no. there was something lately in the german forums...srod wrote:Is it not just the #COLOR_BTNFACE system color which you can retrieve with GetSysColor_() ?
if I remember correctly, it strongly depends on the skinning.
if it's the same as ButtonFace, it's just a coincidence.
@Denis : works fine here with a disabled ListIcon inside an nxSplitter. If you create the ListIcon with zero width and height (ready for the splitter) then only use netty's code after placing the control inside the splitter; otherwise you will get a color value of -1 ($ffffffff). As I say, works fine here.
I may look like a mule, but I'm not a complete ass.
Ok srod, i will try this.srod wrote:
@Denis : works fine here with a disabled ListIcon inside an nxSplitter. If you create the ListIcon with zero width and height (ready for the splitter) then only use netty's code after placing the control inside the splitter; otherwise you will get a color value of -1 ($ffffffff). As I say, works fine here.
A+
Denis
Denis
