mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 02:16:48 +02:00
LCL/Win32: Fix opening popup menu when Application.MainForm does not exist. Issue #39451. Patches by DeerLab and Iret Company.
This commit is contained in:
parent
20d5f5d71a
commit
39a13d91bb
@ -2099,7 +2099,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
TargetObject := GetPopMenuItemObject;
|
TargetObject := GetPopMenuItemObject;
|
||||||
// Check if the menu was the maximized icon menu for an MDI child window and ignore it in that case
|
// Check if the menu was the maximized icon menu for an MDI child window and ignore it in that case
|
||||||
if (LoWord(LParam)=0) and (lWinControl=Application.MainForm) and (Application.MainForm.FormStyle=fsMDIForm) then
|
if (LoWord(LParam)=0) and (lWinControl=Application.MainForm) and
|
||||||
|
Assigned(Application.MainForm) and (Application.MainForm.FormStyle=fsMDIForm) then
|
||||||
begin
|
begin
|
||||||
MaximizedActiveChild := False;
|
MaximizedActiveChild := False;
|
||||||
if SendMessage(Win32WidgetSet.MDIClientHandle, WM_MDIGETACTIVE, 0, Windows.WPARAM(@MaximizedActiveChild)) <> 0 then
|
if SendMessage(Win32WidgetSet.MDIClientHandle, WM_MDIGETACTIVE, 0, Windows.WPARAM(@MaximizedActiveChild)) <> 0 then
|
||||||
@ -2121,7 +2122,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
TargetObject := GetMenuItemObject((HIWORD(Integer(WParam)) and MF_POPUP) <> 0);
|
TargetObject := GetMenuItemObject((HIWORD(Integer(WParam)) and MF_POPUP) <> 0);
|
||||||
// Check if the menu was the maximized icon menu for an MDI child window and ignore it in that case
|
// Check if the menu was the maximized icon menu for an MDI child window and ignore it in that case
|
||||||
if (LoWord(Integer(WParam))=0) and (lWinControl=Application.MainForm) and (Application.MainForm.FormStyle=fsMDIForm) then
|
if (LoWord(Integer(WParam))=0) and (lWinControl=Application.MainForm) and
|
||||||
|
Assigned(Application.MainForm) and (Application.MainForm.FormStyle=fsMDIForm) then
|
||||||
begin
|
begin
|
||||||
MaximizedActiveChild := False;
|
MaximizedActiveChild := False;
|
||||||
if SendMessage(Win32WidgetSet.MDIClientHandle, WM_MDIGETACTIVE, 0, Windows.WPARAM(@MaximizedActiveChild)) <> 0 then
|
if SendMessage(Win32WidgetSet.MDIClientHandle, WM_MDIGETACTIVE, 0, Windows.WPARAM(@MaximizedActiveChild)) <> 0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user