| 481 | } |
| 482 | |
| 483 | void |
| 484 | mswin_status_window_size(HWND hWnd, LPSIZE sz) |
| 485 | { |
| 486 | RECT rt; |
| 487 | |
| 488 | GetClientRect(hWnd, &rt); |
| 489 | |
| 490 | PNHStatusWindow data = (PNHStatusWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA); |
| 491 | if (data) { |
| 492 | HDC hdc = GetDC(hWnd); |
| 493 | cached_font * font = mswin_get_font(NHW_STATUS, ATR_NONE, hdc, FALSE); |
| 494 | HGDIOBJ saveFont = SelectObject(hdc, font->hFont); |
| 495 | |
| 496 | SIZE text_sz; |
| 497 | GetTextExtentPoint32(hdc, _T("W"), 1, &text_sz); |
| 498 | |
| 499 | TEXTMETRIC tm; |
| 500 | GetTextMetrics(hdc, &tm); |
| 501 | |
| 502 | rt.bottom = rt.top + text_sz.cy * NHSW_LINES; |
| 503 | |
| 504 | SelectObject(hdc, saveFont); |
| 505 | ReleaseDC(hWnd, hdc); |
| 506 | } |
| 507 | AdjustWindowRect(&rt, GetWindowLong(hWnd, GWL_STYLE), FALSE); |
| 508 | sz->cx = rt.right - rt.left; |
| 509 | sz->cy = rt.bottom - rt.top; |
| 510 | } |
no test coverage detected