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.