Changing dialog box picture control image
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement