Sign in to follow this  

Changing dialog box picture control image

Recommended Posts

I'm working on a front-end to my game compilers. I've created a dialog box which shows the progress of each compiler. When each compiler completes, I would like to display a picture (a .bmp image) next the name of the compiler. The dialog is working fine, except I can't get the image to display. I've created two bitmap images (a green check and a red X) to indicate the success or failure of the compiler step. They are imported as resources and given ID numbers. They are loaded as a pair of CBitMap objects: RC = OkBmp.LoadBitmap(IDB_BITMAP1); RC = FailBmp.LoadBitmap(IDB_BITMAP2); The return code says they loaded successfully. In my dialog handler, I have a function which is supposed to change the image (for example display the checkmark): void SetCheck ( ) { SendMessage(_hWnd, STM_SETIMAGE, SS_BITMAP, IDB_BITMAP1 ); } I know the 4th parameter is wrong and needs to be a handle. But I don't know how to get the appropriate handle from the CBitMap object to feed into SendMessage(). I imagine it's something simple. Could someone throw me a hint?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this