Hi,

I wonder how it would be possible to pass a String to the clipboard.
If you normally select a textstring in for example WordPad and press Ctrl-C, you copy this string to the Memory/Clipboard so you can Ctrl-V that text somewhere else.

I wonder how that would be possible to do programatically for ex this string ?

String^ copyString = "CopyThisString";

Don't know if there is a managed code to do it or not, but here is how to do it with normal win32 api functions.

Yes, I think I did figure it out using this code wich seems to work:

String^ getText = "getString";
Clipboard::SetText(getText );

Don't know if there is a managed code to do it or not, but here is how to do it with normal win32 api functions.

Clipboard::SetDataObject(copyString); See this

EDIT: Beaten again by AD ^^^^

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.