Original Post
case WM_PAINT:
PAINTSTRUCT ps;
HDC dc = BeginPaint(Handle, &ps);
BYTE* bits;
BITMAPINFO bi;
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bi.bmiHeader.biWidth = 800;
bi.bmiHeader.biHeight = 800;
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 32;
bi.bmiHeader.biCompression = BI_RGB;
bi.bmiHeader.biSizeImage = 0;
bi.bmiHeader.biXPelsPerMeter = 0;
bi.bmiHeader.biYPelsPerMeter = 0;
bi.bmiHeader.biClrUsed = 0;
bi.bmiHeader.biClrImportant = 0;
// bi.bmiColors = NULL;
HBITMAP bmp = CreateDIBSection(dc, &bi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
HDC ddc = CreateCompatibleDC(GetDC(Handle));
SelectObject(ddc, bmp);
for(int y = 0; y < 800; y++)
{
for(int x = 0; x < 800; x += 4)
{
*(bits + (y * (800)) + x) = 255;
*(bits + (y * (800)) + x + 1) = 0;
*(bits + (y * (800)) + x + 2) = 255;
}
BitBlt(GetDC(Handle), 0, 0, 800, 800, ddc, 0, 0, SRCCOPY);
EndPaint(Handle, &ps);