<?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[FreeDLL funktioniert nicht]]></title><description><![CDATA[<p>Hi,bei folgendem Code wird die DLL nicht entladen,man kann sie also nicht löschen<br />
und sie wird weiterhin ausgeführt,weiß jamand an was das liegt?</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

int main(void)
{
HINSTANCE hDLL;
hDLL = LoadLibrary(&quot;hack_dll.dll&quot;);
system(&quot;PAUSE&quot;);
FreeLibrary(hDLL);
return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/144313/freedll-funktioniert-nicht</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 19:45:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/144313.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Apr 2006 22:32:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Sun, 16 Apr 2006 22:32:53 GMT]]></title><description><![CDATA[<p>Hi,bei folgendem Code wird die DLL nicht entladen,man kann sie also nicht löschen<br />
und sie wird weiterhin ausgeführt,weiß jamand an was das liegt?</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

int main(void)
{
HINSTANCE hDLL;
hDLL = LoadLibrary(&quot;hack_dll.dll&quot;);
system(&quot;PAUSE&quot;);
FreeLibrary(hDLL);
return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1038807</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1038807</guid><dc:creator><![CDATA[FreeDLL]]></dc:creator><pubDate>Sun, 16 Apr 2006 22:32:53 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Sun, 16 Apr 2006 23:31:14 GMT]]></title><description><![CDATA[<p>was heisst sie wird weiterhin ausgeführt? was machst du in der dll? funzt bei mir ohne probs.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1038820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1038820</guid><dc:creator><![CDATA[fsdcv]]></dc:creator><pubDate>Sun, 16 Apr 2006 23:31:14 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Mon, 17 Apr 2006 09:15:46 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">BOOL InstallHook(void);
BOOL UnInstallHook(void);
LRESULT CALLBACK MouseProc( int, WPARAM, LPARAM);

HHOOK		hMouseHook;
HINSTANCE   hDllInstance;

extern &quot;C&quot; int WINAPI DllMain
                      (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
     	hDllInstance = hInst;
        InstallHook();
        break;

      case DLL_PROCESS_DETACH:
        UnInstallHook();
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}

BOOL  UnInstallHook(void)//CALLBACK
{
   //MessageBox(GetForegroundWindow(),&quot;inhalt&quot;,&quot;name&quot;,MB_OK);   
    return UnhookWindowsHookEx(hMouseHook);
}

BOOL  InstallHook(void)
{

 	hMouseHook = SetWindowsHookEx(WH_MOUSE,
                                     MouseProc,
                                     hDllInstance,
                                     0);

    if (hMouseHook == NULL)
    {

        return FALSE;
    }
    MessageBox(GetForegroundWindow(),&quot;inhalt&quot;,&quot;name&quot;,MB_OK);
    return TRUE;
}

LRESULT MouseProc( int code, WPARAM wparam, LPARAM lparam )
{
/*DWORD dwThreadParam = 1;
DWORD dwThreadID;

static HANDLE hThread;
  if( code &gt;= 0 )
  {     
      MOUSEHOOKSTRUCT mhs = *(MOUSEHOOKSTRUCT*)lparam;

      if (mhs.hwnd == FindWindow( NULL, &quot;Counter-Strike Source&quot; ))
      {
        if( wparam == WM_LBUTTONDOWN )
        {
         hThread = CreateThread (NULL, 0, ThreadProc,
         &amp;dwThreadParam, 0,
         &amp;dwThreadID);
        }
        if( wparam == WM_LBUTTONUP )
        {
         TerminateThread (hThread, 0);   
        }
      }

  }
*/

return CallNextHookEx(hMouseHook, code, wparam, lparam);

}
</code></pre>
<p>Das mach ich darin!<br />
Und naja sie wird weiter ausgeführt d.h. man kann sie nicht löschen <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="😮"
    /><br />
Außerdem kommt die Textbox in InstallHook(void) nach dem beenden manchmal...Warum kommt die überhaupt öfters als 1x?</p>
<p>Danke im voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1038891</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1038891</guid><dc:creator><![CDATA[FreeDLL]]></dc:creator><pubDate>Mon, 17 Apr 2006 09:15:46 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Mon, 17 Apr 2006 11:52:10 GMT]]></title><description><![CDATA[<p>na das hat was mit deinem hook zeug zu tun...ich bin gerade zzu *faul* das in meinem buch nochmal nachzulesen, ich bin mir sicher jochen kann dir helfen, ansonsten schau ich nachher mal nach</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1038983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1038983</guid><dc:creator><![CDATA[dfsdfds]]></dc:creator><pubDate>Mon, 17 Apr 2006 11:52:10 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Mon, 17 Apr 2006 16:19:06 GMT]]></title><description><![CDATA[<p>Bin mir jetzt nicht sicher, aber vermutlich erhöht &quot;SetWindowsHookEx&quot; die Referenz auf die DLL, da ja sonst Dein Programm abstürzen würde/könnte, wenn die DLL entladen wird...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1039170</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039170</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 17 Apr 2006 16:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Mon, 17 Apr 2006 19:14:25 GMT]]></title><description><![CDATA[<p>Du bist ein wandelndes Lexikon <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="😉"
    /><br />
Weißt du auch wie ich das ganze dann lös?</p>
<p>Xalon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1039268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039268</guid><dc:creator><![CDATA[FreeDLL]]></dc:creator><pubDate>Mon, 17 Apr 2006 19:14:25 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Mon, 17 Apr 2006 19:54:28 GMT]]></title><description><![CDATA[<p>Da Deine Vorgehensweise soweiso nicht durch die Doku gedekt ist (Aufruf von SetWindowsHookEx in DllMain ist nicht supported! siehe Doku zu DllMain!), wäre der richtige Weg eine Funktion &quot;init&quot; und eine &quot;deinit&quot; zu machen, die man entsprechend aus der EXE heraus aufrufen muss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1039302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039302</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 17 Apr 2006 19:54:28 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Tue, 18 Apr 2006 12:30:17 GMT]]></title><description><![CDATA[<p>Ok Danke.<br />
Habs jetzt so versucht:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

int main(void)
{

/**************************/
/*DLL mit Funktionen laden*/
/**************************/
HINSTANCE hDLL;
typedef BOOL (CALLBACK* LPFNDLLFUNC1)(void);
LPFNDLLFUNC1 InstallHook; 
LPFNDLLFUNC1 UnInstallHook; 
hDLL = LoadLibrary(&quot;hack_dll.dll&quot;);
UnInstallHook = (LPFNDLLFUNC1)GetProcAddress(hDLL,&quot;UnInstallHook&quot;); 
InstallHook = (LPFNDLLFUNC1)GetProcAddress(hDLL,&quot;InstallHook&quot;); 
/**************************/
UnInstallHook();

FreeLibrary(hDLL);
return 0;
}
</code></pre>
<p>Und die DLL:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;dll.h&quot;

LRESULT CALLBACK MouseProc( int, WPARAM, LPARAM);
HHOOK		hMouseHook;
HINSTANCE   hDllInstance;

extern &quot;C&quot; int WINAPI DllMain
                      (HINSTANCE hInst     ,
                       DWORD reason        ,
                       LPVOID reserved      )
{

    hDllInstance = hInst;
    return TRUE;
}

BOOL CALLBACK UnInstallHook(void)
{
   MessageBox(GetForegroundWindow(),&quot;inhalt&quot;,&quot;name&quot;,MB_OK);   
   return TRUE;
}

BOOL CALLBACK InstallHook(void)
{

 	hMouseHook = SetWindowsHookEx(WH_MOUSE,
                                     MouseProc,
                                     hDllInstance,
                                     0);

    if (hMouseHook == NULL)
    {

        return FALSE;
    }
    MessageBox(GetForegroundWindow(),&quot;inhalt&quot;,&quot;name&quot;,MB_OK);
    return TRUE;
}

LRESULT MouseProc( int code, WPARAM wparam, LPARAM lparam )
{

return CallNextHookEx(hMouseHook, code, wparam, lparam);

}
</code></pre>
<p>Nur sobald ich dann in der exe UnInstallHook(); aufrufe kommt so ein Fehler:</p>
<p>&quot;dll_aufrufen.exe hat ein Problem festgestellt und muss beendet werden!<br />
[Nicht senden][Senden]&quot;</p>
<p>Woher kommt das?Ich kann keinen Fehler finden ?</p>
<p>Xalon</p>
<p>P.S.:Die dll.h</p>
<pre><code class="language-cpp">#ifndef Hook_H
#define Hook_H

#ifdef MAKE_DLL

#ifdef __cplusplus
#define LINKDLL extern &quot;C&quot; __declspec(dllexport)
#else
#define LINKDLL __declspec(dllexport)
#endif // __cplusplus

#else

#ifdef __cplusplus
#define LINKDLL extern &quot;C&quot; __declspec(dllimport)
#else
#define LINKDLL __declspec(dllimport)
#endif // __cplusplus

#endif // MAKE_DLL

BOOL CALLBACK InstallHook(void);
BOOL CALLBACK UnInstallHook(void);

#endif // Hook_H
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1039769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039769</guid><dc:creator><![CDATA[FreeDLL]]></dc:creator><pubDate>Tue, 18 Apr 2006 12:30:17 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Tue, 18 Apr 2006 12:40:55 GMT]]></title><description><![CDATA[<p>Du definierst zwar ein schönes LINKDLL-Makro, aber du benutzt es nicht. Und da du die Rückgabewerte von GetProcAddress nicht prüfst, knallt es eben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1039774</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039774</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Tue, 18 Apr 2006 12:40:55 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Tue, 18 Apr 2006 13:24:42 GMT]]></title><description><![CDATA[<p>Warum denn nicht?</p>
<p>Ich binde dll.h doch ein und da ist auch alles drinnen,oder?<br />
Hmm ich hasse Fehlerhafte Tutorial Codes ...<br />
Ich hab das DLL Grundgerüst nämlich aus einem...</p>
<p>Danke im voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1039832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039832</guid><dc:creator><![CDATA[FreeDLL]]></dc:creator><pubDate>Tue, 18 Apr 2006 13:24:42 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Tue, 18 Apr 2006 13:29:28 GMT]]></title><description><![CDATA[<p>schreib das LINKDLL mal vor deine funktionen in der dll und in der h datei...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1039836</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039836</guid><dc:creator><![CDATA[fsdfsd]]></dc:creator><pubDate>Tue, 18 Apr 2006 13:29:28 GMT</pubDate></item><item><title><![CDATA[Reply to FreeDLL funktioniert nicht on Tue, 18 Apr 2006 16:20:40 GMT]]></title><description><![CDATA[<p>Vielen Dank euch allen,es funktioniert ohne Probleme <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="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1039944</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1039944</guid><dc:creator><![CDATA[FreeDLL]]></dc:creator><pubDate>Tue, 18 Apr 2006 16:20:40 GMT</pubDate></item></channel></rss>