void CCandidateWindow::_OnPaint(_In_ HDC dcHandle, _In_ PAINTSTRUCT *pPaintStruct) { SetBkMode(dcHandle, TRANSPARENT); HFONT hFontOld = (HFONT)SelectObject(dcHandle, Global::defaultlFontHandle); FillRect(dcHandle, &pPaintStruct->rcPaint, _brshBkColor); UINT currentPageIndex = 0; UINT currentPage = _CandidateIndexToPageNumber(_currentSelection); _DrawList(dcHandle, _PageNumberToCandidateIndex(currentPage), &pPaintStruct->rcPaint); SelectObject(dcHandle, hFontOld); }
void CCandidateWindow::_OnPaint(_In_ HDC dcHandle, _In_ PAINTSTRUCT *pPaintStruct) { SetBkMode(dcHandle, TRANSPARENT); HFONT hFontOld = (HFONT)SelectObject(dcHandle, Global::defaultlFontHandle); FillRect(dcHandle, &pPaintStruct->rcPaint, _brshBkColor); UINT currentPageIndex = 0; UINT currentPage = 0; if (FAILED(_GetCurrentPage(¤tPage))) { goto cleanup; } _AdjustPageIndex(currentPage, currentPageIndex); _DrawList(dcHandle, currentPageIndex, &pPaintStruct->rcPaint); cleanup: SelectObject(dcHandle, hFontOld); }