Huhu,
genau sowas brauchte ich mal für die aufrufende Form, nicht den ganzen Desktop.
Vielleicht kann es jemand gebrauchen:
Delphi-Quellcode:
function ShowModalDimmed(Form, ParentForm: TForm): TModalResult;
var
Back: TForm;
i: Byte;
begin
Back := TForm.Create(nil);
try
Back.Position := ParentForm.Position;
Back.BorderStyle := ParentForm.BorderStyle;
Back.BorderIcons := [];
Back.AlphaBlend := true;
Back.AlphaBlendValue := 0;
Back.Color := clBlack;
with ParentForm do Back.SetBounds(Left, Top, Width, Height);
Back.Show;
for i := 1 to 185 do
begin
Back.AlphaBlendValue := i;
Sleep(2)
end;
Form.Left := ParentForm.left + ((ParentForm.Width - Form.Width) div 2);
Form.Top := ParentForm.Top + ((ParentForm.Height - Form.height) div 2);
Result := Form.ShowModal
finally
Back.Free;
ParentForm.BringToFront
end
end;