ステータスバーのペインの幅調整
void AdjustStatusBarPane(CCmdUI *pCmdUI, LPCTSTR pText) { CStatusBar* pBar = (CStatusBar*)pCmdUI->m_pOther; UINT nID, nStyle; int cxWidth; pBar->GetPaneInfo(pCmdUI->m_nIndex, nID, nStyle, cxWidth); CDC* pDC = pBar->GetDC(); CFont *pOldFont = pDC->SelectObject(pBar->GetFont()); CSize size = pDC->GetTextExtent(pText); pDC->SelectObject(pOldFont); pBar->ReleaseDC(pDC); pBar->SetPaneInfo(pCmdUI->m_nIndex, nID, nStyle, size.cx); }
| 固定リンク

