<?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[Maushook]]></title><description><![CDATA[<p>Sers,<br />
Ich bin grad dabei ein Proggy zu coden das die Mausposi von einem Rechner an einen anderen sendet und dieser wiederum dan die Mausposi animmt.</p>
<p>Anfangs hatte ich auch keine Probleme danbei ( hatte den Befehl GetCursorPos(&amp;pt) genommen), aber als ich einen Tastendruck mitsenden wollte ging das nicht mehr. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
<p>Ich hab mir dann die dlls tutorials durcharbeitet, aba irgendwo müssen sich ein paar Fehler eingeschlichen haben ( <a href="http://bcb-tutorial.c-plusplus.net/DLL_Tutorial/artikel15.html#hooks" rel="nofollow">http://bcb-tutorial.c-plusplus.net/DLL_Tutorial/artikel15.html#hooks</a> )</p>
<p>Die hook dll funktioniert einmandfrei nur bei dem Programm zum ansteuern bekomm ich folgenden fehler:<br />
[C++ Fehler] Unit1.cpp(32): E2451 Undefiniertes Symbol 'hook'</p>
<p>also habe ich hook ma definiert:</p>
<pre><code class="language-cpp">HHOOK hook;
</code></pre>
<p>ka ob das richtig war ^^ aba dann kam wenigstens ma eine andere Fehler meldung:</p>
<pre><code class="language-cpp">[Linker Fehler] Unresolved external '__fastcall TForm1::OnMouseMove(Messages::TMessage&amp;)' referenced from C:\DOKUMENTE UND EINSTELLUNGEN\CYB3R-\DESKTOP\C++\MAUS HOOK\UNIT1.OBJ
</code></pre>
<p>währe nett wenn mir jemand weiterhelfen könnte <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>
<p>kompletter Code: Unit1.h</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
//---------------------------------------------------------------------------
__declspec(dllimport) HHOOK InstallHook(HHOOK hook);
__declspec(dllimport) BOOL UninstallHook(HHOOK hook);

HHOOK hook;

class TForm1 : public TForm
{
__published:	// Von der IDE verwaltete Komponenten
    TButton *Button1;
    TButton *Button2;
    TLabel *XLabel;
    TLabel *YLabel;
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall Button2Click(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &amp;Action);
    void __fastcall FormMouseMove(TMessage &amp; msg);

private:	// Anwender-Deklarationen
public:		// Anwender-Deklarationen
    __fastcall TForm1(TComponent* Owner);
protected:
void __fastcall OnMouseMove(TMessage &amp;msg);
BEGIN_MESSAGE_MAP
    VCL_MESSAGE_HANDLER(WM_MOUSEMOVE, TMessage, OnMouseMove)
END_MESSAGE_MAP(TForm)
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>Unit1.cpp</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;

TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
hook = InstallHook(hook);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
UninstallHook(hook);

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
 if (hook != NULL)
        UninstallHook(hook); 

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormMouseMove(TMessage &amp; msg)
{
XLabel-&gt;Caption = Format(&quot;X = %d&quot;, ARRAYOFCONST(LOWORD(msg.LParam)));
    YLabel-&gt;Caption = Format(&quot;Y = %d&quot;, ARRAYOFCONST(HIWORD(msg.LParam)));
    if(msg.WParam == WM_RBUTTONUP)
        MessageBox(Handle, &quot;Rechtsklick erfolgt!&quot;, &quot;HOOKIBOY&quot;,
            MB_OK | MB_ICONINFORMATION | MB_SYSTEMMODAL);

}
//------
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/78936/maushook</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 19:49:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/78936.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Jul 2004 14:16:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Maushook on Tue, 06 Jul 2004 14:16:35 GMT]]></title><description><![CDATA[<p>Sers,<br />
Ich bin grad dabei ein Proggy zu coden das die Mausposi von einem Rechner an einen anderen sendet und dieser wiederum dan die Mausposi animmt.</p>
<p>Anfangs hatte ich auch keine Probleme danbei ( hatte den Befehl GetCursorPos(&amp;pt) genommen), aber als ich einen Tastendruck mitsenden wollte ging das nicht mehr. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
<p>Ich hab mir dann die dlls tutorials durcharbeitet, aba irgendwo müssen sich ein paar Fehler eingeschlichen haben ( <a href="http://bcb-tutorial.c-plusplus.net/DLL_Tutorial/artikel15.html#hooks" rel="nofollow">http://bcb-tutorial.c-plusplus.net/DLL_Tutorial/artikel15.html#hooks</a> )</p>
<p>Die hook dll funktioniert einmandfrei nur bei dem Programm zum ansteuern bekomm ich folgenden fehler:<br />
[C++ Fehler] Unit1.cpp(32): E2451 Undefiniertes Symbol 'hook'</p>
<p>also habe ich hook ma definiert:</p>
<pre><code class="language-cpp">HHOOK hook;
</code></pre>
<p>ka ob das richtig war ^^ aba dann kam wenigstens ma eine andere Fehler meldung:</p>
<pre><code class="language-cpp">[Linker Fehler] Unresolved external '__fastcall TForm1::OnMouseMove(Messages::TMessage&amp;)' referenced from C:\DOKUMENTE UND EINSTELLUNGEN\CYB3R-\DESKTOP\C++\MAUS HOOK\UNIT1.OBJ
</code></pre>
<p>währe nett wenn mir jemand weiterhelfen könnte <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>
<p>kompletter Code: Unit1.h</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
//---------------------------------------------------------------------------
__declspec(dllimport) HHOOK InstallHook(HHOOK hook);
__declspec(dllimport) BOOL UninstallHook(HHOOK hook);

HHOOK hook;

class TForm1 : public TForm
{
__published:	// Von der IDE verwaltete Komponenten
    TButton *Button1;
    TButton *Button2;
    TLabel *XLabel;
    TLabel *YLabel;
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall Button2Click(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &amp;Action);
    void __fastcall FormMouseMove(TMessage &amp; msg);

private:	// Anwender-Deklarationen
public:		// Anwender-Deklarationen
    __fastcall TForm1(TComponent* Owner);
protected:
void __fastcall OnMouseMove(TMessage &amp;msg);
BEGIN_MESSAGE_MAP
    VCL_MESSAGE_HANDLER(WM_MOUSEMOVE, TMessage, OnMouseMove)
END_MESSAGE_MAP(TForm)
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>Unit1.cpp</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;

TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
hook = InstallHook(hook);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
UninstallHook(hook);

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
 if (hook != NULL)
        UninstallHook(hook); 

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormMouseMove(TMessage &amp; msg)
{
XLabel-&gt;Caption = Format(&quot;X = %d&quot;, ARRAYOFCONST(LOWORD(msg.LParam)));
    YLabel-&gt;Caption = Format(&quot;Y = %d&quot;, ARRAYOFCONST(HIWORD(msg.LParam)));
    if(msg.WParam == WM_RBUTTONUP)
        MessageBox(Handle, &quot;Rechtsklick erfolgt!&quot;, &quot;HOOKIBOY&quot;,
            MB_OK | MB_ICONINFORMATION | MB_SYSTEMMODAL);

}
//------
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/554520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554520</guid><dc:creator><![CDATA[cYb3r]]></dc:creator><pubDate>Tue, 06 Jul 2004 14:16:35 GMT</pubDate></item><item><title><![CDATA[Reply to Maushook on Tue, 06 Jul 2004 14:55:15 GMT]]></title><description><![CDATA[<p>Du hast im Header die Funktion OnMouseMove deklariert, im CPP aber nicht implementiert.<br />
Dein FormMouseMove ist zuviel, der dort stehende Code gehört in die (fehlende) Implementierung von OnMouseMove.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/554571</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554571</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Tue, 06 Jul 2004 14:55:15 GMT</pubDate></item><item><title><![CDATA[Reply to Maushook on Tue, 06 Jul 2004 15:18:03 GMT]]></title><description><![CDATA[<p>danke für deine schnelle Antwort. Ich habe es nun so abgeändert aba es funtkioniert immer noch nicht.</p>
<p>da die funktion dann nicht zu form gehört können auch net auf die Variablen zugegriffen werden:</p>
<pre><code class="language-cpp">[C++ Fehler] Unit1.cpp(39): E2451 Undefiniertes Symbol 'XLabel'
[C++ Fehler] Unit1.cpp(40): E2451 Undefiniertes Symbol 'YLabel'
[C++ Fehler] Unit1.cpp(42): E2451 Undefiniertes Symbol 'Handle'
</code></pre>
<p><a href="//Unit1.cpp">//Unit1.cpp</a></p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;

TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
hook = InstallHook(hook);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
UninstallHook(hook);

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
 if (hook != NULL)
        UninstallHook(hook);

}
//---------------------------------------------------------------------------
void __fastcall FormMouseMove(TMessage &amp; msg)
{
XLabel-&gt;Caption = Format(&quot;X = %d&quot;, ARRAYOFCONST(LOWORD(msg.LParam)));
    YLabel-&gt;Caption = Format(&quot;Y = %d&quot;, ARRAYOFCONST(HIWORD(msg.LParam)));
    if(msg.WParam == WM_RBUTTONUP)
        MessageBox(Handle, &quot;Rechtsklick erfolgt!&quot;, &quot;HOOKIBOY&quot;,
            MB_OK | MB_ICONINFORMATION | MB_SYSTEMMODAL);

}
/
</code></pre>
<p>Unit1.h</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
//---------------------------------------------------------------------------
__declspec(dllimport) HHOOK InstallHook(HHOOK hook);
__declspec(dllimport) BOOL UninstallHook(HHOOK hook);
HHOOK hook;
class TForm1 : public TForm
{
__published:	// Von der IDE verwaltete Komponenten
    TButton *Button1;
    TButton *Button2;
    TLabel *XLabel;
    TLabel *YLabel;
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall Button2Click(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &amp;Action);

private:	// Anwender-Deklarationen
public:		// Anwender-Deklarationen
    __fastcall TForm1(TComponent* Owner);
protected:
void __fastcall OnMouseMove(TMessage &amp;msg);
BEGIN_MESSAGE_MAP
    VCL_MESSAGE_HANDLER(WM_MOUSEMOVE, TMessage, OnMouseMove)
END_MESSAGE_MAP(TForm)
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/52">@Jansen</a> hab ichs jetzt richtig abgeändert oder hab ich was falsch gemacht?<br />
der findet jetzt die Edit Felder nimmer, weil die funktion ja nimmer zu Klasse gehört <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/554601</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554601</guid><dc:creator><![CDATA[cYb3r]]></dc:creator><pubDate>Tue, 06 Jul 2004 15:18:03 GMT</pubDate></item><item><title><![CDATA[Reply to Maushook on Tue, 06 Jul 2004 15:20:04 GMT]]></title><description><![CDATA[<p>sry hatte die eine Zeile falsch gepostet:</p>
<pre><code class="language-cpp">void __fastcall FormMouseMove(TMessage &amp; msg)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/554603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554603</guid><dc:creator><![CDATA[cYb3r]]></dc:creator><pubDate>Tue, 06 Jul 2004 15:20:04 GMT</pubDate></item><item><title><![CDATA[Reply to Maushook on Tue, 06 Jul 2004 15:21:27 GMT]]></title><description><![CDATA[<p>dat gibts net<br />
zu dumm zum kopiere <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 />
so diesma peer Hand geschriebe</p>
<pre><code class="language-cpp">void __fastcall MouseMove(TMessage &amp; msg)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/554604</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554604</guid><dc:creator><![CDATA[cYb3r]]></dc:creator><pubDate>Tue, 06 Jul 2004 15:21:27 GMT</pubDate></item><item><title><![CDATA[Reply to Maushook on Tue, 06 Jul 2004 15:26:32 GMT]]></title><description><![CDATA[<p>[cpp]void __fastcall TForm1::<strong>OnMouseMove</strong>(TMessage &amp; msg)<br />
{<br />
XLabel-&gt;Caption = Format(&quot;X = %d&quot;, ARRAYOFCONST(LOWORD(msg.LParam)));<br />
// usw.<br />
}[/cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/554608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554608</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Tue, 06 Jul 2004 15:26:32 GMT</pubDate></item><item><title><![CDATA[Reply to Maushook on Tue, 06 Jul 2004 15:27:31 GMT]]></title><description><![CDATA[<p>nach ein bissel rumspielen hab ich es doch endlich hinbekommen :&gt;</p>
<p>und nochma thx an Jansen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/554610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554610</guid><dc:creator><![CDATA[cYb3r]]></dc:creator><pubDate>Tue, 06 Jul 2004 15:27:31 GMT</pubDate></item></channel></rss>