Shadow on Sorting, Columns, etc.

[expired user #5099]'s profile image [expired user #5099] posted 14 years ago in General Permalink
Hi,
I was searching for a solution for a feature that is similar to your Sorting or Columns dropdown forms, but with a shadow for better contrast.

Although the solution for this is very simple in the end it took me quite a while. In case you thought of doing the same, but had problems as well integrating a shadow, here's my solution. Feel free to use it in HeidiSQL if you like.


protected
procedure CreateParams(var Params: TCreateParams); override;

[...]

procedure TForm1.CreateParams(var Params: TCreateParams);
const
CS_DROPSHADOW = $00020000;
begin
inherited CreateParams(Params);

with Params do
begin
WndParent := GetDesktopWindow;
WindowClass.Style := WindowClass.Style OR CS_DROPSHADOW;
end;
end;
[expired user #5099]'s profile image [expired user #5099] posted 14 years ago Permalink
An addition: To prevent the new form being shown in the tray add
Params.ExStyle := Params.ExStyle or WS_EX_TOOLWINDOW or WS_EX_NOACTIVATE;
in the Params section.

(note that WS_EX_NOACTIVATE is available since Win2000. In case you want to support older OS versions you'll need to lease out that parameter in an if-clause)

Please login to leave a reply, or register at first.