| 789 | } |
| 790 | |
| 791 | CSize CMessageBox::GetTextSize(const CString& str) |
| 792 | { |
| 793 | CRect rect; |
| 794 | GetWindowRect(&rect); |
| 795 | |
| 796 | CDC * pDC = GetDC(); |
| 797 | |
| 798 | CDC memDC; |
| 799 | CBitmap bitmap; |
| 800 | memDC.CreateCompatibleDC(pDC); |
| 801 | bitmap.CreateCompatibleBitmap(pDC, rect.Width(), rect.Height()); |
| 802 | CBitmap* pOldBitmap = memDC.SelectObject(&bitmap); |
| 803 | |
| 804 | //get the minimum size of the rectangle of the tooltip |
| 805 | CSize sz = DrawText(&memDC, rect, str, m_LogFont, TRUE); |
| 806 | |
| 807 | memDC.SelectObject(pOldBitmap); |
| 808 | memDC.DeleteDC(); |
| 809 | bitmap.DeleteObject(); |
| 810 | |
| 811 | ReleaseDC(pDC); |
| 812 | |
| 813 | return sz; |
| 814 | } |
| 815 | |
| 816 | CSize CMessageBox::GetIconSize(HICON hIcon) |
| 817 | { |
nothing calls this directly
no test coverage detected