I am using one program to monitor the keyboard for input but would like to use that same program to populate the clipboard then automatically paste to the cursor location of the other program? Can this be done... I am using Delphi 4 Pro.
A:
Send the target window a wm_Paste
message.
But only put data on the clipboard if the user has told you to. The clipboard is something that should always be under control of the user, or else you run the risk of clobbering other data the user was already storing there.
Rob Kennedy
2010-03-19 18:39:37
I am a little new to sending a windows message but that is exactly what I want to do... And it will be the user who loads and controls this using assigned keys. I just want to make the Ctrl+V automatic. Thanks... if you have a quick example I can use it.
Roy
2010-03-19 18:52:58
+2
A:
It's possible, but this is very poor design. The clipboard is provided for the benefit and use of the user, not the programmer. You will end up trashing pre-existing clipboard data. It is not possible to 100% faithfully and reliably cache the clipboard contents and restore it later. That said, you can send Ctrl+V keystrokes or WM_Paste messages to the other window.
Chris Thornton
2010-03-19 18:46:04
You are correct but it will be the user who controls the pasted message. I am just trying to short cut the Ctrl+V since it will be know by the keystroke what the user wahts to do. Based on the key combo one program will read from a list and paste based on that list? I hope that makes since. Is there a better way?
Roy
2010-03-19 18:55:58