Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to infer a clipboard copy/cut/paste.

Status
Not open for further replies.

Chris8852

Programmer
Jan 15, 2003
16
0
0
GB
I'm developing an application where I need to make another application copy/cut/paste to the clipboard.
I didn't think this would work, but I tried it and it didn't...
PostMessage(GetForegroundWindow(),WM_KEYDOWN,'C',NULL);
PostMessage(GetForegroundWindow(),WM_KEYUP,'C',NULL);
WM_COPY paste etc. won't work because that only works for text.
I can use the keybd_event() function but I need a way to do this that won't interfere with the users clipboard.
Thanks for any help.:)
 
I meant a way that wouldn't interfere with the users keyboard... See, if I check to see if the alt or control keys areheld down(I'm using a hotkey here..) and then I put them up(I have to or else I can't invoke a copy/paste etc.) and then I put them back down afterwards, it doesnt work many times(the keys will (virtually)be down when the physical keys are up). If I don't record it and set it, and just don't put the keys back down, then the user would have to let the alt and control keys back up and put them down again, instead of just holding it down...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top