============================================================================= StatusCalcPaneWidth()
| 765 | // StatusCalcPaneWidth() |
| 766 | // |
| 767 | int StatusCalcPaneWidth ( HWND hwnd, LPCWSTR lpsz ) |
| 768 | { |
| 769 | SIZE size; |
| 770 | HDC hdc = GetDC ( hwnd ); |
| 771 | HFONT hfont = ( HFONT ) SendMessage ( hwnd, WM_GETFONT, 0, 0 ); |
| 772 | HFONT hfold = SelectObject ( hdc, hfont ); |
| 773 | int mmode = SetMapMode ( hdc, MM_TEXT ); |
| 774 | GetTextExtentPoint32 ( hdc, lpsz, lstrlen ( lpsz ), &size ); |
| 775 | SetMapMode ( hdc, mmode ); |
| 776 | SelectObject ( hdc, hfold ); |
| 777 | ReleaseDC ( hwnd, hdc ); |
| 778 | return ( size.cx + 9 ); |
| 779 | } |
| 780 | |
| 781 | |
| 782 | //============================================================================= |