:D Hello everyone,

I am making a program where the user types in a string and then the string is saved to the clipboard, but I am not quite sure how. I have had a look at http://www.cplusplus.com/forum/beginner/33250/ but I am not quite sure how to implement this.

I would greatly appreciate any help offered because I am a beginner.

Thanks,
Muhasaresa

You need to Windows API to work with these functions, and #include "Windows.h". The reference for these functions is located here.

Be sure to check the return value of OpenClipboard(). If it returns a zero (false) it failed, otherwise, if it returns a non-zero (true) it succeeded. If it returns false, another program likely has access to it, so you should wait briefly and try again.

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.