made many changes. got it working. you need to look up wm_paint.
i moved bitmap to see if it display. put back where you want.
let see if .zip attaches.
edit will not allow zip "invalid file type"
Code:
under case wm-creat at end
// Load the bitmap from the resource
bmpExercising = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_EXERCISING));
under wm-paint
BITMAP bm;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
// Load the bitmap from the resource
// bmpExercising = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_EXERCISING));
// Create a memory device compatible with the above DC variable
HDC MemDCExercising = CreateCompatibleDC(hdc);
// Select the new bitmap
HBITMAP hbmOld = SelectObject(MemDCExercising, bmpExercising);
GetObject(bmpExercising, sizeof(bm), &bm);
// Copy the bits from the memory DC into the current dc
BitBlt(hdc, 20, 20, bm.bmWidth, bm.bmHeight, MemDCExercising, 0, 0, SRCCOPY);
// Restore the old bitmap
SelectObject(MemDCExercising, hbmOld);
DeleteDC(MemDCExercising);
// DeleteObject(bmpExercising);
EndPaint(hwnd, &ps);
}
break;
also added hbitmap
Code:
const char g_szClassName[] = "myWindowClass";
HINSTANCE hInstance;
HBITMAP bmpExercising = NULL;
LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
// HDC hDC, MemDCExercising;
// PAINTSTRUCT Ps;
// HBITMAP bmpExercising;