<?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[Pixel eines Fensters an bestimmter Position]]></title><description><![CDATA[<p>Hallihallo Gemeinde,<br />
Bin schon ganz verzweifelt auf der Suche nach einer passenden Lösung<br />
für mein Problem. Und zwar will ich die Farbe eines bestimmten Pixels<br />
an einer bestimmten Position ermitteln.</p>
<p>Hier der Text:</p>
<pre><code class="language-cpp">int main()
{
  HWND myhwnd = FindWindowA(NULL, &quot;AB CD&quot;);
  if (IsWindow(myhwnd) != FALSE)
  {
    HDC mydc = GetDC(myhwnd);
    COLORREF color = GetPixel(mydc, 747, 617);
    cout &lt;&lt; color;
  }
  system (&quot;Pause&quot;);
  return 0;
}
</code></pre>
<p>Das Problem ist folgendes:<br />
Die Ausgabe ist jedes mal 4294967295, egal welche Koordinaten ich angebe.<br />
Da er ja etwas ausgibt muss er das Fenster doch gefunden haben, oder?</p>
<p>Ich weiß im Moment gar nicht mehr weiter.</p>
<p>PS: Muss das Fenster aktiv oder eingeblendet sein (denn es ist minimiert) ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/213820/pixel-eines-fensters-an-bestimmter-position</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 09:52:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/213820.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 May 2008 14:06:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 14:07:15 GMT]]></title><description><![CDATA[<p>Hallihallo Gemeinde,<br />
Bin schon ganz verzweifelt auf der Suche nach einer passenden Lösung<br />
für mein Problem. Und zwar will ich die Farbe eines bestimmten Pixels<br />
an einer bestimmten Position ermitteln.</p>
<p>Hier der Text:</p>
<pre><code class="language-cpp">int main()
{
  HWND myhwnd = FindWindowA(NULL, &quot;AB CD&quot;);
  if (IsWindow(myhwnd) != FALSE)
  {
    HDC mydc = GetDC(myhwnd);
    COLORREF color = GetPixel(mydc, 747, 617);
    cout &lt;&lt; color;
  }
  system (&quot;Pause&quot;);
  return 0;
}
</code></pre>
<p>Das Problem ist folgendes:<br />
Die Ausgabe ist jedes mal 4294967295, egal welche Koordinaten ich angebe.<br />
Da er ja etwas ausgibt muss er das Fenster doch gefunden haben, oder?</p>
<p>Ich weiß im Moment gar nicht mehr weiter.</p>
<p>PS: Muss das Fenster aktiv oder eingeblendet sein (denn es ist minimiert) ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514338</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514338</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 14:07:15 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 15:13:06 GMT]]></title><description><![CDATA[<p>Habe vergessen das Fenster vorher mit</p>
<pre><code class="language-cpp">ShowWindow(myhwnd, SW_SHOW);
</code></pre>
<p>wieder aufpoppen zu lassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514385</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 15:13:06 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 15:58:06 GMT]]></title><description><![CDATA[<p>ok, scheint doch noch nicht so ganz zu funktionieren...<br />
kann es sein, dass getpixel für bestimmte bereiche immer den gleichen wert zurueckgibt ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514409</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 15:58:06 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 16:47:53 GMT]]></title><description><![CDATA[<p>habe grad geschaut wie groß COLORREF maximal ist, nämlich: 4294967295</p>
<p>kann es sein... dass der Wert außerhalb der für COLORREF bestimmten Range von<br />
-2147483648 bis +2147483647 liegt ?</p>
<p>Achja diese Zahl taucht aber nur auf für einen bestimmten Bereich innerhalb des Fensters myhwnd, andere bereiche lassen sich einwandfrei auslesen. Woran kann das liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514439</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514439</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 16:47:53 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 16:58:12 GMT]]></title><description><![CDATA[<p>The return value is the RGB value of the pixel. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514447</guid><dc:creator><![CDATA[Wilhelm]]></dc:creator><pubDate>Thu, 22 May 2008 16:58:12 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 17:31:52 GMT]]></title><description><![CDATA[<p>Hm... sieht wohl os aus, als würde ich hängenbleiben...<br />
Ähm gibts irgendwie ne Möglichkeit vom kompletten Screen ein Bild zu erzeugen und dann davon an selbiger Position die Pixelfarbe abzulesen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514476</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 17:31:52 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 18:16:33 GMT]]></title><description><![CDATA[<p>So konnte dank Schritt-für-Schritt rausfinden, wo genau der Fehler liegt.</p>
<p>Also es liegt an der y-Koordinate...<br />
für werte &lt; 600 (z.B.: 599) funktioniert GetPixel<br />
für werte &gt;= 600 bekomm ich wieder 4294967295...</p>
<p>Ich überlege grad ob es mit dem Fenster zusammenhängen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514519</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 18:16:33 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 18:20:48 GMT]]></title><description><![CDATA[<p>If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514522</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514522</guid><dc:creator><![CDATA[Wilhelm]]></dc:creator><pubDate>Thu, 22 May 2008 18:20:48 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 18:34:45 GMT]]></title><description><![CDATA[<p>At which point the clipping region will be set?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514530</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514530</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 18:34:45 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 18:46:01 GMT]]></title><description><![CDATA[<p>If the pixel is inside the current clipping region as defined by the device context.</p>
<p>sincerely,<br />
Wilhelm</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514541</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514541</guid><dc:creator><![CDATA[Wilhelm]]></dc:creator><pubDate>Thu, 22 May 2008 18:46:01 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 18:48:13 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514545</guid><dc:creator><![CDATA[Melkfett]]></dc:creator><pubDate>Thu, 22 May 2008 18:48:13 GMT</pubDate></item><item><title><![CDATA[Reply to Pixel eines Fensters an bestimmter Position on Thu, 22 May 2008 19:09:46 GMT]]></title><description><![CDATA[<p>alles klar, habs eben selbst rausgefunden...<br />
Habe Zeile</p>
<pre><code>HDC mydc = GetDC(myhwnd);
</code></pre>
<p>durch</p>
<pre><code>HDC mydc = GetWindowDC(myhwnd);
</code></pre>
<p>ersetzt.</p>
<p>Special THX to Wilhelm for his endurance <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1514577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1514577</guid><dc:creator><![CDATA[Quellcode]]></dc:creator><pubDate>Thu, 22 May 2008 19:09:46 GMT</pubDate></item></channel></rss>