<?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[Butten Klick-Event obwohl nicht geklickt wurde]]></title><description><![CDATA[<p>Ich programmiere mit Microsoft Visual C++ 6.0<br />
Ich habe eine einfache Anwendung erstellt, mithilfe des Resourceneditors – mir ist jedoch aufgefallen das die Buttons auf meiner Resource manchmal Klick-Events melden, wenn gar keine stattgefunden haben:</p>
<p>Hier der Programmcode:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;
#include &quot;resource.h&quot;

BOOL CALLBACK AudioPlayer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
	case WM_CLOSE:

		EndDialog(hwndDlg, 0);
		break;
	case WM_INITDIALOG:
		break;

	default:
		break;
	}

	switch(LOWORD(wParam))
	{
	case BUTTON_PLAY1:
		MessageBox(NULL, &quot;Play1&quot;, &quot;&quot;, MB_OK);
		break;
	case BUTTON_STOP1:
		MessageBox(NULL, &quot;Stop1&quot;, &quot;&quot;, MB_OK);
		break;
	case BUTTON_PAUSE1:

		break;
	case BUTTON_PLAY2:

		break;
	case BUTTON_STOP2:

		break;
	case BUTTON_PAUSE2:

		break;
	case BUTTON_OEFFNEN1:

		break;
	case BUTTON_OEFFNEN2:

		break;
	default:
		break;
	}

	return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{	
	// Initialisere Common Controls DLL
    InitCommonControls();

	// Dialog oeffnen
	DialogBox(hInstance, MAKEINTRESOURCE(DIALOG_SCAW_PLAYER), NULL, AudioPlayer);

	// Kein Fehler aufgetreten
	return 0;
}
</code></pre>
<p>Hier mein Dialog:<br />
[url]<br />
<a href="http://people.freenet.de/vertexwahn/dialog.JPG" rel="nofollow">http://people.freenet.de/vertexwahn/dialog.JPG</a><br />
[/url]</p>
<p>Schon beim Start des Programmes kommt eine MessageBox die angibt, dass BUTTON_STOP1 geklickt wurde<br />
Was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/75329/butten-klick-event-obwohl-nicht-geklickt-wurde</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 23:45:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/75329.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 30 May 2004 11:40:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Butten Klick-Event obwohl nicht geklickt wurde on Sun, 30 May 2004 11:40:47 GMT]]></title><description><![CDATA[<p>Ich programmiere mit Microsoft Visual C++ 6.0<br />
Ich habe eine einfache Anwendung erstellt, mithilfe des Resourceneditors – mir ist jedoch aufgefallen das die Buttons auf meiner Resource manchmal Klick-Events melden, wenn gar keine stattgefunden haben:</p>
<p>Hier der Programmcode:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;
#include &quot;resource.h&quot;

BOOL CALLBACK AudioPlayer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
	case WM_CLOSE:

		EndDialog(hwndDlg, 0);
		break;
	case WM_INITDIALOG:
		break;

	default:
		break;
	}

	switch(LOWORD(wParam))
	{
	case BUTTON_PLAY1:
		MessageBox(NULL, &quot;Play1&quot;, &quot;&quot;, MB_OK);
		break;
	case BUTTON_STOP1:
		MessageBox(NULL, &quot;Stop1&quot;, &quot;&quot;, MB_OK);
		break;
	case BUTTON_PAUSE1:

		break;
	case BUTTON_PLAY2:

		break;
	case BUTTON_STOP2:

		break;
	case BUTTON_PAUSE2:

		break;
	case BUTTON_OEFFNEN1:

		break;
	case BUTTON_OEFFNEN2:

		break;
	default:
		break;
	}

	return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{	
	// Initialisere Common Controls DLL
    InitCommonControls();

	// Dialog oeffnen
	DialogBox(hInstance, MAKEINTRESOURCE(DIALOG_SCAW_PLAYER), NULL, AudioPlayer);

	// Kein Fehler aufgetreten
	return 0;
}
</code></pre>
<p>Hier mein Dialog:<br />
[url]<br />
<a href="http://people.freenet.de/vertexwahn/dialog.JPG" rel="nofollow">http://people.freenet.de/vertexwahn/dialog.JPG</a><br />
[/url]</p>
<p>Schon beim Start des Programmes kommt eine MessageBox die angibt, dass BUTTON_STOP1 geklickt wurde<br />
Was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/529722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/529722</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Sun, 30 May 2004 11:40:47 GMT</pubDate></item><item><title><![CDATA[Reply to Butten Klick-Event obwohl nicht geklickt wurde on Sun, 30 May 2004 12:16:26 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>du machst es dir ein wenig zu einfach, so kann man Ereignisse nicht abfragen, schließlich gibt es auch noch andere Nachrichten, deren LOWORD(wParam)) mit der ID BUTTON_STOP1 übereinstimmt. Richtig ist: du mußt WM_COMMAND abfangen (siehe MSDN), und dann bekommt du in HIWORD(wParam) die Nachricht BN_CLICKED geliefert, und weißt erst jetzt, daß wirklich ein Button geklickt wurde (welcher das ist, steht dann wiederum in LOWORD(wParam) (ID) bzw. in lparam, wenn das Handle interessant ist.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/529744</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/529744</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Sun, 30 May 2004 12:16:26 GMT</pubDate></item></channel></rss>