April 16th, 1999, 01:19 PM
Hi,
I can't seem to capture my desktop screen and copy it into the clipboard.
When I look at the clipboard the image is totally garbled (black & blue stripes).
Can someone please point out to me what I'm doing wrong or show me
a better way of doing this? I did the following:
<ccode>
HBITMAP hBitmap;
OpenClipboard(hwin); // hwin is my window handle
HDC hDCSrc = GetDC(NULL); // get entire window device context
hBitmap = CreateCompatibleBitmap((HDC) hDCSrc, 640, 480);
SetClipboardData(CF_BITMAP, hBitmap);
ReleaseDC(NULL, hDCSrc);
CloseClipboard();
</ccode>
I can't seem to capture my desktop screen and copy it into the clipboard.
When I look at the clipboard the image is totally garbled (black & blue stripes).
Can someone please point out to me what I'm doing wrong or show me
a better way of doing this? I did the following:
<ccode>
HBITMAP hBitmap;
OpenClipboard(hwin); // hwin is my window handle
HDC hDCSrc = GetDC(NULL); // get entire window device context
hBitmap = CreateCompatibleBitmap((HDC) hDCSrc, 640, 480);
SetClipboardData(CF_BITMAP, hBitmap);
ReleaseDC(NULL, hDCSrc);
CloseClipboard();
</ccode>