Discussion:
[Lazarus] SetSysColors
Michael Van Canneyt via Lazarus
2018-06-05 20:17:22 UTC
Permalink
Hello,


If I execute the following at the start of the program:

uses lcltype, lclintf, graphics;

Procedure sc;

Var
el : Integer;
col : Integer;
P1,P2 : PInteger;

begin
Col:=ColorToRGB(clRed);
el:=COLOR_WINDOW;
P1:=@el;
p2:=@col;
SetSysColors(1,P1,p2);
end;

I would expect that the window color is red, and all windows which have
clDefault or clWindow as color become red.

No such thing happened. I tried setting some other colors, but to no avail.

Is this supposed to work ?

Aside from the question whether it is supposed to work, why is the signature
of this call using 2 untyped const parameters ?

If I look at
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724940(v=vs.85).aspx
it clearly uses (typed) pointers.

Michael.

--

Loading...