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. C#
  4. How to handle Window Context Menu events ?

How to handle Window Context Menu events ?

Scheduled Pinned Locked Moved C#
helptutorialquestion
4 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.
  • S Offline
    S Offline
    sherwani
    wrote on last edited by
    #1

    Hello! I have wrote a code in which i m trying to hide the Notification icon when i click on the context menu (which pops on that icon). BUt in this manner two events fire. One which is my event written in the code(which works according to my requirement) and other is the Windows own event, which is Taskbar Popup menu. which always seems bad. if i call any messagebox after that fired events, the windows event hide but i don't want to show message box. Please help me.

    C 2 Replies Last reply
    0
    • S sherwani

      Hello! I have wrote a code in which i m trying to hide the Notification icon when i click on the context menu (which pops on that icon). BUt in this manner two events fire. One which is my event written in the code(which works according to my requirement) and other is the Windows own event, which is Taskbar Popup menu. which always seems bad. if i call any messagebox after that fired events, the windows event hide but i don't want to show message box. Please help me.

      C Offline
      C Offline
      CoolASL
      wrote on last edited by
      #2

      Hi, Sorry to disappoint you, but i wanted to ask my own question in this. Are you able to detect when the user is clicking on the window in the taskbar? Actually, i have made a program in which i have made the FormBorderStyle as None. This prevents the system menu to appear when i click on the window in the taskbar. So, i wanted to figure out a way in which i could detect a click on the taskbar window and display the menu manually. Please let me know, if you happen to know about this. Thanks in advance. *** Who said nothing is impossible? I have been doing it for a long time ***

      S 1 Reply Last reply
      0
      • C CoolASL

        Hi, Sorry to disappoint you, but i wanted to ask my own question in this. Are you able to detect when the user is clicking on the window in the taskbar? Actually, i have made a program in which i have made the FormBorderStyle as None. This prevents the system menu to appear when i click on the window in the taskbar. So, i wanted to figure out a way in which i could detect a click on the taskbar window and display the menu manually. Please let me know, if you happen to know about this. Thanks in advance. *** Who said nothing is impossible? I have been doing it for a long time ***

        S Offline
        S Offline
        sherwani
        wrote on last edited by
        #3

        NO idea about that!

        1 Reply Last reply
        0
        • S sherwani

          Hello! I have wrote a code in which i m trying to hide the Notification icon when i click on the context menu (which pops on that icon). BUt in this manner two events fire. One which is my event written in the code(which works according to my requirement) and other is the Windows own event, which is Taskbar Popup menu. which always seems bad. if i call any messagebox after that fired events, the windows event hide but i don't want to show message box. Please help me.

          C Offline
          C Offline
          CoolASL
          wrote on last edited by
          #4

          I think, i am getting your problem. See, when you pop-up the message box, the event is still being fired and it still shows the taskbar menu too, but the message box removes the focus and hence makes the taskbar menu disappear. Secondly, the fact that the taskbar menu is appearing shows that you are able to hide the icon successfully, but somehow another event is being generated which is being sent again. I am not sure about how this is happening, but i guess, you can refer to this article[^] for more details. Also, i hope, you are using the NotifyIcon control. It saves a lot of time. I hope this helps. *** Who said nothing is impossible? I have been doing it for a long time ***

          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