Avatar of Member_2_7966362
Member_2_7966362

asked on 

How to copy an image file into clipboard C/C++?

I need a C++/C code example that demonstrates how to copy a 24-bit bmp picture file on the computer/disk into the clipboard.
I am working with a Visual C++ Win32 console application on Windows 7.
OpenClipboard();
EmptyClipboard();
?
hMem = GlobalAlloc(GMEM_MOVEABLE, ?);
memcpy(GlobalLock(hMem), ?, ?);
GlobalUnlock(hMem);
SetClipboardData(CF_DIB, hMem);
CloseClipboard();

Open in new window

Thanks to anyone that helps.
C++Windows 7Microsoft DevelopmentProgrammingImages and Photos

Avatar of undefined
Last Comment
sarabande

8/22/2022 - Mon