Hi everyone:
I've come upon a problem when trying to copy a bitmap handle from a window of one process to another. I have a static bitmap control in one app and I am copying its bitmap handle to another using CopyImage API like this:
But resulting HBITMAP is always NULL (although hBitmap is not). What could be the problem? Can CopyImage copy bitmaps from another process? As that seems to be the only culprit.
Thank you in advance...
I've come upon a problem when trying to copy a bitmap handle from a window of one process to another. I have a static bitmap control in one app and I am copying its bitmap handle to another using CopyImage API like this:
Code:
HANDLE hBitmap = (HANDLE)SendMessage(hStaticWnd, STM_GETIMAGE, IMAGE_BITMAP, NULL);
HBITMAP hNewBmp = (HBITMAP)CopyImage(hBitmap, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
But resulting HBITMAP is always NULL (although hBitmap is not). What could be the problem? Can CopyImage copy bitmaps from another process? As that seems to be the only culprit.
Thank you in advance...