<?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[GetWindowRect liefert negative Werte]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie oben gesagt hab ich da ein Problem mit GetWindowRect<br />
Ich erzeug mir ein Handle fuer ein Fenster</p>
<p>hwnd = CreateWindow(&quot;msg_test&quot;,&quot;test&quot;, WS_OVERLAPPEDWINDOW |<br />
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,<br />
CW_USEDEFAULT, CW_USEDEFAULT,<br />
CW_USEDEFAULT, CW_USEDEFAULT,<br />
NULL, NULL, hInstance, NULL);</p>
<p>if (!hwnd) return 1;</p>
<p>danach will ich im Callback die position ermitteln<br />
RECT rect;<br />
.<br />
.<br />
case WM_PAINT:<br />
if (GetWindowRect(hwnd,&amp;rect))<br />
{<br />
sprintf(amsg,&quot;%s,%d,%d,%d,%d&quot;,&quot;WM_SIZE&quot;,rect.left,rect.top,<br />
rect.right,rect.bottom);<br />
fprintf(fptr,&quot;%s&quot;,amsg);<br />
}</p>
<p>und bekomm fuer rect.top einen negativen Wert z.B. -90 obwohl der<br />
sichtlich positiv ist.<br />
Verwende ich anstelle von CW_USEDEFAULT definierte Werte kommen<br />
auch die richtigen Werte zurueck.</p>
<p>OS ist WIN98 mit 2 Bildschirmen dran</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/227357/getwindowrect-liefert-negative-werte</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 10:54:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/227357.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Nov 2008 09:56:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 09:56:20 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie oben gesagt hab ich da ein Problem mit GetWindowRect<br />
Ich erzeug mir ein Handle fuer ein Fenster</p>
<p>hwnd = CreateWindow(&quot;msg_test&quot;,&quot;test&quot;, WS_OVERLAPPEDWINDOW |<br />
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,<br />
CW_USEDEFAULT, CW_USEDEFAULT,<br />
CW_USEDEFAULT, CW_USEDEFAULT,<br />
NULL, NULL, hInstance, NULL);</p>
<p>if (!hwnd) return 1;</p>
<p>danach will ich im Callback die position ermitteln<br />
RECT rect;<br />
.<br />
.<br />
case WM_PAINT:<br />
if (GetWindowRect(hwnd,&amp;rect))<br />
{<br />
sprintf(amsg,&quot;%s,%d,%d,%d,%d&quot;,&quot;WM_SIZE&quot;,rect.left,rect.top,<br />
rect.right,rect.bottom);<br />
fprintf(fptr,&quot;%s&quot;,amsg);<br />
}</p>
<p>und bekomm fuer rect.top einen negativen Wert z.B. -90 obwohl der<br />
sichtlich positiv ist.<br />
Verwende ich anstelle von CW_USEDEFAULT definierte Werte kommen<br />
auch die richtigen Werte zurueck.</p>
<p>OS ist WIN98 mit 2 Bildschirmen dran</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614569</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614569</guid><dc:creator><![CDATA[holger61]]></dc:creator><pubDate>Fri, 14 Nov 2008 09:56:20 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 11:31:12 GMT]]></title><description><![CDATA[<p>Und der zweite Bildschirm ist links, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614606</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614606</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Fri, 14 Nov 2008 11:31:12 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 11:52:00 GMT]]></title><description><![CDATA[<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>Und der zweite Bildschirm ist links, oder?</p>
</blockquote>
<p>Wohl eher oben, wenn top negativ ist, oder? Ich hatte vorhin schon in diese Richtung gedacht, war mir aber nicht sicher, ob das Koordinatensystem sich in einem solchen Fall wirklich am Primary Display orientiert oder vielleicht doch immer so verschoben wird, dass es keine negativen Koordinaten im sichtbaren Bereich gibt...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614613</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614613</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Fri, 14 Nov 2008 11:52:00 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 11:45:20 GMT]]></title><description><![CDATA[<p>Ein negativer rect bedeutet doch im allgemeinen das die &quot;zeichenbare&quot; fläche ausserhalb des sichtbaren bereich ist,...</p>
<p><a href="http://www.win-api.de/tutorials.php?tutid=16" rel="nofollow">http://www.win-api.de/tutorials.php?tutid=16</a> schrieb:</p>
<blockquote>
<p>Die RECT Struktur speichert diesmal nicht die Maße des Fensters, sondern den Bereich, in den der Text gezeichnet werden soll. Wenn also nach unten gescrollt wurde, hat rect.top einen negativen Wert, damit der obere Teil nicht sichtbar ist und der untere zu sehen ist.</p>
</blockquote>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614618</guid><dc:creator><![CDATA[zeusosc]]></dc:creator><pubDate>Fri, 14 Nov 2008 11:45:20 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 11:53:45 GMT]]></title><description><![CDATA[<p>Entschuldigung, ich meinte auch &quot;keine negativen Koordinaten im sichtbaren Bereich&quot; (hab es korrigiert).</p>
<p>Aber hier geht es ja darum, dass ein 2. Monitor (erweiterter Desktop), der über dem Hauptbildschirm liegt, wahrscheinlich im negativen Bereich liegt, da die Koordinate 0,0 eben in der linken, oberen Ecke des Hauptbildschirms ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614620</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Fri, 14 Nov 2008 11:53:45 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 12:39:19 GMT]]></title><description><![CDATA[<p>Jup,..wenn der 2te oberhalb ist könnte das sein,.. gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614634</guid><dc:creator><![CDATA[zeusosc]]></dc:creator><pubDate>Fri, 14 Nov 2008 12:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 14:12:50 GMT]]></title><description><![CDATA[<p>War ausser haus, danke fuer die raschen Antworten.<br />
Also der 2. ist rechts und hab das Prog. auch auf dem 2. gestartet.<br />
Wenn ich es auf dem primaeren starte ist alles normal.<br />
Gruss Holger</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614694</guid><dc:creator><![CDATA[holger61]]></dc:creator><pubDate>Fri, 14 Nov 2008 14:12:50 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowRect liefert negative Werte on Fri, 14 Nov 2008 14:14:56 GMT]]></title><description><![CDATA[<p>noch ein Nachtrag<br />
Der primaere hat 1280 x 1024<br />
Der sekundaere 1024 x 768</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1614697</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1614697</guid><dc:creator><![CDATA[holger61]]></dc:creator><pubDate>Fri, 14 Nov 2008 14:14:56 GMT</pubDate></item></channel></rss>