|
-
June 15th, 1999, 10:25 PM
#1
What is handle??????
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
-
June 15th, 1999, 10:42 PM
#2
Re: What is handle??????
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.
-
June 16th, 1999, 01:34 AM
#3
Re: What is handle??????
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));
-
June 16th, 1999, 01:44 AM
#4
Re: What is handle??????
Sorry, it should be HBITMAP not HANDLE.
YourButtonControl.SetBitmap(HBITMAP(m_CBitmap));
-
June 16th, 1999, 03:40 AM
#5
Re: What is handle??????
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|