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

Function GetThemedDialogFont

src/Helpers.c:1698–1741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1696*/
1697
1698BOOL GetThemedDialogFont ( LPWSTR lpFaceName, WORD *wSize )
1699{
1700 HDC hDC;
1701 int iLogPixelsY;
1702 HMODULE hModUxTheme;
1703 HTHEME hTheme;
1704 LOGFONT lf;
1705 BOOL bSucceed = FALSE;
1706 hDC = GetDC ( NULL );
1707 iLogPixelsY = GetDeviceCaps ( hDC, LOGPIXELSY );
1708 ReleaseDC ( NULL, hDC );
1709 if ( hModUxTheme = GetModuleHandle ( L"uxtheme.dll" ) ) {
1710 if ( ( BOOL ) ( GetProcAddress ( hModUxTheme, "IsAppThemed" ) ) () ) {
1711 hTheme = ( HTHEME ) ( INT_PTR ) ( GetProcAddress ( hModUxTheme, "OpenThemeData" ) ) ( NULL, L"WINDOWSTYLE;WINDOW" );
1712 if ( hTheme ) {
1713 if ( S_OK == ( HRESULT ) ( GetProcAddress ( hModUxTheme, "GetThemeSysFont" ) ) ( hTheme,/*TMT_MSGBOXFONT*/805, &lf ) ) {
1714 if ( lf.lfHeight < 0 ) {
1715 lf.lfHeight = -lf.lfHeight;
1716 }
1717 *wSize = ( WORD ) MulDiv ( lf.lfHeight, 72, iLogPixelsY );
1718 if ( *wSize == 0 ) {
1719 *wSize = 8;
1720 }
1721 StrCpyN ( lpFaceName, lf.lfFaceName, LF_FACESIZE );
1722 bSucceed = TRUE;
1723 }
1724 ( GetProcAddress ( hModUxTheme, "CloseThemeData" ) ) ( hTheme );
1725 }
1726 }
1727 }
1728 /*
1729 if (!bSucceed) {
1730 NONCLIENTMETRICS ncm;
1731 ncm.cbSize = sizeof(NONCLIENTMETRICS);
1732 SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),&ncm,0);
1733 if (ncm.lfMessageFont.lfHeight < 0)
1734 ncm.lfMessageFont.lfHeight = -ncm.lfMessageFont.lfHeight;
1735 *wSize = (WORD)MulDiv(ncm.lfMessageFont.lfHeight,72,iLogPixelsY);
1736 if (*wSize == 0)
1737 *wSize = 8;
1738 StrCpyN(lpFaceName,ncm.lfMessageFont.lfFaceName,LF_FACESIZE);
1739 }*/
1740 return ( bSucceed );
1741}
1742
1743__inline BOOL DialogTemplate_IsDialogEx ( const DLGTEMPLATE *pTemplate )
1744{

Callers 1

LoadThemedDialogTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected