<?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[Aus einem HWND die HINST bekommen?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ist es möglich hinterher aus einer Variable vom Typ HWND die HINST der Anwendung zu bekommen?<br />
Da die instance ja zum window handle hinzugefügt wird, könnte ich mir vorstellen, dass das irgendwie geht.</p>
<p>Oder täusche ich mich da? Danke für eure Hilfe <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/topic/194250/aus-einem-hwnd-die-hinst-bekommen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 04:32:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/194250.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Oct 2007 14:25:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Thu, 04 Oct 2007 14:25:39 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ist es möglich hinterher aus einer Variable vom Typ HWND die HINST der Anwendung zu bekommen?<br />
Da die instance ja zum window handle hinzugefügt wird, könnte ich mir vorstellen, dass das irgendwie geht.</p>
<p>Oder täusche ich mich da? Danke für eure Hilfe <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/1377956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377956</guid><dc:creator><![CDATA[uhiehf]]></dc:creator><pubDate>Thu, 04 Oct 2007 14:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Thu, 04 Oct 2007 14:41:55 GMT]]></title><description><![CDATA[<p>Was bezweckst Du damit? Die HINSTNACE ist etwas rein Prozess internes.</p>
<p>Ansonsten GetWindowLong mit GWL_HINSTANCE!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1377973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377973</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 04 Oct 2007 14:41:55 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Thu, 04 Oct 2007 15:16:15 GMT]]></title><description><![CDATA[<p>Zm Thema was ich damit bezwecke:</p>
<p>Ich arbeite mit DirectX und habe eine abstrake Device-klasse, die im Konstruktor ein HWND bekommen muss und diverse Methoden um dieses HWND bereit hält.</p>
<p>Jetzt gehts im DirectInput,da brauche ich die HINST, und da ich würde ungerne das DEsign ändern, sondern lieber aus dem HWND irgendwie die HINST bekommen <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/1377999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1377999</guid><dc:creator><![CDATA[oisfhidsg]]></dc:creator><pubDate>Thu, 04 Oct 2007 15:16:15 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Thu, 04 Oct 2007 18:33:23 GMT]]></title><description><![CDATA[<p>Wenn es sich um Deinen eigenen Prozess handelt. Dann bekomst Du dieses hInstance direkt in Deinem WinMain angegeben. Also musst Du es Dir nur merken.<br />
Zur Not kann man immer GteModuleFileHandle verwenden..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378120</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378120</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 04 Oct 2007 18:33:23 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 08:54:13 GMT]]></title><description><![CDATA[<p>Die GetWindowLong-Variante ist schon ganz cool, nur bekomme ich immer folgende Warnung:</p>
<blockquote>
<p>warning C4312: 'Typumwandlung': Konvertierung von 'LONG' in größeren Typ 'HINSTANCE'</p>
</blockquote>
<pre><code class="language-cpp">HRESULT hr = DirectInput8Create((HINSTANCE)GetWindowLong(GetWindowHandle(), GWL_HINSTANCE),
				                            DIRECTINPUT_VERSION,
											IID_IDirectInput8,
											(LPVOID*)&amp;ptrDirectInput, 0);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1378376</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378376</guid><dc:creator><![CDATA[gfhgfh]]></dc:creator><pubDate>Fri, 05 Oct 2007 08:54:13 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 09:28:55 GMT]]></title><description><![CDATA[<p>Das ist nur eine Warnung wegen möglichen Problemen, wenn Du die Anwendung als 64-Bit compilierst.<br />
Du solltest anstelle &quot;GetWindowLong&quot; die neue Funktion GetWindowLongPtr verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378406</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Fri, 05 Oct 2007 09:28:55 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 09:57:57 GMT]]></title><description><![CDATA[<p>kann ich die warnung denn nicht irgendwie unterdrücken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378445</guid><dc:creator><![CDATA[fghg]]></dc:creator><pubDate>Fri, 05 Oct 2007 09:57:57 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 10:14:33 GMT]]></title><description><![CDATA[<p>ich weiß nicht ob das geht, aber wenn dann irgendwie über &quot;proprietäre Compileranweisungen&quot; wie #pragma, oder in den compilereinstellungen...<br />
Aber dann werden AFAIK alle Nachrichten unterdrückt...</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378460</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378460</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Fri, 05 Oct 2007 10:14:33 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 10:23:25 GMT]]></title><description><![CDATA[<p>fghg schrieb:</p>
<blockquote>
<p>kann ich die warnung denn nicht irgendwie unterdrücken?</p>
</blockquote>
<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>Du solltest anstelle &quot;GetWindowLong&quot; die neue Funktion GetWindowLongPtr verwenden.</p>
</blockquote>
<pre><code class="language-cpp">#pragma warning(disable:4244)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1378468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378468</guid><dc:creator><![CDATA[delicious]]></dc:creator><pubDate>Fri, 05 Oct 2007 10:23:25 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 10:47:15 GMT]]></title><description><![CDATA[<p>Nicht die Option /Wp64 im Projket setzen ist sicherlich besser als ein pragma sie zu unterdrücken.</p>
<p>Project Settings -&gt; C/C++ -&gt; General -&gt; Detect 64bit portability issues</p>
<p>EDIT_ Bleibt die Frage warum Du Dir es überhaupt holst und nicht selbst aus der WinMain bestimmst. Der dynamische Weg ist überflüssig und die hInstance meistens sowieso etwas was man immer wieder braucht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378483</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378483</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 05 Oct 2007 10:47:15 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 10:51:20 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Nicht die Option /Wp64 im Projket setzen ist sicherlich besser als ein pragma sie zu unterdrücken.</p>
<p>Project Settings -&gt; C/C++ -&gt; General -&gt; Detect 64bit portability issues</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /><br />
warum? weil ms nicht fähig ist eine GetWindowLongPtr zu liefern, die mit den standardeinstellungen keine warnung verursacht?</p>
<pre><code class="language-cpp">#pragma warning(push)
#pragma warning(disable:4244)
GetWindowLongPtr(...)
#pragma warning(pop)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1378487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378487</guid><dc:creator><![CDATA[!d&#x27;accord]]></dc:creator><pubDate>Fri, 05 Oct 2007 10:51:20 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 11:31:31 GMT]]></title><description><![CDATA[<p>!d'accord schrieb:</p>
<blockquote>
<p>warum? weil ms nicht fähig ist eine GetWindowLongPtr zu liefern, die mit den standardeinstellungen keine warnung verursacht?</p>
</blockquote>
<p>Keine Warnung:</p>
<pre><code class="language-cpp">LONG_PTR nTmp	= GetWindowLongPtr(hWnd,GWL_HINSTANCE);
HINSTANCE hInst	= *((HINSTANCE*)&amp;nTmp);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1378528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378528</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Fri, 05 Oct 2007 11:31:31 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 11:45:42 GMT]]></title><description><![CDATA[<p>SilentRob schrieb:</p>
<blockquote>
<p>Keine Warnung:</p>
<pre><code class="language-cpp">LONG_PTR nTmp	= GetWindowLongPtr(hWnd,GWL_HINSTANCE);
HINSTANCE hInst	= *((HINSTANCE*)&amp;nTmp);
</code></pre>
</blockquote>
<p>ok, habs mit SetWindowLongPtr verwechselt. so ists ja noch viel besser, dann muss man ja gar nix ändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378538</guid><dc:creator><![CDATA[!d&#x27;accord]]></dc:creator><pubDate>Fri, 05 Oct 2007 11:45:42 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 11:58:01 GMT]]></title><description><![CDATA[<p>ja, leider war MS nicht fähig dazu... (bei SetWindowLongPtr)<br />
nicht mal in VS2005 ist es behoben... auch nicht im PSDKv6 (Vista, was neueres hab ich nicht drauf).<br />
In VS2008B2 ist der gleiche Fehler immer noch drin....<br />
Interessant ist aber, dass per default jetzt &quot;/Wp64&quot; deaktiviert ist, und wenn man es aktiviert kommt die Meldung:</p>
<blockquote>
<p>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1378549</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378549</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Fri, 05 Oct 2007 11:58:01 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 15:05:44 GMT]]></title><description><![CDATA[<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>Interessant ist aber, dass per default jetzt &quot;/Wp64&quot; deaktiviert ist, und wenn man es aktiviert kommt die Meldung:</p>
<blockquote>
<p>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release</p>
</blockquote>
</blockquote>
<p>Hmm eine Idee warum diese Option wieder raus genommen wird? Es wird doch wohl noch einen 32Bit Compiler geben ?! :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378698</guid><dc:creator><![CDATA[yogle]]></dc:creator><pubDate>Fri, 05 Oct 2007 15:05:44 GMT</pubDate></item><item><title><![CDATA[Reply to Aus einem HWND die HINST bekommen? on Fri, 05 Oct 2007 15:08:44 GMT]]></title><description><![CDATA[<p>yogle schrieb:</p>
<blockquote>
<p>Hmm eine Idee warum diese Option wieder raus genommen wird? Es wird doch wohl noch einen 32Bit Compiler geben ?! :p</p>
</blockquote>
<p>Siehe:<br />
<a href="http://blogs.msdn.com/vcblog/archive/2007/08/10/the-future-of-the-c-language.aspx#4421146" rel="nofollow">http://blogs.msdn.com/vcblog/archive/2007/08/10/the-future-of-the-c-language.aspx#4421146</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1378701</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1378701</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Fri, 05 Oct 2007 15:08:44 GMT</pubDate></item></channel></rss>