[Solved] C++ Issue | Copy into Clipboard
#1

Hey.

I got a small issue: I'm working on a Cpp program and I'm wanting to copy a string into the clipboard, so that you can paste it manually by pressing ctrl+v. I know here are many good programers, so i hope i will get a sollution for this. i've been searching on ****** for a long time now, without success. Would be nice if anybody could tell me how it works.

Greetz, DeathOnaStick
Reply
#2

I presume you mean Windows, right? I've found a working example after two minutes of searching, just ****** for 'Win32 API Copy to Keyboard C++', etc.
Reply
#3

Sorry for that i didnt find it by myself, but i got an error anyway. I pasted the following code:

pawn Код:
HANDLE SetClipboardData(
 __in UINT uFormat,
 __in HANDLE hMem
);
And in line
pawn Код:
__in UINT uFormat,
it says:
Код:
parse error before "UFormat"
Sorry if im just stupid, but i dont become ideas out of this error. :/

Thanks so far.

#Edit#: Btw, if it matters, i'm using it as a console and not a windows-default-window.
Reply
#4

That's the syntax.

Here is a example that copies "Hello World!" to your clipboard: http://pastebin.org/139168
Reply
#5

Quote:
Originally Posted by Killerkid.
That's the syntax.

Here is a example that copies "Hello World!" to your clipboard: http://pastebin.org/139168
Thank you very much, this extremely helped me out!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)