Win32. Get string from pasteboard.

closed account (2NywAqkS)
Using OpenGl, I've created my own edit box. However, it would be nice if the user could paste into the edit box. I'll be fine at setting up an CTRL + V event the problem will be getting a char array from the pasteboard. I've looked around and the internet a bit and it wasn't as simple as I'd thought.

Any help is much appreciated!
Thanks,
Rowan.
It's straightforward.

The clipboard can store data in a number of formats, you'll probably be interested initially in CF_TEXT. Tou can call EnumClipboardFormats() to get the formats that are in the clipboard. when you request the data with GetClipboardData(), you need to specify a format that's there. So just ignore it if CF_TEXT isn't there.

I found this sample clipboard viewer pn MSDN:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms649016%28v=vs.85%29.aspx#_win32_Example_of_a_Clipboard_Viewer
Topic archived. No new replies allowed.