diff options
| author | nyamatongwe <unknown> | 2005-07-22 13:24:40 +0000 |
|---|---|---|
| committer | nyamatongwe <unknown> | 2005-07-22 13:24:40 +0000 |
| commit | f919cc6c0dd6bbb114256f4d80a4205ef8c63122 (patch) | |
| tree | 3ebe7054af4b6e7f439dfb607d450a0eaedd3f0e /win32/PlatWin.cxx | |
| parent | 2065f65ab75293447f095492abad1990d0978527 (diff) | |
| download | scintilla-mirror-f919cc6c0dd6bbb114256f4d80a4205ef8c63122.tar.gz | |
Ensure DCs are emptied of non-stock, non-default objects before they are
released to keep BoundsChecker happy.
Diffstat (limited to 'win32/PlatWin.cxx')
| -rw-r--r-- | win32/PlatWin.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index c902104fd..c59ac388b 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1543,7 +1543,7 @@ void ListBoxX::Paint(HDC hDC) { Point extent = GetClientExtent(); HBITMAP hBitmap = ::CreateCompatibleBitmap(hDC, extent.x, extent.y); HDC bitmapDC = ::CreateCompatibleDC(hDC); - SelectBitmap(bitmapDC, hBitmap); + HBITMAP hBitmapOld = SelectBitmap(bitmapDC, hBitmap); // The list background is mainly erased during painting, but can be a small // unpainted area when at the end of a non-integrally sized list with a // vertical scroll bar @@ -1552,6 +1552,9 @@ void ListBoxX::Paint(HDC hDC) { // Paint the entire client area and vertical scrollbar ::SendMessage(lb, WM_PRINT, reinterpret_cast<WPARAM>(bitmapDC), PRF_CLIENT|PRF_NONCLIENT); ::BitBlt(hDC, 0, 0, extent.x, extent.y, bitmapDC, 0, 0, SRCCOPY); + // Select a stock brush to prevent warnings from BoundsChecker + ::SelectObject(bitmapDC, GetStockFont(WHITE_BRUSH)); + SelectBitmap(bitmapDC, hBitmapOld); ::DeleteDC(bitmapDC); ::DeleteObject(hBitmap); } |
