Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CopyImage and/or HBITMAP from another process

Status
Not open for further replies.

dc2000

Programmer
Jun 7, 2005
48
US
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:

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...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top