Arreglado, lo dejo por si a alguien le hace falta:
Código PHP:
case WM_SIZE:
GetClientRect(hwnd, &coords); // obtenemos las coordenadas de la ventana
xCenter = ((coords.right - coords.left)/2) - (bm.bmWidth/2);
yCenter = ((coords.bottom - coords.top)/2) - (bm.bmHeight/2);
if(hBitmap){
RepintarImagen(hwnd, hBitmap);
}
break;
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps); //obtiene el contexto de dispositivo de la ventana donde queremos dibujar
BitBlt(hdc, xCenter, yCenter, bm.bmWidth, bm.bmHeight, memDC, 0, 0, SRCCOPY);
EndPaint(hwnd, &ps);
break;
......
void RepintarImagen(HWND hwnd, HBITMAP hBitmap){
HDC tempDC;
if (memDC) {
SelectObject(memDC, memBitmapOld);
DeleteObject(memBitmap);
DeleteObject(memDC);
}
tempDC = GetDC(hwnd);
memDC = CreateCompatibleDC(tempDC);
memBitmapOld = SelectObject(memDC,hBitmap);
StretchBlt(memDC, 0,0, ancho, alto, tempDC, 0, 0, bm.bmWidth,bm.bmHeight,SRCCOPY);
InvalidateRect(hwnd, &coords, TRUE);
ReleaseDC(hwnd,tempDC);
}