<?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[Problem mit hbutton]]></title><description><![CDATA[<p>Hi Leute:</p>
<p>Ich hab mal ein klavir auf Winapi geschrieben und es funtz eigenlich wunderbar , aber wenn ich mehrere knöpf gleichzeitig drücken will funtz das nicht mehr</p>
<p>ps: den code hab ich von <a href="http://heneksoft.de" rel="nofollow">heneksoft.de</a> /win32 programmierung ..</p>
<p>und immer wenn ich den code das 2te mal complieren möchte , schießt &quot;Dev Cpp&quot; ab - genau so wie alle anderen complirer</p>
<p>hier der ganze code: (fals wer noch anderes damit vor hat *g* :D:P )</p>
<p>(laüft erst mit den WINMM sound linker )</p>
<p>und noch was: wie wird der code in son weisen kästchen wieder gegeben?</p>
<p>#include &lt;windows.h&gt;<br />
#include &lt;stdio.h&gt;<br />
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);<br />
int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, PSTR szCmdLine, int iCmdShow)<br />
{<br />
char szName[] = &quot;Fensterklasse&quot;;<br />
HBRUSH MyBrush = CreateSolidBrush( RGB( 0, 150, 255 ) );<br />
WNDCLASS wc;</p>
<p>wc.style = CS_HREDRAW | CS_VREDRAW;<br />
wc.lpfnWndProc = WndProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hI;<br />
wc.hIcon = LoadIcon (NULL, IDI_WINLOGO);<br />
wc.hCursor = 0;<br />
wc.hbrBackground = MyBrush;<br />
wc.lpszMenuName = NULL;<br />
wc.lpszClassName = szName;</p>
<p>RegisterClass (&amp;wc);</p>
<p>HWND hwnd = CreateWindow (szName, &quot;Interaktives Fenster&quot;, WS_OVERLAPPEDWINDOW,<br />
0, 0, 400, 100, NULL, NULL, hI, NULL);<br />
ShowWindow (hwnd, iCmdShow);<br />
UpdateWindow (hwnd);</p>
<p>//-----------------------------------------------------------------------------------</p>
<p>MSG msg;</p>
<p>while (GetMessage (&amp;msg, NULL, 0, 0))<br />
{<br />
TranslateMessage (&amp;msg);<br />
DispatchMessage (&amp;msg);<br />
}<br />
return msg.wParam;<br />
}</p>
<p>//-----------------------------------------------------------------------------------</p>
<p>LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
HDC hdc;<br />
PAINTSTRUCT ps;</p>
<p>HWND hwndButton1, hwndButton2,hwndButton3, hwndButton4,hwndButton5, hwndButton6,hwndButton7,hwndButton8;</p>
<p>switch (message)<br />
{</p>
<p>return 0;</p>
<p>case WM_CREATE :</p>
<p>hwndButton8 = CreateWindow ( &quot;button&quot;, &quot;c&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
140, 20, 20, 40, hwnd, (HMENU)8,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton7 = CreateWindow ( &quot;button&quot;, &quot;h&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
120, 20, 20, 40, hwnd, (HMENU)7,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton6 = CreateWindow ( &quot;button&quot;, &quot;a&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
100, 20, 20, 40, hwnd, (HMENU)6,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton5 = CreateWindow ( &quot;button&quot;, &quot;g&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
80, 20, 20, 40, hwnd, (HMENU)5,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton4 = CreateWindow ( &quot;button&quot;, &quot;f&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
60, 20, 20, 40, hwnd, (HMENU)4,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton2 = CreateWindow ( &quot;button&quot;, &quot;e&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
40, 20, 20, 40, hwnd, (HMENU)3,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton2 = CreateWindow ( &quot;button&quot;, &quot;d&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
20, 20, 20, 40, hwnd, (HMENU)2,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton1 = CreateWindow ( &quot;button&quot;, &quot;c&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
0, 20, 20, 40, hwnd, (HMENU)1,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
return 0;</p>
<p>case WM_COMMAND:<br />
if(LOWORD(wParam) == <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--smiling_face_with_sunglasses"
      title="8)"
      alt="😎"
    /><br />
{<br />
PlaySound(&quot;c2.wav&quot;, NULL,SND_FILENAME);}<br />
if(LOWORD(wParam) == 7)<br />
{<br />
PlaySound(&quot;h.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 6)<br />
{<br />
PlaySound(&quot;a.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 5)<br />
{<br />
PlaySound(&quot;g.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 4)<br />
{<br />
PlaySound(&quot;f.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 3)<br />
{<br />
PlaySound(&quot;e.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 2)<br />
{<br />
PlaySound(&quot;d.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 1)<br />
{<br />
PlaySound(&quot;c.wav&quot;, NULL, SND_FILENAME);}<br />
return 0;<br />
}</p>
<p>return DefWindowProc (hwnd, message, wParam, lParam);<br />
}<br />
]</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/188448/problem-mit-hbutton</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 14:38:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/188448.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 31 Jul 2007 13:35:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit hbutton on Tue, 31 Jul 2007 13:35:25 GMT]]></title><description><![CDATA[<p>Hi Leute:</p>
<p>Ich hab mal ein klavir auf Winapi geschrieben und es funtz eigenlich wunderbar , aber wenn ich mehrere knöpf gleichzeitig drücken will funtz das nicht mehr</p>
<p>ps: den code hab ich von <a href="http://heneksoft.de" rel="nofollow">heneksoft.de</a> /win32 programmierung ..</p>
<p>und immer wenn ich den code das 2te mal complieren möchte , schießt &quot;Dev Cpp&quot; ab - genau so wie alle anderen complirer</p>
<p>hier der ganze code: (fals wer noch anderes damit vor hat *g* :D:P )</p>
<p>(laüft erst mit den WINMM sound linker )</p>
<p>und noch was: wie wird der code in son weisen kästchen wieder gegeben?</p>
<p>#include &lt;windows.h&gt;<br />
#include &lt;stdio.h&gt;<br />
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);<br />
int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, PSTR szCmdLine, int iCmdShow)<br />
{<br />
char szName[] = &quot;Fensterklasse&quot;;<br />
HBRUSH MyBrush = CreateSolidBrush( RGB( 0, 150, 255 ) );<br />
WNDCLASS wc;</p>
<p>wc.style = CS_HREDRAW | CS_VREDRAW;<br />
wc.lpfnWndProc = WndProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hI;<br />
wc.hIcon = LoadIcon (NULL, IDI_WINLOGO);<br />
wc.hCursor = 0;<br />
wc.hbrBackground = MyBrush;<br />
wc.lpszMenuName = NULL;<br />
wc.lpszClassName = szName;</p>
<p>RegisterClass (&amp;wc);</p>
<p>HWND hwnd = CreateWindow (szName, &quot;Interaktives Fenster&quot;, WS_OVERLAPPEDWINDOW,<br />
0, 0, 400, 100, NULL, NULL, hI, NULL);<br />
ShowWindow (hwnd, iCmdShow);<br />
UpdateWindow (hwnd);</p>
<p>//-----------------------------------------------------------------------------------</p>
<p>MSG msg;</p>
<p>while (GetMessage (&amp;msg, NULL, 0, 0))<br />
{<br />
TranslateMessage (&amp;msg);<br />
DispatchMessage (&amp;msg);<br />
}<br />
return msg.wParam;<br />
}</p>
<p>//-----------------------------------------------------------------------------------</p>
<p>LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
HDC hdc;<br />
PAINTSTRUCT ps;</p>
<p>HWND hwndButton1, hwndButton2,hwndButton3, hwndButton4,hwndButton5, hwndButton6,hwndButton7,hwndButton8;</p>
<p>switch (message)<br />
{</p>
<p>return 0;</p>
<p>case WM_CREATE :</p>
<p>hwndButton8 = CreateWindow ( &quot;button&quot;, &quot;c&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
140, 20, 20, 40, hwnd, (HMENU)8,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton7 = CreateWindow ( &quot;button&quot;, &quot;h&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
120, 20, 20, 40, hwnd, (HMENU)7,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton6 = CreateWindow ( &quot;button&quot;, &quot;a&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
100, 20, 20, 40, hwnd, (HMENU)6,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton5 = CreateWindow ( &quot;button&quot;, &quot;g&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
80, 20, 20, 40, hwnd, (HMENU)5,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton4 = CreateWindow ( &quot;button&quot;, &quot;f&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
60, 20, 20, 40, hwnd, (HMENU)4,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton2 = CreateWindow ( &quot;button&quot;, &quot;e&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
40, 20, 20, 40, hwnd, (HMENU)3,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton2 = CreateWindow ( &quot;button&quot;, &quot;d&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
20, 20, 20, 40, hwnd, (HMENU)2,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
hwndButton1 = CreateWindow ( &quot;button&quot;, &quot;c&quot;,<br />
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,<br />
0, 20, 20, 40, hwnd, (HMENU)1,<br />
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);<br />
return 0;</p>
<p>case WM_COMMAND:<br />
if(LOWORD(wParam) == <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--smiling_face_with_sunglasses"
      title="8)"
      alt="😎"
    /><br />
{<br />
PlaySound(&quot;c2.wav&quot;, NULL,SND_FILENAME);}<br />
if(LOWORD(wParam) == 7)<br />
{<br />
PlaySound(&quot;h.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 6)<br />
{<br />
PlaySound(&quot;a.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 5)<br />
{<br />
PlaySound(&quot;g.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 4)<br />
{<br />
PlaySound(&quot;f.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 3)<br />
{<br />
PlaySound(&quot;e.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 2)<br />
{<br />
PlaySound(&quot;d.wav&quot;, NULL, SND_FILENAME);}<br />
if(LOWORD(wParam) == 1)<br />
{<br />
PlaySound(&quot;c.wav&quot;, NULL, SND_FILENAME);}<br />
return 0;<br />
}</p>
<p>return DefWindowProc (hwnd, message, wParam, lParam);<br />
}<br />
]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1335779</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1335779</guid><dc:creator><![CDATA[poltergeist]]></dc:creator><pubDate>Tue, 31 Jul 2007 13:35:25 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit hbutton on Tue, 31 Jul 2007 13:59:03 GMT]]></title><description><![CDATA[<p>mach ein [ cpp ] und [/ cpp] drum, OHNE die Leerzeichen zwischen den Klammern. Vorher wird sich das auch keiner ansehen wollen... <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1335820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1335820</guid><dc:creator><![CDATA[mad_martin]]></dc:creator><pubDate>Tue, 31 Jul 2007 13:59:03 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit hbutton on Tue, 31 Jul 2007 15:47:55 GMT]]></title><description><![CDATA[<p>Du suchst bestimmt SND_ASYNC (siehe PlaySound() in der msdn)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1335946</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1335946</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 31 Jul 2007 15:47:55 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit hbutton on Tue, 31 Jul 2007 19:03:07 GMT]]></title><description><![CDATA[<p>JOOO DANKE!!! <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1336075</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336075</guid><dc:creator><![CDATA[poltergeist]]></dc:creator><pubDate>Tue, 31 Jul 2007 19:03:07 GMT</pubDate></item></channel></rss>