<?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[HWND und Message Problem]]></title><description><![CDATA[<p>hi, ich will einen Tastatur Hook setzen, wobei man ein HWND angeben muss anden dan später wenn die Taste gedrückt wird WM_HOTKEY gesendet wird (RegisterHotKey())...</p>
<p>soweit so gut, aber wie krieg ich es jetzt hin das ich die Message empfangen kann ohne dass ich ein (Dialog)Fenster machen muss?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/90166/hwnd-und-message-problem</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 21:46:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/90166.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Oct 2004 19:31:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 19:31:32 GMT]]></title><description><![CDATA[<p>hi, ich will einen Tastatur Hook setzen, wobei man ein HWND angeben muss anden dan später wenn die Taste gedrückt wird WM_HOTKEY gesendet wird (RegisterHotKey())...</p>
<p>soweit so gut, aber wie krieg ich es jetzt hin das ich die Message empfangen kann ohne dass ich ein (Dialog)Fenster machen muss?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638264</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638264</guid><dc:creator><![CDATA[++C++]]></dc:creator><pubDate>Tue, 26 Oct 2004 19:31:32 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 20:04:16 GMT]]></title><description><![CDATA[<p>++C++ schrieb:</p>
<blockquote>
<p>hi, ich will einen Tastatur Hook setzen, wobei man ein HWND angeben muss anden dan später wenn die Taste gedrückt wird WM_HOTKEY gesendet wird (RegisterHotKey())...</p>
<p>soweit so gut, aber wie krieg ich es jetzt hin das ich die Message empfangen kann ohne dass ich ein (Dialog)Fenster machen muss?</p>
</blockquote>
<p><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="😕"
    /> <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="😕"
    /> <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="😕"
    /> <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="😕"
    /> <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="😕"
    /> kein Plan was du meinst, zumindest zum größten Teil</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638284</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 20:04:16 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 20:09:08 GMT]]></title><description><![CDATA[<p>++C++ schrieb:</p>
<blockquote>
<p>soweit so gut, aber wie krieg ich es jetzt hin das ich die Message empfangen kann ohne dass ich ein (Dialog)Fenster machen muss?</p>
</blockquote>
<p>Was hast du gegen Fenster <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>
]]></description><link>https://www.c-plusplus.net/forum/post/638290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638290</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 26 Oct 2004 20:09:08 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 20:24:24 GMT]]></title><description><![CDATA[<p>geeky schrieb:</p>
<blockquote>
<p>Was hast du gegen Fenster <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>
</blockquote>
<p>Man muß sie putzen <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>Also er will Hook und HotKey, wobei man ein HWND benötigt, aber er erstellt kein Fenster, oder will es nicht.<br />
Wenn du kein Fenster willst (sichtbar) dann mach es Unsichtbar (Forensuche) und deine Probleme gehören der Vergangenheit an.<br />
Und wenn du strckt kein CreateWindow verwenden willst, nimm den Desktop (HWND - NULL) setzte mit SetWindowLong eine eigene WndProc an dessen ende die alte des Desktop aufgerufen wird, ob das klappt, weiß ich nicht, aber du wirst es für uns rausfinden, ja. <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/638296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638296</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 20:24:24 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 20:29:19 GMT]]></title><description><![CDATA[<p>Ich wiß, sorry, scheiße erklährt...</p>
<p>also, ich will ein Programm schreiben das aus einer ini datei den Title eines vorhandenen Fensters einliest, im hintergrund leuft (daemon) und jedes mal wenn man STRG drückt das Fenster Unsichtbar (ShowWindow(...,SW_HIDE))<br />
bzw. sichtbar (ShowWindow(...,SW_SHOW)) macht.</p>
<p>Ich werd jetzt einfach mal den bisherigen Quellqode posten der allerdings<br />
durch öffteres Überarbeiten 1. Schwachsinnig ist und 2. Unübersichtlich<br />
aber vileicht versteht man dan was ich meine:</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;
#include &quot;resource.h&quot;

#define HT_CRTL WM_USER

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK HelpProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

int i;
HINSTANCE hinstance;
HDC hdc;

WINAPI WinMain (HINSTANCE hinstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int nCmdShow)
{
	char title[100];
	DWORD size=255;
	HWND hwnd;
	MSG msg;
	WNDCLASS wnd;
	HWND hwnd1;

	GetPrivateProfileString(&quot;Programm&quot;,&quot;Programmtitlezeile&quot;,&quot;&quot;,title,size,&quot;./Programm.ini&quot;);

	hwnd=FindWindow(NULL,title);

	MessageBox(NULL,title,&quot;&quot;,MB_OK);

	if(hwnd==NULL)
	{
		MessageBox(NULL,&quot;Fenster kann nicht gefunden werden...&quot;,&quot;Fehler&quot;,MB_ICONERROR);
	}

	else
	{
		static TCHAR szAppName[] = TEXT (&quot;Invisible - Tool&quot;);    //hier fängt der Schwachsinn an

		wnd.style = CS_HREDRAW | CS_VREDRAW;
		wnd.lpfnWndProc = WndProc;
		wnd.cbClsExtra = 0;
		wnd.cbWndExtra = DLGWINDOWEXTRA;
		wnd.hInstance = hinstance;
		wnd.hIcon = NULL;
		wnd.hCursor = LoadCursor(NULL, IDC_ARROW);
		wnd.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
		wnd.lpszMenuName = &quot;IDM_MENU&quot;;
		wnd.lpszClassName = szAppName;

		if (!RegisterClass (&amp;wnd)) { MessageBox(NULL, &quot;RegisterClass failor&quot;, &quot;ERROR&quot;, MB_ICONERROR); }

		hwnd1 = CreateWindow(szAppName,NULL,NULL,0,0,0,NULL,NULL,hinstance,NULL);     //Absoluter Schwachsinn :)

		if(hwnd1==NULL) { MessageBox(NULL, &quot;CreatDialog() failor&quot;, &quot;ERROR&quot;, MB_ICONERROR); }

		if(!RegisterHotKey(hwnd1, HT_CRTL, 2, NULL)) { MessageBox(NULL, &quot;RegisterHotKey() failor&quot;, &quot;ERROR&quot;, MB_ICONERROR); }

		while(GetMessage(&amp;msg, NULL, 0, 0))
		{
			TranslateMessage (&amp;msg);
			DispatchMessage (&amp;msg);
		}
	}

	return 0;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	if (i!=1) { i=0; }

	switch(message)
	{
	case WM_CREATE:
		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		break;

	case WM_HOTKEY:
	{
		switch(wParam)
		{
		case HT_CRTL:
			if(i==0)
			{
				ShowWindow(hwnd, SW_HIDE);
				i=1;
				break;
			}

			if(i==1)
			{
				ShowWindow(hwnd, SW_SHOW);
				i=0;
			}
			break;
		}

		break;
	}
	}

	return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/638299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638299</guid><dc:creator><![CDATA[++c++]]></dc:creator><pubDate>Tue, 26 Oct 2004 20:29:19 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 20:33:18 GMT]]></title><description><![CDATA[<p>@MiC++ha</p>
<p>An das mit dem unsichtbaren Fenster hab ich auch schon gedacht, aber obwohl da hat ich immer nen CreatDialog Fehler...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638302</guid><dc:creator><![CDATA[++C++]]></dc:creator><pubDate>Tue, 26 Oct 2004 20:33:18 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 20:53:55 GMT]]></title><description><![CDATA[<p>Sag mal gehst du beim Coden logisch vor, oder bastelst du immer so und so rum und schreibst als Komentar dann hinter &quot;//Schwachsinn&quot;</p>
<p>guck dir das mit dem unsichtbaren Fenster nochmal genau an, oder verwende einen modalen Dialog den du unsichtbar machst, aber in deinem Code sehe ich auch nichts von einem Dialog?</p>
<p>Dein Code, so wie er hier vorliegt, ist im Buch der WinAPI Witze auf Seite 204 abgedruckt.<br />
Wir werden dir sicher helfen, aber dazu muß du erst deine Gedanken reinigen und den Code löschen.<br />
Jetzt fängst du von neuem an, schritt für schritt und mit reichlich überlegung, und wenn du nicht weißt ob A auch das tut wenn B=C ist, dann fragst du, aber rumfummeln ohne Logic, bringt dich nicht weiter.</p>
<p>Am besten finde ich:</p>
<pre><code class="language-cpp">hwnd1 = CreateWindow(szAppName,NULL,NULL,0,0,0,NULL,NULL,hinstance,NULL);
</code></pre>
<p>Warum nicht gleich CreateNull()</p>
<p>Du kannst auch MoveWindow(hwndl,0,0,0,0,true) verwenden, nur dann hast du den Button in der Taskleiste noch, aber auch das lässt sich bewergsteligen, viele Wege führen nach Rom.<br />
Guck dir diese Sachen mit dem Fenster verstecken noch mal genau an, auch andere Beispiele.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638312</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 20:53:55 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 21:03:59 GMT]]></title><description><![CDATA[<p>Lässt sich das überhaupt kompilieren ? - Mir scheint als würde bei CreateWindow z.B. nen Parameter fehlen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638323</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 26 Oct 2004 21:03:59 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 21:11:58 GMT]]></title><description><![CDATA[<p>geeky schrieb:</p>
<blockquote>
<p>Lässt sich das überhaupt kompilieren ? - Mir scheint als würde bei CreateWindow z.B. nen Parameter fehlen...</p>
</blockquote>
<p>Ich probiere das nicht aus, ich liebe mein Computer <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>Edit: stimmt, CreateWindow erwartet 11 Parameter, da sind nur 10.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638327</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 21:11:58 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 21:43:02 GMT]]></title><description><![CDATA[<p>OK, des mit CreatWindow() funzt jetzt aber er macht jetzt das unsichtbare Fenster unsichtbar, bzw. sichtbar obwohl es hwnd1 hat und nicht hwnd <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/638347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638347</guid><dc:creator><![CDATA[++C++]]></dc:creator><pubDate>Tue, 26 Oct 2004 21:43:02 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 22:04:53 GMT]]></title><description><![CDATA[<p>Für WM_HOTKEY Nachrichten brauchst du kein Fenster erstellen. Da diese gepostet werden kannst du sie in der Nachrichtenschleife behandeln.</p>
<pre><code class="language-cpp">MSG message;
while(GetMessage(&amp;message, NULL, 0, 0))
{
    if(message.message == WM_HOTKEY)
    {
        // deine Aktion
    }

    TranslateMessage(&amp;message);
    DispatchMessage(&amp;message);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/638359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638359</guid><dc:creator><![CDATA[ungetestet]]></dc:creator><pubDate>Tue, 26 Oct 2004 22:04:53 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 22:05:52 GMT]]></title><description><![CDATA[<p>Ich glaub ich verstehe jetzt was du vorhast!</p>
<p>Du machst einen kleinen Fehler:<br />
Wenn dein unsichtbares Fenster die HT_CTRL Nachricht erhält, wird ja die WndProc() des unsichtbaren Fensters aufgerufen.<br />
Nun ist deine WndProc() ja so aufgebaut:<br />
LRESULT CALLBACK WndProc (HWND hwnd (&lt;-!!), UINT message, WPARAM wParam, LPARAM lParam)<br />
Wenn du in der WndProc jetzt ShowWindow(hwnd, SW_HIDE); aufrufst - ist dein hwnd nicht dasselbe wie in der WinMain!!!<br />
Deine WndProc kennt das hwnd aus der WinMain überhaupt nicht!</p>
<p>Du müsste also dein &quot;hwnd&quot; als globale Variable anlegen, die du z.B.<br />
controlWnd oder so nennst...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638360</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638360</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 26 Oct 2004 22:05:52 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 22:06:08 GMT]]></title><description><![CDATA[<p>Steht ja auch beim hWnd Parameter:</p>
<p>If this parameter is NULL, WM_HOTKEY messages are posted to the message queue of the calling thread and must be processed in the message loop.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638361</guid><dc:creator><![CDATA[ungetestet]]></dc:creator><pubDate>Tue, 26 Oct 2004 22:06:08 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 22:14:40 GMT]]></title><description><![CDATA[<p>++C++ schrieb:</p>
<blockquote>
<p>OK, des mit CreatWindow() funzt jetzt aber er macht jetzt das <strong>unsichtbare Fenster unsichtbar</strong>, bzw. sichtbar obwohl es hwnd1 hat und nicht hwnd <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
</blockquote>
<p>Sag mal niemmst du Drogen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
<p>@Ungetest<br />
nimmst du auch welche? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /><br />
Für HotKeyRegistrierung brauch ich ein HWND, und für die MesageLoop auch.</p>
<p>@++c++<br />
schmeiß den Code über bord und fummel da drinn nicht mehr rum, das bringt nichts, mach das <strong>vernünftig</strong> von vorn, wir helfen dann auch, aber nicht mit diesem Code als Grundlage.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/41">@geeky</a><br />
Hilfst du mit, wenn er den Code weg schmeißt?<br />
Obwohl, wo für eigentlich? Das machen wir Samstagnacht wenn wir vom Saufen kommen. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/638366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638366</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 22:14:40 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 22:47:04 GMT]]></title><description><![CDATA[<p>MiC++ha: dumm? Das steht in der MSDN das es kein HWND brauch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638372</guid><dc:creator><![CDATA[ungetestet]]></dc:creator><pubDate>Tue, 26 Oct 2004 22:47:04 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 22:55:20 GMT]]></title><description><![CDATA[<p>ungetestet schrieb:</p>
<blockquote>
<p>MiC++ha: dumm? Das steht in der MSDN das es kein HWND brauch.</p>
</blockquote>
<p>Was braucht kein HWND?<br />
Die Nachrichten abfrage? ja<br />
HotKey setzten, nein<br />
Mit MessageLoop meinte ich die &quot;WndProc&quot; <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="😉"
    /> war unglücklich ausgedrückt<br />
und dafür brauch ich wieder ein HWND.</p>
<p>Mal anders gefragt, was pasiert bei Windows wenn ich kein Window erstelle?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638375</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 22:55:20 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 22:57:07 GMT]]></title><description><![CDATA[<blockquote>
<p>Mal anders gefragt, was pasiert bei Windows wenn ich kein Window erstelle?</p>
</blockquote>
<p>Sag mal nimmst du Drogen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/638377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638377</guid><dc:creator><![CDATA[++FU++]]></dc:creator><pubDate>Tue, 26 Oct 2004 22:57:07 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 23:06:39 GMT]]></title><description><![CDATA[<p>++FU++ schrieb:</p>
<blockquote>
<blockquote>
<p>Mal anders gefragt, was pasiert bei Windows wenn ich kein Window erstelle?</p>
</blockquote>
<p>Sag mal nimmst du Drogen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
</blockquote>
<p>Die Frage war schon ernst gemeint, btw. darauf bezogen zu vermeiden das ein Konsolenfenster aufgeht. Viele wissen es nicht, aber wie auch immer, ich liebe ja diese Gegensprüche von Unregistrierten, die dann bei konkreten Fragen nicht mehr Antworten können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638380</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 23:06:39 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 23:42:38 GMT]]></title><description><![CDATA[<p>Stell mal deine Frage vernünftig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638390</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638390</guid><dc:creator><![CDATA[Marita]]></dc:creator><pubDate>Tue, 26 Oct 2004 23:42:38 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 23:48:42 GMT]]></title><description><![CDATA[<p>Marita schrieb:</p>
<blockquote>
<p>Stell mal deine Frage vernünftig.</p>
</blockquote>
<p>Wenn meinst du jetzt damit?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638392</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Tue, 26 Oct 2004 23:48:42 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Tue, 26 Oct 2004 23:53:06 GMT]]></title><description><![CDATA[<p>Deine Micha.</p>
<blockquote>
<p>was pasiert bei Windows wenn ich kein Window erstelle?</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/638394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638394</guid><dc:creator><![CDATA[Marita]]></dc:creator><pubDate>Tue, 26 Oct 2004 23:53:06 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Wed, 27 Oct 2004 00:02:58 GMT]]></title><description><![CDATA[<p>Platform SDK schrieb:</p>
<blockquote>
<p>The system automatically creates a message queue for each thread. If the thread creates one or more windows, a message loop must be provided; this message loop retrieves messages from the thread's message queue and dispatches them to the appropriate window procedures.</p>
<p>Because the system directs messages to individual windows in an application, a thread must create at least one window before starting its message loop. Most applications contain a single thread that creates windows. A typical application registers the window class for its main window, creates and shows the main window, and then starts its message loop — all in the WinMain function.</p>
<p>You create a message loop by using the GetMessage and DispatchMessage functions. If your application must obtain character input from the user, include the TranslateMessage function in the loop. TranslateMessage translates virtual-key messages into character messages. The following example shows the message loop in the WinMain function of a simple Windows-based application.</p>
</blockquote>
<p>Hmm, nu bin ich nich schlüssig <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=";D"
      alt="😉"
    /><br />
Man kann also ne Hotkey-Nachricht kriegen ohne ein Fenster erzeugt zu haben ?<br />
Was laut Doku von RegisterHotKey() einleuchtend klingt, aber wieder irgendwie widersprüchlich mit &quot;a thread must create at least one window before starting its message loop.&quot; klingt...<br />
Naja, ich vermute mal DispatchMessage() in der message-loop wird dann eben die WndProc() gar nicht aufrufen, aber was steht dann in der MSG-Struktur als HWND ? - NULL ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638395</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Wed, 27 Oct 2004 00:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Wed, 27 Oct 2004 00:25:18 GMT]]></title><description><![CDATA[<p>Marita schrieb:</p>
<blockquote>
<p>Deine Micha.</p>
<blockquote>
<p>was pasiert bei Windows wenn ich kein Window erstelle?</p>
</blockquote>
</blockquote>
<p>Diese Frage ist doch vernünftig gestellt, und auch als solche zu 100% zu sehen.<br />
Was passiert?<br />
A - Es öfnet sich ein Konsolenfenster<br />
B - Es passiert gar nichts, aber mein Prog ist im Taskmanager zu sehen<br />
C - Ich bekomme Fehlermeldungen von Windows<br />
D - garnichts, aber ich kann Windows auch nicht verwenden, bzw. seine Funktionen die sich auf ein Fenster-Handle beziehen.</p>
<p>Ungetestet hat es doch schon vorgegeben:</p>
<blockquote>
<p>If this parameter is NULL, WM_HOTKEY messages are posted to the message queue of the calling thread and must be processed in the message loop.</p>
</blockquote>
<p>Das geht auch, aber nur wenn ich einen WndProc habe die das verarbeitet und dazu brauch ich ein Fenster.<br />
@Marita, die Frage war mehr als Ironie zu sehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638400</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Wed, 27 Oct 2004 00:25:18 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Wed, 27 Oct 2004 00:27:59 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/41">@geeky</a><br />
genau das mein ich bei diesem ganzen &quot;Mediamarkt&quot;-Spiel hier <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/638402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638402</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Wed, 27 Oct 2004 00:27:59 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Wed, 27 Oct 2004 00:40:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	RegisterHotKey(NULL, 1000, MOD_ALT, 'S');

	MSG message;
	while(GetMessage(&amp;message, NULL, 0, 0))
	{
		if(message.message == WM_HOTKEY)
		{
			MessageBox(NULL, TEXT(&quot;Beende Anwendung...&quot;), TEXT(&quot;Info&quot;), MB_OK);
			PostQuitMessage(0);
		}

		DispatchMessage(&amp;message);
	}

	return message.wParam;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/638410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638410</guid><dc:creator><![CDATA[ALT + S]]></dc:creator><pubDate>Wed, 27 Oct 2004 00:40:43 GMT</pubDate></item><item><title><![CDATA[Reply to HWND und Message Problem on Wed, 27 Oct 2004 01:03:44 GMT]]></title><description><![CDATA[<p>ALT + S schrieb:</p>
<blockquote>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	RegisterHotKey(NULL, 1000, MOD_ALT, 'S');
	
	MSG message;
	while(GetMessage(&amp;message, NULL, 0, 0))
	{
		if(message.message == WM_HOTKEY)
		{
			MessageBox(NULL, TEXT(&quot;Beende Anwendung...&quot;), TEXT(&quot;Info&quot;), MB_OK);
			PostQuitMessage(0);
		}
		
		DispatchMessage(&amp;message);
	}
	
	return message.wParam;
}
</code></pre>
</blockquote>
<p>Jetzt mal erlich, das kennt doch jede sau, nur deine MesaggeBox will nen Handle und da giebst du den Desktop an, da aber dein Prog aktive ist siehst du die Messagebox nur als Button in der Taskleiste.<br />
Um alle vorzüge nutzen zu können wäre ein HWND immer zum vorteil.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638413</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638413</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Wed, 27 Oct 2004 01:03:44 GMT</pubDate></item></channel></rss>