<?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[GetMessage() ohne Fenster]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich bin gerade dabei ein Programm ohne GUI zu schreiben (also keine Konsole usw.).</p>
<p>Ich will mit meinem Programm Messages empfangen und auswerten (WM_KEYDOWN;WM_KEYUP;..) aber ich habe die Vermutung, dass es keine Messages empfängt <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="😃"
    /><br />
Wie kann ich das ändern?</p>
<p>Hier mein Code:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int nCmdShow)
{
	MSG msg;

	while (GetMessage(&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	return (int)msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
		case WM_KEYDOWN:
		{
			switch (wParam)
			{
			case VK_ESCAPE:
				SendMessage(hWnd, WM_CLOSE, 0, 0);
				break;
			}
		}
		case WM_KEYUP:
		{
			switch (wParam)
			{
			}
		}
		case WM_DESTROY:
		{
			PostQuitMessage(0);
			return 0;
		}

	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
<p>Vielen Dank,<br />
Thindia80</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/230019/getmessage-ohne-fenster</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 02:41:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/230019.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Dec 2008 11:55:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetMessage() ohne Fenster on Fri, 19 Dec 2008 11:55:54 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich bin gerade dabei ein Programm ohne GUI zu schreiben (also keine Konsole usw.).</p>
<p>Ich will mit meinem Programm Messages empfangen und auswerten (WM_KEYDOWN;WM_KEYUP;..) aber ich habe die Vermutung, dass es keine Messages empfängt <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="😃"
    /><br />
Wie kann ich das ändern?</p>
<p>Hier mein Code:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int nCmdShow)
{
	MSG msg;

	while (GetMessage(&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	return (int)msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
		case WM_KEYDOWN:
		{
			switch (wParam)
			{
			case VK_ESCAPE:
				SendMessage(hWnd, WM_CLOSE, 0, 0);
				break;
			}
		}
		case WM_KEYUP:
		{
			switch (wParam)
			{
			}
		}
		case WM_DESTROY:
		{
			PostQuitMessage(0);
			return 0;
		}

	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
<p>Vielen Dank,<br />
Thindia80</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1632813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1632813</guid><dc:creator><![CDATA[Thindia80]]></dc:creator><pubDate>Fri, 19 Dec 2008 11:55:54 GMT</pubDate></item><item><title><![CDATA[Reply to GetMessage() ohne Fenster on Fri, 19 Dec 2008 12:17:01 GMT]]></title><description><![CDATA[<p>Nur ein Fenster, dass den Fokus hat kann Tastaturnachrichten empfangen.<br />
Dein Programm wird nie irgendwas bekommen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1632823</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1632823</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Dec 2008 12:17:01 GMT</pubDate></item><item><title><![CDATA[Reply to GetMessage() ohne Fenster on Fri, 19 Dec 2008 12:31:33 GMT]]></title><description><![CDATA[<p>Und wie machen das dann z.B. Keylogger?</p>
<p>lg,<br />
-Thindia80</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1632833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1632833</guid><dc:creator><![CDATA[Thindia80]]></dc:creator><pubDate>Fri, 19 Dec 2008 12:31:33 GMT</pubDate></item><item><title><![CDATA[Reply to GetMessage() ohne Fenster on Fri, 19 Dec 2008 12:48:07 GMT]]></title><description><![CDATA[<p>Hooks!<br />
Und damit ist das Thema für mich beendet... :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1632842</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1632842</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Dec 2008 12:48:07 GMT</pubDate></item><item><title><![CDATA[Reply to GetMessage() ohne Fenster on Sat, 20 Dec 2008 19:17:48 GMT]]></title><description><![CDATA[<p>Wieso erzeugst du kein Fenster und stellt es auf SW_HIDE ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1633377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1633377</guid><dc:creator><![CDATA[zero_exxx]]></dc:creator><pubDate>Sat, 20 Dec 2008 19:17:48 GMT</pubDate></item></channel></rss>