From 3d8cc7c21cb3ba3039a050d047a69b8ab75621c5 Mon Sep 17 00:00:00 2001 From: ondrej Date: Tue, 10 May 2016 19:59:48 +0000 Subject: [PATCH] win32: applied better patch for PM parent from Tomasz Wieckowski. Issue #18624 git-svn-id: trunk@52298 - --- lcl/interfaces/win32/win32wsmenus.pp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/win32/win32wsmenus.pp b/lcl/interfaces/win32/win32wsmenus.pp index 61a74ae790..0e63a3c81b 100644 --- a/lcl/interfaces/win32/win32wsmenus.pp +++ b/lcl/interfaces/win32/win32wsmenus.pp @@ -1579,10 +1579,9 @@ const ); begin MenuHandle := APopupMenu.Handle; - if IsLibrary and (Screen.ActiveCustomForm<>nil) and Screen.ActiveCustomForm.HandleAllocated then - WinHandle:=Screen.ActiveCustomForm.Handle - else - WinHandle:=Win32WidgetSet.AppHandle; + WinHandle:=Win32WidgetSet.AppHandle; + if (WinHandle=0) and (Screen.ActiveCustomForm<>nil) and Screen.ActiveCustomForm.HandleAllocated then + WinHandle:=Screen.ActiveCustomForm.Handle; GetWin32WindowInfo(WinHandle)^.PopupMenu := APopupMenu; TrackPopupMenuEx(MenuHandle, lAlignment[APopupMenu.Alignment, APopupMenu.IsRightToLeft] or lTrackButtons[APopupMenu.TrackButton],