<?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[Hook wiederholen oder so ;-)]]></title><description><![CDATA[<p>Also hollöchen,</p>
<p>hier ist mein Problem:<br />
Ich bin ein klasischer Bastler und möchte mir bei einem Spiel einen kleinen Erleichterung verschaufen <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>
<p>Ich hab mir den unten stehenden code so zusammengestellt nun weiß ich aber nicht wie ich das Senden wiederhole ohne das das Spiel stecken bleibt. Wenn ich das mit sleep mache Bleibt mein spiel stecken. Auch wenn ich auf der Taste (V) draufbleibe wiederholt sich die Tastensimulation nicht.</p>
<p>Mit ist im Prinzip egal wie ich es am besten gemacht wird. Nur könnt ihr mir einen Tipp geben?</p>
<pre><code class="language-cpp">/---------------------------------------------------------------------------

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

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

extern &quot;C&quot; __declspec(dllexport) __stdcall void SetHook(void);
extern &quot;C&quot; __declspec(dllexport) __stdcall void RemoveHook(void);
extern &quot;C&quot; __declspec(dllexport) __stdcall DWORD CheckKey(int, WORD,LONG);

//---------------------------------------------------------------------------
__fastcall TKeyHookForm::TKeyHookForm(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TKeyHookForm::KeyHook(TMessage&amp; Message)
{
    char Key[80];
    GetKeyNameText(Message.LParam, Key, 80);
    ListBox1-&gt;Items-&gt;Add(Key);
    String Hiho;
    Hiho = Key;
    if (Hiho==&quot;V&quot;)
    {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

 Sleep(1000);
       mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
        }

}
void __fastcall TKeyHookForm::FormCreate(TObject *Sender)
{
    SetHook ();
}
//---------------------------------------------------------------------------

void __fastcall TKeyHookForm::FormDestroy(TObject *Sender)
{
    RemoveHook ();
}
</code></pre>
<p>Danke,<br />
Fanta</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169672/hook-wiederholen-oder-so</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 16:29:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169672.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Jan 2007 18:21:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hook wiederholen oder so ;-) on Sun, 07 Jan 2007 18:21:28 GMT]]></title><description><![CDATA[<p>Also hollöchen,</p>
<p>hier ist mein Problem:<br />
Ich bin ein klasischer Bastler und möchte mir bei einem Spiel einen kleinen Erleichterung verschaufen <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>
<p>Ich hab mir den unten stehenden code so zusammengestellt nun weiß ich aber nicht wie ich das Senden wiederhole ohne das das Spiel stecken bleibt. Wenn ich das mit sleep mache Bleibt mein spiel stecken. Auch wenn ich auf der Taste (V) draufbleibe wiederholt sich die Tastensimulation nicht.</p>
<p>Mit ist im Prinzip egal wie ich es am besten gemacht wird. Nur könnt ihr mir einen Tipp geben?</p>
<pre><code class="language-cpp">/---------------------------------------------------------------------------

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

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

extern &quot;C&quot; __declspec(dllexport) __stdcall void SetHook(void);
extern &quot;C&quot; __declspec(dllexport) __stdcall void RemoveHook(void);
extern &quot;C&quot; __declspec(dllexport) __stdcall DWORD CheckKey(int, WORD,LONG);

//---------------------------------------------------------------------------
__fastcall TKeyHookForm::TKeyHookForm(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TKeyHookForm::KeyHook(TMessage&amp; Message)
{
    char Key[80];
    GetKeyNameText(Message.LParam, Key, 80);
    ListBox1-&gt;Items-&gt;Add(Key);
    String Hiho;
    Hiho = Key;
    if (Hiho==&quot;V&quot;)
    {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

 Sleep(1000);
       mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
        }

}
void __fastcall TKeyHookForm::FormCreate(TObject *Sender)
{
    SetHook ();
}
//---------------------------------------------------------------------------

void __fastcall TKeyHookForm::FormDestroy(TObject *Sender)
{
    RemoveHook ();
}
</code></pre>
<p>Danke,<br />
Fanta</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205153</guid><dc:creator><![CDATA[Fanta]]></dc:creator><pubDate>Sun, 07 Jan 2007 18:21:28 GMT</pubDate></item><item><title><![CDATA[Reply to Hook wiederholen oder so ;-) on Sun, 07 Jan 2007 18:37:42 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Einen Timer anstatt Sleep verwenden.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205166</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205166</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 07 Jan 2007 18:37:42 GMT</pubDate></item></channel></rss>