How can I get a HBITMAP structure from a bitmap?

What I'm trying to do is make it so a CButton object has a bitmap instead of text on it. When I looked up the documentation it says to use the CButton::SetBitmap function it passes in a HBITMAP structure
so the function declarion looks like this
HBITMAP CButtonSetBitmap( HBITMAP hBitmap );

however I have looked for a while on how to get a HBITMAP structure but i can't figure it out, I can get a BITMAP structure but not a HBITMAP structure

please help me out


Comments

  • How do you have your bitmaps loaded and stored?

    Easiest way to do that is to use LoadBitmap (or LoadImage if you want to load from a disk file). Both return an HBITMAP.

    : What I'm trying to do is make it so a CButton object has a bitmap instead of text on it. When I looked up the documentation it says to use the CButton::SetBitmap function it passes in a HBITMAP structure
    : so the function declarion looks like this
    : HBITMAP CButtonSetBitmap( HBITMAP hBitmap );
    :
    : however I have looked for a while on how to get a HBITMAP structure but i can't figure it out, I can get a BITMAP structure but not a HBITMAP structure
    :
    : please help me out
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion