実行と終了を繰り返すと、OSがフリーズします。怪しい部分を書きます。
このソースでのブラシの使い方で問題点があったら指摘してください。

 case WM_RBUTTONDOWN:

  hDC = GetDC(hWnd);

  hBrush = CreateSolidBrush(255);
  rect.left = 10;
  rect.top = 10;
  FillRect(hDC, &rect, hBrush);
  DeleteObject(hBrush);

  hBrush = CreateSolidBrush(128);
  rect.left = 20;
  rect.top = 20;
  FillRect(hDC, &rect, hBrush);
  DeleteObject(hBrush);

  ReleaseDC(hWnd, hDC);

 break;