c# Catching rightmouseclick (application independent)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cappamontana
    New Member
    • Sep 2007
    • 21

    c# Catching rightmouseclick (application independent)

    Hi everyone,

    I want to build a solution that is listening to rightmouseclick s of a selected text (application independent). Once clicked there should appear something similar to "Cut" or "Copy" ("Analyze text"-in my case-) in the menu.
    I want to catch the action (menu item clicked) and the selected text and do something with it and than show a messagebox or something.

    Does somebody know how to do this?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Well context menus were built to do just that, so you could use one of those.
    You could also put an event handler on the mouse click event.

    Comment

    • Cappamontana
      New Member
      • Sep 2007
      • 21

      #3
      Originally posted by Plater
      Well context menus were built to do just that, so you could use one of those.
      You could also put an event handler on the mouse click event.
      Ok, but I want to access the context menu from outside my application. So, lets say that someone using my application right clicks on a selected text in some application (Internet Explorer, or Word), I want to put my menu item in that context menu.
      Is that possible?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Hmm, yes because I have installed programs that do just that. I don't think it possible to do it without using win32 API (I think there is some registry business there too)
        I do know that the SendTo-> menu is rather easy to get your program in though.

        But yes, for custom functionality I think you need to look up win32 api codes for it.

        Comment

        Working...