<?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[Problem mit Fensterpositionierung]]></title><description><![CDATA[<p>Hallo Leute.</p>
<p>Folgendermassen positioniere ich mein Fenster:</p>
<pre><code>CRect myRect, desktop;
GetDesktopWindow()-&gt;GetWindowRect(&amp;desktop);
GetWindowRect(&amp;myRect);
MoveWindow(0, (desktop.Height()/2) - (myRect.Height()/2), myRect.Width(), myRect.Height());
</code></pre>
<p>Nun möchte ich folgendes:<br />
Wenn ich mit der Maus mein Fenster z.b. nach links bewege und den Bereich unter 50 Pixel erreiche, soll das Fenster automatisch an den Linken Rand positioniert werden.</p>
<p>also so:</p>
<pre><code>CRect myRect, desktop;
GetDesktopWindow()-&gt;GetWindowRect(&amp;desktop);
GetWindowRect(&amp;myRect);
if (blablablabla &lt;= 50) 
MoveWindow(0, (desktop.Height()/2) - (myRect.Height()/2), myRect.Width(), myRect.Height());
</code></pre>
<p>Ich bekomm das nicht hin.</p>
<p>Kann mir einer helfen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/177865/problem-mit-fensterpositionierung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 12:05:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177865.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Apr 2007 18:39:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Fensterpositionierung on Wed, 04 Apr 2007 18:44:35 GMT]]></title><description><![CDATA[<p>Hallo Leute.</p>
<p>Folgendermassen positioniere ich mein Fenster:</p>
<pre><code>CRect myRect, desktop;
GetDesktopWindow()-&gt;GetWindowRect(&amp;desktop);
GetWindowRect(&amp;myRect);
MoveWindow(0, (desktop.Height()/2) - (myRect.Height()/2), myRect.Width(), myRect.Height());
</code></pre>
<p>Nun möchte ich folgendes:<br />
Wenn ich mit der Maus mein Fenster z.b. nach links bewege und den Bereich unter 50 Pixel erreiche, soll das Fenster automatisch an den Linken Rand positioniert werden.</p>
<p>also so:</p>
<pre><code>CRect myRect, desktop;
GetDesktopWindow()-&gt;GetWindowRect(&amp;desktop);
GetWindowRect(&amp;myRect);
if (blablablabla &lt;= 50) 
MoveWindow(0, (desktop.Height()/2) - (myRect.Height()/2), myRect.Width(), myRect.Height());
</code></pre>
<p>Ich bekomm das nicht hin.</p>
<p>Kann mir einer helfen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1259498</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1259498</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 04 Apr 2007 18:44:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Fensterpositionierung on Wed, 04 Apr 2007 19:33:09 GMT]]></title><description><![CDATA[<p>Habs nun fast hinbekommen:</p>
<pre><code>void CTestDlg::OnMoving(UINT fwSide, LPRECT pRect) 
{
	CDialog::OnMoving(fwSide, pRect);

	CRect myRect, desktop;
	GetDesktopWindow()-&gt;GetWindowRect(&amp;desktop);
	GetWindowRect(&amp;myRect);

	if (myRect.left &lt; (desktop.left+50)) 

	MoveWindow(0, myRect.top, myRect.Width(), myRect.Height());
}
</code></pre>
<p>nach dem loslassen der maus springt das fenster jedoch in die ursprüngliche position</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1259526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1259526</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 04 Apr 2007 19:33:09 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Fensterpositionierung on Wed, 04 Apr 2007 20:33:52 GMT]]></title><description><![CDATA[<p>ok ich habs OnMoving war falsch. OnMove richtig.</p>
<p>es ist zwar noch nicht gantz sauber, da es flackert, wenn ich meinen dialog innerhalb der 50 pixel links bewege. aber es läuft schon mal- evtl. hat einer nen besseren code für mich ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1259562</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1259562</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 04 Apr 2007 20:33:52 GMT</pubDate></item></channel></rss>