Results 1 to 4 of 4

Thread: context menu *RESOLVED!*

  1. #1

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266

    context menu *RESOLVED!*

    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)
    Last edited by jovton; Apr 19th, 2004 at 03:11 PM.
    jovton

  2. #2
    Frenzied Member dis1411's Avatar
    Join Date
    Mar 2001
    Posts
    1,048
    how/where is the menu raised from

  3. #3

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266
    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.
    Attached Files Attached Files
    Last edited by jovton; Apr 19th, 2004 at 04:18 PM.
    jovton

  4. #4

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266
    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!
    Attached Files Attached Files
    Last edited by jovton; Apr 19th, 2004 at 04:19 PM.
    jovton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width