[Lazarus] SetSysColors

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] SetSysColors

Free Pascal - Lazarus mailing list

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.

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus