Hi, I have a dialog box I designed with a "Picture Control" that has a picture in it. I want to know if there is a function or a message that will change what image is in the control. Is this possible?
Printable View
Hi, I have a dialog box I designed with a "Picture Control" that has a picture in it. I want to know if there is a function or a message that will change what image is in the control. Is this possible?
Depending on what kind of control that is, you can look it up in the help.
Usually pictures are displayed in static controls. You can set the image of a static control with the STM_SETIMAGE message.
would something like this work?
SendMessage(hwnd,STM_SETIMAGE,IDC_IMAGE,IDB_MYIMAGE);
No, this would work:
SendDlgItemMessage(hDlg, IDC_IMAGE, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap);
You get the hBitmap from a previous call to LoadImage or LoadBitmap or other functions that return a HBITMAP.
ah thank you very much :)