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:
paul 2012-03-21 01:24:02 +00:00
parent f431c3e138
commit a793b4fa1f

View File

@ -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);