lcl: TApplication.IsShortcut: check if mainform handleallocated

This commit is contained in:
mattias 2022-08-31 23:20:32 +02:00
parent 7347d41a12
commit 5852af11e6

View File

@ -2076,7 +2076,8 @@ begin
end; end;
// let the main form handle the shortcut // let the main form handle the shortcut
if Assigned(MainForm) and (Screen.ActiveCustomForm <> MainForm) and IsWindowEnabled(MainForm.Handle) then if Assigned(MainForm) and (Screen.ActiveCustomForm <> MainForm)
and MainForm.HandleAllocated and IsWindowEnabled(MainForm.Handle) then
begin begin
Result := FMainForm.IsShortcut(Message); Result := FMainForm.IsShortcut(Message);
if Result then Exit; if Result then Exit;