<?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[WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ?]]></title><description><![CDATA[<p>hi, ich habe folgendes problem:</p>
<p>ich habe eine dll geschrieben, die einen cbthook in einen fremdem prozess installiert. weiterhin eine detour für DrawText und ExtTextOut installiert um den text der fenster dieses prozesses auszulesen.</p>
<p>hier ist meine detouring-funktion für ExtTextOut:</p>
<pre><code>int WINAPI Mine_ExtTextOut(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT* lprc,LPCTSTR lpString,UINT cbCount,CONST INT* lpDx) {

	int rv = Real_ExtTextOut(hdc,X,Y,fuOptions,lprc,lpString,cbCount,lpDx);

    HWND hwnd = WindowFromDC(hdc);

.
.
.
</code></pre>
<p>das problem ist nun, dass WindowFromDC(hdc) den wert NULL zurückgibt, was<br />
wohl daran liegt, dass es sich um einen in-memory-DC handelt, wie ich mithilfe von google herausgefunden habe (GetObjectType() liefert für hwnd OBJ_MEMDC zurück).</p>
<p>hat jemand eine idee wie ich denoch an das handle für das fenster herankomme ?<br />
oder an die globalen koordinaten wo der text gezeichnet wird ?</p>
<p>vielen dank</p>
<p>gruß<br />
paule</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/221923/windowfromdc-hdc-gleich-null-wie-bekomme-ich-dennoch-das-hwnd</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 21:32:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/221923.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Sep 2008 02:32:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Fri, 05 Sep 2008 02:32:35 GMT]]></title><description><![CDATA[<p>hi, ich habe folgendes problem:</p>
<p>ich habe eine dll geschrieben, die einen cbthook in einen fremdem prozess installiert. weiterhin eine detour für DrawText und ExtTextOut installiert um den text der fenster dieses prozesses auszulesen.</p>
<p>hier ist meine detouring-funktion für ExtTextOut:</p>
<pre><code>int WINAPI Mine_ExtTextOut(HDC hdc,int X,int Y,UINT fuOptions,CONST RECT* lprc,LPCTSTR lpString,UINT cbCount,CONST INT* lpDx) {

	int rv = Real_ExtTextOut(hdc,X,Y,fuOptions,lprc,lpString,cbCount,lpDx);

    HWND hwnd = WindowFromDC(hdc);

.
.
.
</code></pre>
<p>das problem ist nun, dass WindowFromDC(hdc) den wert NULL zurückgibt, was<br />
wohl daran liegt, dass es sich um einen in-memory-DC handelt, wie ich mithilfe von google herausgefunden habe (GetObjectType() liefert für hwnd OBJ_MEMDC zurück).</p>
<p>hat jemand eine idee wie ich denoch an das handle für das fenster herankomme ?<br />
oder an die globalen koordinaten wo der text gezeichnet wird ?</p>
<p>vielen dank</p>
<p>gruß<br />
paule</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576863</guid><dc:creator><![CDATA[paule33]]></dc:creator><pubDate>Fri, 05 Sep 2008 02:32:35 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Fri, 05 Sep 2008 06:15:51 GMT]]></title><description><![CDATA[<p>wenn man einen hook installiert, bekommt die hook-proc nicht immer den hwnd als parameter mit?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576887</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Fri, 05 Sep 2008 06:15:51 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Fri, 05 Sep 2008 06:23:16 GMT]]></title><description><![CDATA[<p>Seit wann muss ein DC mit einem Fenbster zusammenhängen. Man beliebige DCs erzeugen, die mit keinem Fenster zusammenhängen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576895</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 05 Sep 2008 06:23:16 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Fri, 05 Sep 2008 12:15:37 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/19908">@vlad_tepesch</a>: ja , aber ich brauch diese information in der detouring funktion</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35992">@martin</a>: richtig ... aber mann muss doch irgendwo an die information herankommen können, wo der text gezeichnet wird ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577096</guid><dc:creator><![CDATA[paule33]]></dc:creator><pubDate>Fri, 05 Sep 2008 12:15:37 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Fri, 05 Sep 2008 13:41:17 GMT]]></title><description><![CDATA[<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35992">@martin</a>: richtig ... aber mann muss doch irgendwo an die information herankommen können, wo der text gezeichnet wird ...</p>
</blockquote>
<p>und wenn er nicht gezeichnet wird, weils ein memory dc ist und das ergebnis in ein bitmap gespeichert wird?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577159</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Fri, 05 Sep 2008 13:41:17 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Fri, 05 Sep 2008 14:13:07 GMT]]></title><description><![CDATA[<p>er wird gezeichnet , ich seh es auf meinen bildschirm</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577173</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577173</guid><dc:creator><![CDATA[paule33]]></dc:creator><pubDate>Fri, 05 Sep 2008 14:13:07 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Sat, 06 Sep 2008 07:04:37 GMT]]></title><description><![CDATA[<p>Nein! Er wird evtl. erst in einen MemoryDC gezeichnet und anschließend mit einer BitBlt Operation auf den Bildschirm kopiert!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577391</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 06 Sep 2008 07:04:37 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Sun, 07 Sep 2008 04:38:41 GMT]]></title><description><![CDATA[<p>ahso, ok, also gibt es keinen weg festzustellen wo es auf den bildschirm hinkopiert wird ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577905</guid><dc:creator><![CDATA[paule33]]></dc:creator><pubDate>Sun, 07 Sep 2008 04:38:41 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Sun, 07 Sep 2008 09:19:08 GMT]]></title><description><![CDATA[<p>nö</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577958</guid><dc:creator><![CDATA[asdca]]></dc:creator><pubDate>Sun, 07 Sep 2008 09:19:08 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Sun, 07 Sep 2008 10:11:26 GMT]]></title><description><![CDATA[<p>doch in dem du BitBlt hookst</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577980</guid><dc:creator><![CDATA[ön]]></dc:creator><pubDate>Sun, 07 Sep 2008 10:11:26 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Sun, 07 Sep 2008 10:13:16 GMT]]></title><description><![CDATA[<p>nö das prog benutzt BitBlt ned.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577982</guid><dc:creator><![CDATA[asdca]]></dc:creator><pubDate>Sun, 07 Sep 2008 10:13:16 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Sun, 07 Sep 2008 10:32:09 GMT]]></title><description><![CDATA[<p>er hat gar nicht gesagt um welche programm es sich handelt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577988</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577988</guid><dc:creator><![CDATA[ön]]></dc:creator><pubDate>Sun, 07 Sep 2008 10:32:09 GMT</pubDate></item><item><title><![CDATA[Reply to WindowFromDC(hdc) gleich NULL .. wie bekomme ich dennoch das HWND ? on Sun, 07 Sep 2008 11:04:03 GMT]]></title><description><![CDATA[<p>doch, ich habs getestet und es wird massig benutzt ... danke erstmal für die hilfe/tips <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577998</guid><dc:creator><![CDATA[paule33]]></dc:creator><pubDate>Sun, 07 Sep 2008 11:04:03 GMT</pubDate></item></channel></rss>