Hi,
when I use GetSystemColor I don't get the background color of a window
GetSysColor_(#COLOR_WINDOW)
give me the number 16777215 that is not the background color of the window.
16777215 it's the color with
RED = 255
GREEN = 255
BLUE = 255
There is another way to get the background color of a window? Or am I doing something wrong with GetSysColor_?
Regards
Alberto
How to get background color of a window?
Code: Select all
A$=Space(40); Buffer which will receive data on the brush used to draw the background.
GetObject_(GetClassLong_(WindowID(),#GCL_HBRBACKGROUND),40,@A$)
bkcol=PeekL(@A$+4)
I may look like a mule, but I'm not a complete ass.
> GetSysColor_(#COLOR_WINDOW)
> give me the number 16777215 that is not the background color of the window
You're right -- it returns white for me too. I checked the Display Properties
and saw that #COLOR_WINDOW is referring to window backgrounds such as
Notepad's white background. If you change, in Display Properties, the value
of Window to red, then GetSysColor_(#COLOR_WINDOW) returns 255 (red),
and Notepad opens with a red background where you type the text.
After further checking the Display Properties settings, I found out that the
command you need is: GetSysColor_(#COLOR_3DFACE).
> bkcol=PeekL(@A$+4)
Returns 538976288 on my Win2K box, which is clearly wrong.
> give me the number 16777215 that is not the background color of the window
You're right -- it returns white for me too. I checked the Display Properties
and saw that #COLOR_WINDOW is referring to window backgrounds such as
Notepad's white background. If you change, in Display Properties, the value
of Window to red, then GetSysColor_(#COLOR_WINDOW) returns 255 (red),
and Notepad opens with a red background where you type the text.

After further checking the Display Properties settings, I found out that the
command you need is: GetSysColor_(#COLOR_3DFACE).
> bkcol=PeekL(@A$+4)
Returns 538976288 on my Win2K box, which is clearly wrong.