Paste text into console
SPONSORED LINKS
I’m trying to paste a string into win32 cmd console for which I have the window handle. My issue is I can’t send a sequence of keys with WM_KEYDOWN/CHAR/UP SendMessage()s and the console won’t respond to a WM_PASTE. I’ve got the data into a global buffer on the clipboard (shows up in the MS Word viewer), but I’m not sure how to paste it into the console.
I’d like to be able to do my usual SetWindowLong(GWL_WNDPROC) to figure out the messages sent to the console when I r-click and say ‘Paste’ from the pop-up menu, but a GetWindowLong(GWL_WNDPROC) returns 0 and any SetWindowHookEx()s never get any info. I assume the cmd console has some funky msgproc system, but I don’t know it. I unfortunately am using Vis Studio Express and don’t have access to Spy++ *cry*
If anyone does have Spy++ and can post the sequence of msgs sent to a command prompt when they do a pop-up menu Paste, I’d really appreciate. Or some less clunky solution.
Thanks in advance for your help.
sulu
Read the original:
Paste text into console