Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Globally detect windows context menu popup [modified]

Globally detect windows context menu popup [modified]

Scheduled Pinned Locked Moved Windows Forms
comquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrewVos
    wrote on last edited by
    #1

    Anyone have any ideas how I could go about detecting any windows context menu while it's popping up? Is there any message I can register for, that you may have heard about? Just to be certain, I'm not trying to hook all context menus in my application, I'm trying to hook all menus globally.


    www.wickedorange.com www.andrewvos.com

    modified on Friday, March 7, 2008 5:23 AM

    G 1 Reply Last reply
    0
    • A AndrewVos

      Anyone have any ideas how I could go about detecting any windows context menu while it's popping up? Is there any message I can register for, that you may have heard about? Just to be certain, I'm not trying to hook all context menus in my application, I'm trying to hook all menus globally.


      www.wickedorange.com www.andrewvos.com

      modified on Friday, March 7, 2008 5:23 AM

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      I don't know whether it can be done or not but if it can I guess you will need global hooks.

      #region signature my articles #endregion

      A 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        I don't know whether it can be done or not but if it can I guess you will need global hooks.

        #region signature my articles #endregion

        A Offline
        A Offline
        AndrewVos
        wrote on last edited by
        #3

        Okay, SetWinEventHook does what I need. Now I just need to get a handle to the context menu. FindWindow("#32768", NULL) seems to get the temporary pointer assigned to the menu, not the actual HMENU. Any ideas now? :)


        www.wickedorange.com www.andrewvos.com

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups