Delphi Pop Up Visibility Menu

Is there a way in Delphi 7 to find out if a pop-up menu is displayed (shown on the screen) or not, because it does not have the Visible property.

+4
source share
2 answers

You can make your own flag by setting it in the OnPopup event. The problem is that when the popup menu is closed. Peter Below has a solution for this.

But I ask, why do you need this? There may be a better way to solve the underlying problem.

+4
source

This seems a bit easier (I used Delphi 2007):

In the WM_CONTEXTMENU message handler, a pop-up menu will appear before calling the inherited handler, you can set your flag. After calling the inherited popup menu has been closed, reset your flag.

procedure TForm1.WMContextMenu(var Message: TWMContextMenu); begin FPopupActive := True; try OutputDebugString(PChar(Format('popup opening', []))); inherited; finally FPopupActive := False; OutputDebugString(PChar(Format('popup closed', []))); end; end; 
+2
source

Source: https://habr.com/ru/post/1277203/


All Articles