I have a WPF application which has a tray icon and on right-click displays menu. How I can from an other application (WPF, WinForms, C++) simulate right-click and then click menu?
Asked
Active
Viewed 960 times
2
-
Are you looking for a tutorial? – Quality Catalyst May 09 '16 at 05:51
-
I am trying to find at least the way: how to do it? – ZedZip May 09 '16 at 05:56
-
1Given that C# windows programming does not expose one to the "real working" of windows internals too much and that the problem in itself is non trivial - no downvote here. While I know the first... I would not know how to handle the menu click. http://stackoverflow.com/questions/14250362/finding-and-simulating-a-click-on-a-system-tray-icon has a starting point, but it is not really dealing with the menu side. – TomTom May 09 '16 at 05:58
-
Thank you, your link contains a link to codeproject article. I have tried it but it does not work in Windows 10 – ZedZip May 09 '16 at 06:45
-
1I think you can use this to find the icon: https://github.com/rzhw/SuperNotifyIcon – MrApnea May 09 '16 at 07:29
-
1And then this to make a right click: http://stackoverflow.com/questions/8272681/how-can-i-simulate-a-mouse-click-at-a-certain-position-on-the-screen – MrApnea May 09 '16 at 07:29
1 Answers
1
You must search for Simulate mouse and keyboard events
https://msdn.microsoft.com/en-us/library/ms171548(v=vs.100).aspx
You can track user activity
http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C

mohsen
- 1,763
- 3
- 17
- 55