Hi,
I try to use the following technique in order to enable/disable the shadow effect for a window: (The CreateParams is of course overriden. The TToolWindow descends from TForm).
procedure TToolWindow.CreateParams(var Params: TCreateParams);
var
LShadow: boolean;
begin
inherited;
if (Win32Platform = VER_PLATFORM_WIN32_NT)
and ((Win32MajorVersion > 5)
or ((Win32MajorVersion = 5) and (Win32MinorVersion >= 1))) then //Win XP or higher
if SystemParametersInfo(SPI_GETDROPSHADOW, 0, @LShadow, 0) then
begin
if LShadow and HasShadow then
Params.WindowClass.Style := Params.WindowClass.Style or CS_DROPSHADOW;
end;
end;
While this works ok for the first instance of the TToolWindow class, the following instances keep the setting from the first instance, regardless of the value of HasShadow (which is a published property of the TToolWindow class).
How can I have different shadow settings on different instances of TToolWindow?
TIA