GetClipboardData(CF_TEXT)
How to use GetClipboardData(CF_TEXT); without calling and use process id of this in C++? and which libary does GetClipboardData(CF_TEXT) belong to? GetClipboardData() is a Win32 API function. The handle returned by GetClipboardData() must be first locked with GlobalLock() , then you can retrieve the char* pointer of the ANSI text in the clipboard (note that if you want to retrieve Unicode text, you should use the CF_UNICODETEXT format ). A sample code to retrieve the text from the clipboard and store it in a convenient std::string class instance follows (error management omitted for simplicity