<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SystemDefaultFont?]]></title><description><![CDATA[<p>Hallo Leute,<br />
nochmal rasch etwas zur API?</p>
<p>Ich möchte in meinem Window stets die Texte in der jeweiligen Standardsachriftart des Benuztzers anzeigen lassen. Ich habe auf msdn aber keine Funktion gefunden, die mir das ermöglicht. Die Standardsprache war ganz einfach über GetSystemDefaultLangID herauszubekommen, dachte so etwas gäbe es für alle Einstellungen.</p>
<p>Habt Ihr eine Lösung dafür gesehen bzw. selbst verwendet?</p>
<p>Gruß<br />
AkonF</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/129631/systemdefaultfont</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 14:49:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129631.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Dec 2005 09:54:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SystemDefaultFont? on Thu, 15 Dec 2005 09:54:02 GMT]]></title><description><![CDATA[<p>Hallo Leute,<br />
nochmal rasch etwas zur API?</p>
<p>Ich möchte in meinem Window stets die Texte in der jeweiligen Standardsachriftart des Benuztzers anzeigen lassen. Ich habe auf msdn aber keine Funktion gefunden, die mir das ermöglicht. Die Standardsprache war ganz einfach über GetSystemDefaultLangID herauszubekommen, dachte so etwas gäbe es für alle Einstellungen.</p>
<p>Habt Ihr eine Lösung dafür gesehen bzw. selbst verwendet?</p>
<p>Gruß<br />
AkonF</p>
]]></description><link>https://www.c-plusplus.net/forum/post/942643</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/942643</guid><dc:creator><![CDATA[AkonF]]></dc:creator><pubDate>Thu, 15 Dec 2005 09:54:02 GMT</pubDate></item><item><title><![CDATA[Reply to SystemDefaultFont? on Thu, 15 Dec 2005 10:16:10 GMT]]></title><description><![CDATA[<p>Das ist seit XP nicht mehr so einfach, da hier ja Themes und Styles verwendet werden... aber siehe<br />
<a href="http://msdn.microsoft.com/library/en-us/dnwxp/html/xptheming.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/dnwxp/html/xptheming.asp</a></p>
<p>Ganz grob solltest Du wie folgt vorgehen:</p>
<pre><code class="language-cpp">HTHEME hTheme = NULL;

hTheme = OpenThemeData(hwndButton, L&quot;Button&quot;);
...
DrawMyControl(hDC, hwndButton, hTheme, iState);
...
if (hTheme)
{
    CloseTheme(hTheme);
}

void DrawMyControl(HDC hDC, HWND hwndButton, HTHEME hTheme, int iState)
{
    RECT rc, rcContent;
    TCHAR szButtonText[255];
    HRESULT hr;
    size_t cch;

    GetWindowRect(hwndButton, &amp;rc);
    GetWindowText(hwndButton, szButtonText,
	              (sizeof(szButtonText)/sizeof(szButtonText[0])+1));
	hr = StringCchLength(szButtonText,
         (sizeof(szButtonText)/sizeof(szButtonText[0])), &amp;cch);
    if (hTheme)
    {
        hr = DrawThemeBackground(hTheme, hDC, BP_BUTTON,
                iState, &amp;rc, 0);
        // Always check your result codes.

        hr = GetThemeBackgroundContentRect(hTheme, hDC,
                BP_BUTTON, iState, &amp;rc, &amp;rcContent);
        hr = DrawThemeText(hTheme, hDC, BP_BUTTON, iState,
                szButtonText, cch,
                DT_CENTER | DT_VCENTER | DT_SINGLELINE,
                0, &amp;rcContent);
    }
    else
    {
        // Draw the control without using visual styles.
    }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/942669</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/942669</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 15 Dec 2005 10:16:10 GMT</pubDate></item></channel></rss>