Minimizing an FMX form with the menu bar button and then restoring by clicking on the task bar icon will bring the form back to the foreground, but will not activate the window. The form is also minimized "directly" rather applying the animation that "shrinks" the window to the taskbar. The forms OnActivate event is not fired.
Curiously, if I patch the WindowProc and call ShowWindow with SW_RESTORE upon deactivation the form will get restored properly after clicking the taskbar icon. I'm not sure why. The minimize animation still does not get fired though.
procedure TForm1.WindowProc(var Msg: TMessage);
begin
case Msg.Msg of
WM_ACTIVATE: if (Msg.WParamLo = WA_INACTIVE) then ShowWindow(WindowHandleToPlatform(Handle).Wnd, SW_RESTORE);
end;
Msg.Result := CallWindowProc(OrgWndProc, WindowHandleToPlatform(Handle).Wnd, Msg.Msg, Msg.WParam, Msg.LParam);
end;
I can observe this behavior with a blank FMX HD form on Windows 8. This seems like an obvious bug to me, is there a better way to work around it ?