MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / StatusCalcPaneWidth

Function StatusCalcPaneWidth

src/Helpers.c:767–779  ·  view source on GitHub ↗

============================================================================= StatusCalcPaneWidth()

Source from the content-addressed store, hash-verified

765// StatusCalcPaneWidth()
766//
767int 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//=============================================================================

Callers 1

MsgSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected