is there a way to determine if a context menu is visible or not? or at least detect when it is closed. (it can be closed in many ways)
Printable View
is there a way to determine if a context menu is visible or not? or at least detect when it is closed. (it can be closed in many ways)
how/where is the menu raised from
From local app via ContextMenu.Show method.
I've tried to create a derived class that attempts to provide a PopDown event. However, I have some problems. I'm hooking CBT window messages, but it seems that the menu window is not destroyed, once it's created, until the parent window dies. (I verified this by checking the handles)
It is C# code, but I'm using it in a VB project. I tried creating the class in VB first, but the delegates thing was a bit too tricky for me.
I've got it figured out. I used the WH_CALLWNDPROC hook, and intercepted the WM_CREATE message, and detected if the window class is '#32768'. If so, then I have the handle to the menu window, and then i can detect when the window is destroyed. Here is the results attached. Enjoy!