Code:
in WM_CREATE
int dice = 1000;
for (i = 0; i < 6; i++)
{
dice1[i] = LoadBitmap(g_hInst, MAKEINTRESOURCE(dice));
OR
dice1[i] = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(dice), IMAGE_BITMAP, 64, 64, 0);
if (dice1[i] == NULL)
MessageBox(NULL, "Could not load the Dice", "Error", MB_OK | MB_ICONERROR);
++dice;
}
dieA = CreateWindowEx(0, TEXT("STATIC"), TEXT(""), WS_VISIBLE | WS_CHILD | SS_BITMAP | SS_CENTERIMAGE,
34, 20, 64, 64, hwnd, (HMENU)ID_CONTAINER1, g_hInst, NULL);
SendMessage(dieA, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)dice1);
OR
dieA = CreateWindowEx(0, TEXT("STATIC"), TEXT("#dice1"), WS_VISIBLE | WS_CHILD | SS_BITMAP | SS_CENTERIMAGE,
34, 20, 64, 64, hwnd, (HMENU)ID_CONTAINER1, g_hInst, NULL);
in WM_PAINT
BITMAP bm1;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
HDC hdcMem1 = CreateCompatibleDC(hdc);
HBITMAP hbmOld1 = SelectObject(hdcMem1, dice1[dieOne]);
GetObject(dice1[dieOne], sizeof(bm1), &bm1);
SelectObject(hdcMem1, hbmOld1);
DeleteDC(hdcMem1);
EndPaint(hwnd, &ps);
?