<?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[Resource aus fremder Datei(exe, dll) laden?!]]></title><description><![CDATA[<p>Hallo,<br />
ich hoffe mal das meine Frage hier richtig ist.</p>
<p>Wie kann ich die Resourcen aus einer fremden .exe oder .dll Datei auslesen (z.B. Bitmaps, Icons, etc.)?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/71280/resource-aus-fremder-datei-exe-dll-laden</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 17:19:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/71280.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Apr 2004 17:08:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Resource aus fremder Datei(exe, dll) laden?! on Fri, 16 Apr 2004 17:08:21 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich hoffe mal das meine Frage hier richtig ist.</p>
<p>Wie kann ich die Resourcen aus einer fremden .exe oder .dll Datei auslesen (z.B. Bitmaps, Icons, etc.)?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502830</guid><dc:creator><![CDATA[TheDeath]]></dc:creator><pubDate>Fri, 16 Apr 2004 17:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Resource aus fremder Datei(exe, dll) laden?! on Fri, 16 Apr 2004 18:35:57 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>also 1. ja, du bist hier richtig<br />
2. wenns dir zu hoch ist, sag bescheid</p>
<p>also grundsätzlich gesagt: du benutzt die Funktion LoadImage, LoadBitmap, LoadIcon, ...oder allgemein LoadResource <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>
<p>ja, und um halt das handel zur deiner (also der anderen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> ) .exe-datei zu bekommen verwendest du (so, wie ich das sehe)</p>
<pre><code class="language-cpp">LoadLibrary(&quot;C:\\lass_dir_was_einfallen.exe&quot;)
</code></pre>
<p>so, ähm ...das müsste etwa hinkommen. ahja, hab noch en bsp. aus der msdn für dich:</p>
<pre><code class="language-cpp">HRSRC hResLoad;     // handle to loaded resource 
HANDLE hExe;        // handle to existing .EXE file 
HRSRC hRes;         // handle/ptr. to res. info. in hExe 
HANDLE hUpdateRes;  // update resource handle 
char *lpResLock;    // pointer to resource data 
BOOL result; 
// Load the .EXE file that contains the dialog box you want to copy. 
hExe = LoadLibrary(&quot;hand.exe&quot;); 
if (hExe == NULL) 
{ 
    ErrorHandler(&quot;Could not load exe.&quot;); 
} 

// Locate the dialog box resource in the .EXE file. 
hRes = FindResource(hExe, &quot;AboutBox&quot;, RT_DIALOG); 
if (hRes == NULL) 
{ 
    ErrorHandler(&quot;Could not locate dialog box.&quot;); 
} 

// Load the dialog box into global memory. 
hResLoad = LoadResource(hExe, hRes); 
if (hResLoad == NULL) 
{ 
    ErrorHandler(&quot;Could not load dialog box.&quot;); 
} 

// Lock the dialog box into global memory. 
lpResLock = LockResource(hResLoad); 
if (lpResLock == NULL) 
{ 
    ErrorHandler(&quot;Could not lock dialog box.&quot;); 
} 

// Open the file to which you want to add the dialog box resource. 
hUpdateRes = BeginUpdateResource(&quot;foot.exe&quot;, FALSE); 
if (hUpdateRes == NULL) 
{ 
    ErrorHandler(&quot;Could not open file for writing.&quot;); 
} 

// Add the dialog box resource to the update list. 
result = UpdateResource(hUpdateRes,       // update resource handle 
     RT_DIALOG,                   // change dialog box resource 
     &quot;AboutBox&quot;,                  // dialog box name 
     MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),  // neutral language
     lpResLock,                   // ptr to resource info 
     SizeofResource(hExe, hRes)); // size of resource info. 
if (result == FALSE) 
{ 
    ErrorHandler(&quot;Could not add resource.&quot;); 
} 

// Write changes to FOOT.EXE and then close it. 
if (!EndUpdateResource(hUpdateRes, FALSE)) 
{ 
    ErrorHandler(&quot;Could not write changes to file.&quot;); 
} 

// Clean up. 
if (!FreeLibrary(hExe)) 
{ 
    ErrorHandler(&quot;Could not free executable.&quot;); 
}
</code></pre>
<p>es ist doch immer schön, zu helfen.<br />
lw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502875</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502875</guid><dc:creator><![CDATA[Lawilog]]></dc:creator><pubDate>Fri, 16 Apr 2004 18:35:57 GMT</pubDate></item><item><title><![CDATA[Reply to Resource aus fremder Datei(exe, dll) laden?! on Sat, 17 Apr 2004 12:38:39 GMT]]></title><description><![CDATA[<p>Vielen Dank, das hat mir schon sehr weitergeholfen.</p>
<p>Ich hab es so gemacht, das man mit Hilfe eines Dialoges auswählen kann welche Datei man öffnen möchte.<br />
Nun bin ich aber auf das Problem gestoßen, das einige Dateien nicht geladen werden können (z.B.die Datei icqrt.dll aus dem ICQ Ordner) wenn sich mein Programm nicht im selben Ordner wie die Datei befindet.<br />
Gibt es irgendwie eine Möglichkeit das Problem zu beheben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/503210</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/503210</guid><dc:creator><![CDATA[TheDeath]]></dc:creator><pubDate>Sat, 17 Apr 2004 12:38:39 GMT</pubDate></item><item><title><![CDATA[Reply to Resource aus fremder Datei(exe, dll) laden?! on Sat, 17 Apr 2004 15:15:00 GMT]]></title><description><![CDATA[<p>Dann scheinst du wohl keine absoluten Pfade zu verwenden <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/503316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/503316</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sat, 17 Apr 2004 15:15:00 GMT</pubDate></item><item><title><![CDATA[Reply to Resource aus fremder Datei(exe, dll) laden?! on Sat, 17 Apr 2004 15:25:50 GMT]]></title><description><![CDATA[<p>GetLastError() verrät bestimmt was dazu <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=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/503321</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/503321</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sat, 17 Apr 2004 15:25:50 GMT</pubDate></item><item><title><![CDATA[Reply to Resource aus fremder Datei(exe, dll) laden?! on Sat, 17 Apr 2004 15:26:05 GMT]]></title><description><![CDATA[<p>Doch, doch, tu ich.</p>
<p>Hab soeben eine Lösung gefunden:</p>
<pre><code>LoadLibraryEx(&quot;C:\\Beispiel.dll&quot;,NULL,LOAD_WITH_ALTERED_SEARCH_PATH);
</code></pre>
<p>Damit werden alle Dateien, die von der zu ladenen Datei(hier Beispiel.dll) geladen werden ,in dem Pfad gesucht, der der Funktion im ersten Parameter mit übergeben wird (hier C:\)<br />
oder wie msdn dazu sagt:</p>
<blockquote>
<p>LOAD_WITH_ALTERED_SEARCH_PATH:<br />
If this value is used, and lpFileName specifies a path, the system uses the alternate file search strategy discussed in the Remarks section to find associated executable modules that the specified module causes to be loaded.</p>
</blockquote>
<p>Was ebenfalls als 3 Parameter gehen müsste ist <em>DONT_RESOLVE_DLL_REFERENCES</em>. Das bewirkt das nur die angegebene Datei geladen wird und keine weiteren.<br />
Habs aber nocht nicht ausprobiert, daher weiß ich nicht ob es geht.</p>
<p>Quelle: <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/loadlibraryex.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/loadlibraryex.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/503322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/503322</guid><dc:creator><![CDATA[TheDeath]]></dc:creator><pubDate>Sat, 17 Apr 2004 15:26:05 GMT</pubDate></item></channel></rss>