Check this patch out:
diff --git a/lcl/interfaces/win32/win32object.inc b/lcl/interfaces/win32/win32object.inc
index 7a0aeb1..83f20dc 100644
--- a/lcl/interfaces/win32/win32object.inc
+++ b/lcl/interfaces/win32/win32object.inc
@@ -146,10 +146,11 @@ begin
end;
+ // Create parent of all windows, 'button on taskbar'
+ CreateAppHandle;
+
if not IsLibrary then
begin
- // Create parent of all windows, 'button on taskbar'
- CreateAppHandle;
// set nice main icon
AIcon := Windows.LoadIcon(MainInstance, 'MAINICON');
AppSetIcon(AIcon, AIcon);
Open LCL package and find file win32object.inc in it. Open that file and navigate to line 151. Move CreateAppHandle outside of if-clause.
Recompile your project and test if popupmenu works correctly.
Are you by change creating forms inside your DLL? Which version of Lazarus you are using? Please give full version info.