<?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[Schrift fett machen, ist diese Funktion ok?]]></title><description><![CDATA[<p>Hallo Leute</p>
<p>ich habe mir eine kleine Funktion geschrieben um die Schriftdicke von Fenstertexten zu verändern. Die Funktion funktioniert so weit, leider bin ich mir nicht sicher ob ich in Bezug auf etwaige memoryleaks alles richtig programmiert habe. Kennt sich da jemand aus? Hier meine Funktion:</p>
<pre><code class="language-cpp">void ChangeFontWeight(HWND hWnd, long new_lfWeight){

	HFONT	old_font, new_font;
	LOGFONT	tmp_logfont;
	RECT	rect;

	memset(&amp;old_font, 0, sizeof(HFONT));
	memset(&amp;new_font, 0, sizeof(HFONT));
	memset(&amp;tmp_logfont, 0, sizeof(LOGFONT));

	old_font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);
	GetObject(old_font, sizeof(LOGFONT), (PTSTR)&amp;tmp_logfont);
	tmp_logfont.lfWeight = new_lfWeight;
	new_font = CreateFontIndirect(&amp;tmp_logfont);
	SendMessage(hWnd, WM_SETFONT, (WPARAM)Font_Temp, 0);
	GetClientRect(hWnd, &amp;rect);
	InvalidateRect(hWnd, &amp;rect, TRUE);
	DeleteObject(old_font);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/201422/schrift-fett-machen-ist-diese-funktion-ok</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 05:33:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/201422.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Dec 2007 18:33:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schrift fett machen, ist diese Funktion ok? on Sat, 29 Dec 2007 18:33:34 GMT]]></title><description><![CDATA[<p>Hallo Leute</p>
<p>ich habe mir eine kleine Funktion geschrieben um die Schriftdicke von Fenstertexten zu verändern. Die Funktion funktioniert so weit, leider bin ich mir nicht sicher ob ich in Bezug auf etwaige memoryleaks alles richtig programmiert habe. Kennt sich da jemand aus? Hier meine Funktion:</p>
<pre><code class="language-cpp">void ChangeFontWeight(HWND hWnd, long new_lfWeight){

	HFONT	old_font, new_font;
	LOGFONT	tmp_logfont;
	RECT	rect;

	memset(&amp;old_font, 0, sizeof(HFONT));
	memset(&amp;new_font, 0, sizeof(HFONT));
	memset(&amp;tmp_logfont, 0, sizeof(LOGFONT));

	old_font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);
	GetObject(old_font, sizeof(LOGFONT), (PTSTR)&amp;tmp_logfont);
	tmp_logfont.lfWeight = new_lfWeight;
	new_font = CreateFontIndirect(&amp;tmp_logfont);
	SendMessage(hWnd, WM_SETFONT, (WPARAM)Font_Temp, 0);
	GetClientRect(hWnd, &amp;rect);
	InvalidateRect(hWnd, &amp;rect, TRUE);
	DeleteObject(old_font);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1427752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1427752</guid><dc:creator><![CDATA[Hans Dumpf]]></dc:creator><pubDate>Sat, 29 Dec 2007 18:33:34 GMT</pubDate></item><item><title><![CDATA[Reply to Schrift fett machen, ist diese Funktion ok? on Sat, 29 Dec 2007 18:35:48 GMT]]></title><description><![CDATA[<p>muss natürlich</p>
<pre><code class="language-cpp">SendMessage(hWnd, WM_SETFONT, (WPARAM)new_font, 0);
</code></pre>
<p>heissen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1427754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1427754</guid><dc:creator><![CDATA[Hans Dumpf]]></dc:creator><pubDate>Sat, 29 Dec 2007 18:35:48 GMT</pubDate></item></channel></rss>