<?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[Nicht globale Hotkeys?]]></title><description><![CDATA[<p>Huhu hab n kleines problem mit Hotkeys. Schreibe n kleines chat programm und will enter als programminternen hotkey festlegen um nachrichten zu senden.<br />
Das sieht so aus:</p>
<pre><code>case WM_CREATE:
RegisterHotKey(hwnd,VK_RETURN,0,VK_RETURN);
</code></pre>
<p>und dann die abfrage:</p>
<pre><code>case WM_HOTKEY:
if((wParam==VK_RETURN) &amp;&amp; (con==true)) 
{ &quot;Senden();&quot; }
</code></pre>
<p>das macht den hatkey aber global, also auch wenn der focus nicht mein programm ist. Dummerweise wird die enter taste damit komplett blockiert, also auch in anderen programmen.<br />
Als Alternative habs ich mit WM_KEYDOWN: versucht, keydown wird aber nicht weitergegeben wenn der focus eine textbox ist. was ich auch versucht habe ist das event weiterzugeben:</p>
<pre><code>case WM_HOTKEY:
if((wParam==VK_RETURN)&amp;&amp; (GetFocus()==MeineHWND) &amp;&amp; (con==true)) 
{ &quot;Senden();&quot; }
else{ return DefWindowProc (MeineHWND, message, wParam, lParam); }
</code></pre>
<p>was aber auch nicht klappt.<br />
Kann man einen hotkey irgendwie local registrieren oder hat jemand ne andere idee?<br />
mfg Ic3Hawk</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/191358/nicht-globale-hotkeys</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 08:19:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/191358.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 02 Sep 2007 02:37:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Sun, 02 Sep 2007 02:37:46 GMT]]></title><description><![CDATA[<p>Huhu hab n kleines problem mit Hotkeys. Schreibe n kleines chat programm und will enter als programminternen hotkey festlegen um nachrichten zu senden.<br />
Das sieht so aus:</p>
<pre><code>case WM_CREATE:
RegisterHotKey(hwnd,VK_RETURN,0,VK_RETURN);
</code></pre>
<p>und dann die abfrage:</p>
<pre><code>case WM_HOTKEY:
if((wParam==VK_RETURN) &amp;&amp; (con==true)) 
{ &quot;Senden();&quot; }
</code></pre>
<p>das macht den hatkey aber global, also auch wenn der focus nicht mein programm ist. Dummerweise wird die enter taste damit komplett blockiert, also auch in anderen programmen.<br />
Als Alternative habs ich mit WM_KEYDOWN: versucht, keydown wird aber nicht weitergegeben wenn der focus eine textbox ist. was ich auch versucht habe ist das event weiterzugeben:</p>
<pre><code>case WM_HOTKEY:
if((wParam==VK_RETURN)&amp;&amp; (GetFocus()==MeineHWND) &amp;&amp; (con==true)) 
{ &quot;Senden();&quot; }
else{ return DefWindowProc (MeineHWND, message, wParam, lParam); }
</code></pre>
<p>was aber auch nicht klappt.<br />
Kann man einen hotkey irgendwie local registrieren oder hat jemand ne andere idee?<br />
mfg Ic3Hawk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357127</guid><dc:creator><![CDATA[Ic3Hawk]]></dc:creator><pubDate>Sun, 02 Sep 2007 02:37:46 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Sun, 02 Sep 2007 08:37:20 GMT]]></title><description><![CDATA[<p><a href="https://www.google.de/search?&amp;q=winapi%20accelerators" rel="nofollow">Google: winapi accelerators</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357147</guid><dc:creator><![CDATA[&#x2F;&#x5C;__&#x2F;&#x5C;__&#x2F;&#x5C;__&#x2F;&#x5C;__&#x2F;]]></dc:creator><pubDate>Sun, 02 Sep 2007 08:37:20 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Sun, 02 Sep 2007 16:40:39 GMT]]></title><description><![CDATA[<p>Könnte jemand bitte etwas genauer werden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357382</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357382</guid><dc:creator><![CDATA[Ic3Hawk]]></dc:creator><pubDate>Sun, 02 Sep 2007 16:40:39 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Sun, 02 Sep 2007 16:46:59 GMT]]></title><description><![CDATA[<p><a href="http://msdn2.microsoft.com/en-us/library/ms646335.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms646335.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357386</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357386</guid><dc:creator><![CDATA[helfer]]></dc:creator><pubDate>Sun, 02 Sep 2007 16:46:59 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Sun, 02 Sep 2007 16:55:42 GMT]]></title><description><![CDATA[<p>hier ausnahmsweise:</p>
<pre><code class="language-cpp">int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.
	MSG msg;
	HACCEL hAccelTable;

	// ...

	hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_ASA);

	// Main message loop:
	while (GetMessage(&amp;msg, NULL, 0, 0)) 
	{
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;msg)) 
		{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}

	return msg.wParam;
}
</code></pre>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;

	switch (message) 
	{
		case WM_COMMAND:
			wmId    = LOWORD(wParam); 
			wmEvent = HIWORD(wParam); 
			// Parse the menu selections:
			switch (wmId)
			{
				case IDM_TOLL:
				   MessageBox(hWnd, &quot;Es ist sehr toll&quot;, &quot;&quot;, 0);
				   break;
// ......
</code></pre>
<p>Das kannst du dir auch im VS generieren lassen mein Freund, zumindest bei VS6, ich weiß ned ob die neuen das auch noch machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1357390</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1357390</guid><dc:creator><![CDATA[helfer]]></dc:creator><pubDate>Sun, 02 Sep 2007 16:55:42 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Mon, 03 Sep 2007 18:33:37 GMT]]></title><description><![CDATA[<p>sry kenne mich mit Accelerators net aus.<br />
Wo kann ich da festlegen welche taste ich hooken will?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358228</guid><dc:creator><![CDATA[Ic3Hawk]]></dc:creator><pubDate>Mon, 03 Sep 2007 18:33:37 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Mon, 03 Sep 2007 18:35:26 GMT]]></title><description><![CDATA[<p>in der Accelerator Resource, die du deinem Programm hinzugefügt hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358232</guid><dc:creator><![CDATA[teppichmensch]]></dc:creator><pubDate>Mon, 03 Sep 2007 18:35:26 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Mon, 03 Sep 2007 18:40:06 GMT]]></title><description><![CDATA[<p>wie gesagt ich hab noch nie damit gearbeitet, auch net mit recourcen, Ich arbeite mit Dev-C++. War noch nie nötig mit recourcen zu arbeiten.<br />
Gibts nicht einen anderen weg?<br />
mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358238</guid><dc:creator><![CDATA[Ic3Hawk]]></dc:creator><pubDate>Mon, 03 Sep 2007 18:40:06 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Mon, 03 Sep 2007 18:47:17 GMT]]></title><description><![CDATA[<p>NEIN gibts nicht. Mehr als den Code dir hier zu präsentiere und dir ans Herz zu legen, dich auf der MSDN SCHLAU zu lesen, kann ich nicht tun.</p>
<p>Du LÄDST eine Accelerator Resource mit LoadAccelerators und baust dann TranslateAccelerator in deine Nachrichtenschleife an, wie oben gezeigt. EINFACHER geht es nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358243</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358243</guid><dc:creator><![CDATA[teppichmensch]]></dc:creator><pubDate>Mon, 03 Sep 2007 18:47:17 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht globale Hotkeys? on Mon, 03 Sep 2007 18:50:08 GMT]]></title><description><![CDATA[<p>Benutz lieber einen Button. Der löst bei Enter WM_COMMAND mit IDOK aus, wenn er der Default-Push-Button ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358246</guid><dc:creator><![CDATA[button]]></dc:creator><pubDate>Mon, 03 Sep 2007 18:50:08 GMT</pubDate></item></channel></rss>