c# - Programming multiple custom Clipboard, using windows Clipboard - few complications -


I am trying to create a C # background app that supports keyboard keystrokes (like CAPS + (A / B / C / ...)) to act as a copy of many different clipboards.

First of all, I searched for a Windows method that would work as CTRL + V: Paste the full string directly. I tried SendInputs to "paste" besides, executing the wrong idea Took a lot of time to do. As I did not find any stuff, I decided to use the Windows clipboard.

Scenario (when I do CAPS + A)

  • Retrieve the contents of the clipboard to restore it later
  • CTL + C
  • Get the contents of the clipboard and set it to a variable corresponding to 'a' key
  • Set the clipboard to default Cached values

This works fine when I'm on Notepad, but I get an exception at step 3 when CTRL + C is executed on another app (for exactly 5 seconds, clipboard on my app

My questions: - Is there a way to send a signal to Windows to "paste" some text that works like CTRL + V without using the Windows clipboard? - Is there any way to force the clipboard to return to your application within 5 seconds? - Do I miss a smart scenario?

Thank you! Take a look at

To block the key first of all:

  [DllImport ("user32.dll")] Public stable extern int GetAsyncKeyState (long vKey);  

VK_CONTROL = 0x11
VK_SHIFT = 0x10
C key = 0x43

Function returns an integer value> 0 If any key is pressed < / P>


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -