Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find and close popup menu in Delphi?

I've got an MDI win32 application in Delphi. It has many forms, all of them and their inner components have own popup menus.

After some time when application idles trigger starts and it closes all child windows. But it doesn't close popup menu if it is showing. (For example user clickes right button and leaved computer -the popup menu should be closed also when trigger starts.)

GetWindow function doesn't find the popup menu.

How to find the popup menu and close it?

like image 684
Mikhail Kopylov Avatar asked Oct 08 '13 05:10

Mikhail Kopylov


1 Answers

SendMessage(PopupList.Window, WM_CANCELMODE, 0, 0);

The global Menus.PopupList object manages the window that handles all messages for VCL popup menus in the application.

like image 52
kot-da-vinci Avatar answered Nov 06 '22 09:11

kot-da-vinci