<?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[Programmfenster beim Start zentrieren]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich mein Programmfenster (MDI) beim Start zentrieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162194/programmfenster-beim-start-zentrieren</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 20:57:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162194.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Oct 2006 08:57:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programmfenster beim Start zentrieren on Mon, 16 Oct 2006 08:57:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich mein Programmfenster (MDI) beim Start zentrieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155491</guid><dc:creator><![CDATA[AnTri]]></dc:creator><pubDate>Mon, 16 Oct 2006 08:57:18 GMT</pubDate></item><item><title><![CDATA[Reply to Programmfenster beim Start zentrieren on Mon, 16 Oct 2006 09:01:52 GMT]]></title><description><![CDATA[<p>Bei ner SDI geht das so:</p>
<pre><code class="language-cpp">BOOL CMainFrame::PreCreateWindow(CREATESTRUCT&amp; cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// ZU ERLEDIGEN: Ändern Sie hier die Fensterklasse oder das Erscheinungsbild, indem Sie
	//  CREATESTRUCT cs modifizieren.

	CClientDC dc(NULL);
	int nRealXRes = dc.GetDeviceCaps(HORZRES);
	int nRealYRes = dc.GetDeviceCaps(VERTRES);
		cs.style = WS_OVERLAPPED | WS_CAPTION | WS_MINIMIZEBOX //| WS_MAXIMIZEBOX //| FWS_ADDTOTITLE
			| WS_SYSMENU;

		// Fenstergröße festlegen
		cs.cx = X_RES;
		cs.cy = Y_RES;

		// Auflösung holen und Fenstergröße abziehen
		int nXRes = dc.GetDeviceCaps(HORZRES) - X_RES;
		int nYRes = dc.GetDeviceCaps(VERTRES) - Y_RES;
		// Immer schön mittig bitte...
		cs.x  = nXRes / 2;
		cs.y  = nYRes / 2;

	return TRUE;
}
</code></pre>
<p>X_RES ist 1024 und Y_RES = 168, kannste aber frei wählen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155500</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Mon, 16 Oct 2006 09:01:52 GMT</pubDate></item></channel></rss>