This pertains to a Delphi application with a child form that has been shown and then hidden but not freed. If a user hovers over the (Windows 10) taskbar "mini-view" of the application the hidden form(s) will become visible (during the hover.) They will hide when the user clicks on the mini-view to change focus to the application. Is there any way to avoid this?
To recreate:
Note that minimizing the application and restoring it does "fix" the affect until the next time the forms are shown. Perhaps that's a clue as to what is causing it or a clue to a work-around? This isn't a huge issue as it doesn't appear to cause any actual problems, but it does look unprofessional.
Adding code as requested (however it's not going to be very interesting.)
program Project1;
uses
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end.
// Only code that was added to TForm1:
procedure TForm1.Button1Click(Sender: TObject);
begin
// Show and then hide the form or use ShowModal and close it before testing the hover.
Form2.Show;
Form2.Hide;
// Form2.ShowModal;
end;
Update: How to show the issue using just the Delphi IDE.
[2023 Update] This behavior is directly related to the option called "Animate windows when minimizing and maximizing" in System properties, Advanced, Performance settings, on Windows 10 and 11. When that option is turned off the above behavior does not happen.
It appears that Dave Olson's comment about this being Windows version specific is correct. This issue seems to have completely gone away in the latest builds of Windows 10 (even when used with older compiled versions of programs that would show the issue previously.) As an aside I wonder if the people who couldn't reproduce the issue were on the Windows Insider Program and had newer builds.