mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 12:19:18 +02:00
win32: reimplement AppBringToFront - it should take care about MainFormOnTaskBar property and it should set the last active window as a foreground window generally
git-svn-id: trunk@36181 -
This commit is contained in:
parent
f431c3e138
commit
a793b4fa1f
@ -205,9 +205,18 @@ end;
|
||||
Brings the entire application on top of all other non-topmost programs
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TWin32WidgetSet.AppBringToFront;
|
||||
var
|
||||
Window: HWND;
|
||||
begin
|
||||
if (FAppHandle <> 0) and not (Assigned(Application) and Application.MainFormOnTaskBar) then
|
||||
Windows.SetForegroundWindow(FAppHandle);
|
||||
if Assigned(Screen) and Assigned(Screen.ActiveCustomForm) and Screen.ActiveCustomForm.HandleAllocated then
|
||||
Window := Screen.ActiveCustomForm.Handle
|
||||
else
|
||||
if Assigned(Application) and Application.MainFormOnTaskBar then
|
||||
Window := Application.MainFormHandle
|
||||
else
|
||||
Window := FAppHandle;
|
||||
if (Window <> 0) and IsWindowVisible(Window) and IsWindowEnabled(Window) then
|
||||
Windows.SetForegroundWindow(Window);
|
||||
end;
|
||||
|
||||
procedure TWin32WidgetSet.SetDesigning(AComponent: TComponent);
|
||||
|
Loading…
Reference in New Issue
Block a user