CBitmap已经重载了HBITMAP操作,可以直接用CBitmap::operator HBITMAP operator HBITMAP( ) const;Return ValueIf successful, a handle to the Windows GDI object represented by the CBitmap object; otherwise NULL.ResUse this operator to get the attached Windows GDI handle of the CBitmap object. This operator is a casting operator, which supports direct use of an HBITMAP object.For more information about using graphic objects, see Graphic Objects in the Win32 Programmer's Reference.
HBITMAP hBmp;
hBmp = (HBITMAP)bmp;
bitmap.GetBitmap(&hbitmap);
operator HBITMAP( ) const;Return ValueIf successful, a handle to the Windows GDI object represented by the CBitmap object; otherwise NULL.ResUse this operator to get the attached Windows GDI handle of the CBitmap object. This operator is a casting operator, which supports direct use of an HBITMAP object.For more information about using graphic objects, see Graphic Objects in the Win32 Programmer's Reference.
HBITMAP hBmp;
hBmp = (HBITMAP)bmp;
就可以了,如果你愿意用
BITMAP hbitmap;
bitmap.GetBitmap(&hbitmap);
也没有错。