Click to See Complete Forum and Search --> : What is handle??????
ctyuang
June 15th, 1999, 10:25 PM
Im trying to put a bitmap onto my button. However, one of the function I use needs a parameter that is "handle" type, which is the bitmap's handle.
Now, my question is, what is the handle of the bitmap. I have a bitmap file named "flower.bmp", its ID is IDB_FLOWER, but what is its handle??????
smebody pls help me
ty
suri
June 15th, 1999, 10:42 PM
Construct CBitmapButton class. Then Call Create function and then call LoadBitmap() function to put bitmap on a button. See CBitmapButton overview to check out how to put a bitmap on a button. Its self explanatory.
MRidwan
June 16th, 1999, 01:34 AM
First you have to create an CBitmap object, then load the bitmap source to this CBitmap and then load this CBitmap to your CButton. Like this
CBitmap m_CBitmap;
m_CBitmap.LoadBitmap(IDB_FLOWER);
YourButtonControl.SetBitmap(HANDLE(m_CBitmap));
MRidwan
June 16th, 1999, 01:44 AM
Sorry, it should be HBITMAP not HANDLE.
YourButtonControl.SetBitmap(HBITMAP(m_CBitmap));
ric
June 16th, 1999, 03:40 AM
operator HBITMAP( ) const;
Return Value
If successful, a handle to the Windows GDI object represented by the CBitmap object; otherwise NULL.
Remarks
Use 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.
Use like this:
HBITMAP handle;
handle = (HBITMAP)my_bitmap;
or just (HBITMAP)my_bitmap;
Regards,
ric
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.