开发者

capture text when Ctrl + C in c#

开发者 https://www.devze.com 2023-03-23 04:14 出处:网络
Is it possible to while ru开发者_开发技巧nning an .Net application in the system tray that when a person presses control + c in a text outside, the application capture it from Clipboard?The easiest wa

Is it possible to while ru开发者_开发技巧nning an .Net application in the system tray that when a person presses control + c in a text outside, the application capture it from Clipboard?


The easiest way is to monitor the contents of the clipboard, this MSDN Article should get you started.

Something as simple as a Timer object which checks if the contents has changed should be more than sufficient.


You could just run a timer and have it check the clipboard contents on tick. This way you would capture even if the user right click -> copy.


Use the Register Hot Key function at a system level, or Global System Hooks http://www.codeproject.com/KB/system/globalsystemhook.aspx

AutoHotKey is an free application that basically does this http://www.autohotkey.com/ if you are looking for an easy solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消