Why do I need to save handle to an old bitmap while drawing with Win32 GDI?
问题 Here is the code from switch in WndProc function I've been given as an example: case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // Create a system memory device context. bmHDC = CreateCompatibleDC(hdc); // Hook up the bitmap to the bmHDC. oldBM = (HBITMAP)SelectObject(bmHDC, ghBitMap); // Now copy the pixels from the bitmap bmHDC has selected // to the pixels from the client area hdc has selected. BitBlt( hdc, // Destination DC. 0, // 'left' coordinate of destination rectangle. 0, // 'top'