Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Toolbar popup context menu: How to capture event - 'ToolNotClick'?

Toolbar popup context menu

I have the following:
1) 'UltraWinTree'.
2) right click 'PopupMenuTool'.

I want to capture an event when user does not left-click on popup menu (also equivalent to pressing 'esc' key).

(some function like: 'ToolNotClick' even in 'PopupMenuTool'or any way to do that).

I have one solution below (not good solution, but works. I am looking for proper solution.)
step 1: Have a class variable: bool iNotClicked.
step 2: _AfterToolCloseup(){ iNotClicked = false;}
step 3: _ToolClick() {iNotClicked = true;}

Assumption: _ToolClick() is always called before _AfterToolCloseup() which though I do not know is alway true or not. Please correct me on this assumption.
So if user does not click on popup menu then only _AfterToolCloseup() is called else both function are called i.e. first _AfterToolCloseup() and then _ToolClick(). It works thougt not a good way.

  • 467410
    Offline posted

    There is no other way to do it. There is no event that fires explicitly when the PopupMenu closes and no tool has been clicked.

    I know of no program in Windows that performs an action when a popup menu is cancelled, though. So this seems like an odd thing to want to trap.