<?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[bis MessageBox erscheint]]></title><description><![CDATA[<p>Hallo,<br />
hier erstmal der Quellcode:<br />
[cpp]<br />
#include &lt;windows.h&gt;</p>
<p>LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;</p>
<p>int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
PSTR szCmdLine, int iCmdShow)<br />
{<br />
static TCHAR szAppName[] = TEXT (&quot;Systemmenü&quot;) ;<br />
HWND hwnd ;<br />
MSG msg ;<br />
WNDCLASS wndclass ;</p>
<p>wndclass.style = CS_HREDRAW | CS_VREDRAW ;<br />
wndclass.lpfnWndProc = WndProc ;<br />
wndclass.cbClsExtra = 0 ;<br />
wndclass.cbWndExtra = 0 ;<br />
wndclass.hInstance = hInstance ;<br />
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;<br />
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;<br />
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;<br />
wndclass.lpszMenuName = NULL ;<br />
wndclass.lpszClassName = szAppName ;</p>
<p>if (!RegisterClass (&amp;wndclass))<br />
{ // UNICODE-Compilierung ist die einzige realistische Fehlermöglichkeit<br />
MessageBox (NULL, TEXT (&quot;Programm arbeitet mit Unicode und setzt Windows NT voraus!&quot;),<br />
szAppName, MB_ICONERROR) ;<br />
return 0 ;<br />
}</p>
<p>hwnd = CreateWindow (szAppName, // Name der Fensterklasse<br />
szAppName, // Fenstertitel<br />
WS_OVERLAPPEDWINDOW, // Fensterstil<br />
CW_USEDEFAULT, // X-Position des Fensters<br />
CW_USEDEFAULT, // Y-Position des Fensters<br />
CW_USEDEFAULT, // Fensterbreite<br />
CW_USEDEFAULT, // Fensterhöhe<br />
NULL, // übergeordnetes Fenster<br />
NULL, // Menü<br />
hInstance, // Programm-Kopiezähler (Programm-ID)<br />
NULL) ; // zusätzliche Parameter</p>
<p>ShowWindow (hwnd, iCmdShow) ;<br />
UpdateWindow (hwnd) ;<br />
HMENU hmenu = GetSystemMenu(hwnd, FALSE);<br />
AppendMenu(hmenu, MF_SEPARATOR, 0, 0);<br />
AppendMenu(hmenu, MF_STRING, 1, TEXT(&quot;INFOOO&quot;));<br />
DeleteMenu(hmenu, 0, MF_BYPOSITION);<br />
DeleteMenu(hmenu, 1, MF_BYPOSITION);<br />
DeleteMenu(hmenu, 2, MF_BYPOSITION);<br />
DeleteMenu(hmenu, 3, MF_BYPOSITION);<br />
AppendMenu(hmenu, MF_STRING, 2, TEXT(&quot;Close&quot;));<br />
while (GetMessage (&amp;msg, NULL, 0, 0))<br />
{<br />
TranslateMessage (&amp;msg) ;<br />
DispatchMessage (&amp;msg) ;<br />
}<br />
return msg.wParam ;<br />
}</p>
<p>LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (message)<br />
{<br />
case WM_CREATE:<br />
return 0 ;</p>
<p>case WM_PAINT:<br />
return 0 ;</p>
<p>case WM_DESTROY:<br />
PostQuitMessage (0) ;<br />
return 0 ;<br />
case WM_SYSCOMMAND:<br />
switch(LOWORD(wParam))<br />
{<br />
case 1:<br />
MessageBox(hwnd, TEXT(&quot;INFO&quot;), TEXT(&quot;Information&quot;), 0);<br />
GetSystemMenu(hwnd, TRUE);<br />
return 0;<br />
case 2:<br />
SendMessage(hwnd, WM_CLOSE, 0, 0);<br />
return 0;<br />
}<br />
break;<br />
}<br />
return DefWindowProc (hwnd, message, wParam, lParam) ;<br />
}</p>
<p>Also das Problem ist das wenn man About klickt das es zirka 1 minute dauernt bist die MessageBox bei case 1 erscheint. was ist der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/220271/bis-messagebox-erscheint</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 02:01:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/220271.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Aug 2008 20:54:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to bis MessageBox erscheint on Wed, 13 Aug 2008 20:54:09 GMT]]></title><description><![CDATA[<p>Hallo,<br />
hier erstmal der Quellcode:<br />
[cpp]<br />
#include &lt;windows.h&gt;</p>
<p>LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;</p>
<p>int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
PSTR szCmdLine, int iCmdShow)<br />
{<br />
static TCHAR szAppName[] = TEXT (&quot;Systemmenü&quot;) ;<br />
HWND hwnd ;<br />
MSG msg ;<br />
WNDCLASS wndclass ;</p>
<p>wndclass.style = CS_HREDRAW | CS_VREDRAW ;<br />
wndclass.lpfnWndProc = WndProc ;<br />
wndclass.cbClsExtra = 0 ;<br />
wndclass.cbWndExtra = 0 ;<br />
wndclass.hInstance = hInstance ;<br />
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;<br />
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;<br />
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;<br />
wndclass.lpszMenuName = NULL ;<br />
wndclass.lpszClassName = szAppName ;</p>
<p>if (!RegisterClass (&amp;wndclass))<br />
{ // UNICODE-Compilierung ist die einzige realistische Fehlermöglichkeit<br />
MessageBox (NULL, TEXT (&quot;Programm arbeitet mit Unicode und setzt Windows NT voraus!&quot;),<br />
szAppName, MB_ICONERROR) ;<br />
return 0 ;<br />
}</p>
<p>hwnd = CreateWindow (szAppName, // Name der Fensterklasse<br />
szAppName, // Fenstertitel<br />
WS_OVERLAPPEDWINDOW, // Fensterstil<br />
CW_USEDEFAULT, // X-Position des Fensters<br />
CW_USEDEFAULT, // Y-Position des Fensters<br />
CW_USEDEFAULT, // Fensterbreite<br />
CW_USEDEFAULT, // Fensterhöhe<br />
NULL, // übergeordnetes Fenster<br />
NULL, // Menü<br />
hInstance, // Programm-Kopiezähler (Programm-ID)<br />
NULL) ; // zusätzliche Parameter</p>
<p>ShowWindow (hwnd, iCmdShow) ;<br />
UpdateWindow (hwnd) ;<br />
HMENU hmenu = GetSystemMenu(hwnd, FALSE);<br />
AppendMenu(hmenu, MF_SEPARATOR, 0, 0);<br />
AppendMenu(hmenu, MF_STRING, 1, TEXT(&quot;INFOOO&quot;));<br />
DeleteMenu(hmenu, 0, MF_BYPOSITION);<br />
DeleteMenu(hmenu, 1, MF_BYPOSITION);<br />
DeleteMenu(hmenu, 2, MF_BYPOSITION);<br />
DeleteMenu(hmenu, 3, MF_BYPOSITION);<br />
AppendMenu(hmenu, MF_STRING, 2, TEXT(&quot;Close&quot;));<br />
while (GetMessage (&amp;msg, NULL, 0, 0))<br />
{<br />
TranslateMessage (&amp;msg) ;<br />
DispatchMessage (&amp;msg) ;<br />
}<br />
return msg.wParam ;<br />
}</p>
<p>LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (message)<br />
{<br />
case WM_CREATE:<br />
return 0 ;</p>
<p>case WM_PAINT:<br />
return 0 ;</p>
<p>case WM_DESTROY:<br />
PostQuitMessage (0) ;<br />
return 0 ;<br />
case WM_SYSCOMMAND:<br />
switch(LOWORD(wParam))<br />
{<br />
case 1:<br />
MessageBox(hwnd, TEXT(&quot;INFO&quot;), TEXT(&quot;Information&quot;), 0);<br />
GetSystemMenu(hwnd, TRUE);<br />
return 0;<br />
case 2:<br />
SendMessage(hwnd, WM_CLOSE, 0, 0);<br />
return 0;<br />
}<br />
break;<br />
}<br />
return DefWindowProc (hwnd, message, wParam, lParam) ;<br />
}</p>
<p>Also das Problem ist das wenn man About klickt das es zirka 1 minute dauernt bist die MessageBox bei case 1 erscheint. was ist der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1564352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564352</guid><dc:creator><![CDATA[1 minute]]></dc:creator><pubDate>Wed, 13 Aug 2008 20:54:09 GMT</pubDate></item><item><title><![CDATA[Reply to bis MessageBox erscheint on Wed, 13 Aug 2008 20:55:01 GMT]]></title><description><![CDATA[<p>verdammt close tag vergessen:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT (&quot;Systemmenü&quot;) ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;

wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;

if (!RegisterClass (&amp;wndclass))
{ // UNICODE-Compilierung ist die einzige realistische Fehlermöglichkeit
MessageBox (NULL, TEXT (&quot;Programm arbeitet mit Unicode und setzt Windows NT voraus!&quot;),
szAppName, MB_ICONERROR) ;
return 0 ;
}

hwnd = CreateWindow (szAppName, // Name der Fensterklasse
szAppName, // Fenstertitel
WS_OVERLAPPEDWINDOW, // Fensterstil
CW_USEDEFAULT, // X-Position des Fensters
CW_USEDEFAULT, // Y-Position des Fensters
CW_USEDEFAULT, // Fensterbreite
CW_USEDEFAULT, // Fensterhöhe
NULL, // übergeordnetes Fenster
NULL, // Menü
hInstance, // Programm-Kopiezähler (Programm-ID)
NULL) ; // zusätzliche Parameter

ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
HMENU hmenu = GetSystemMenu(hwnd, FALSE);
AppendMenu(hmenu, MF_SEPARATOR, 0, 0);
AppendMenu(hmenu, MF_STRING, 1, TEXT(&quot;INFOOO&quot;));
DeleteMenu(hmenu, 0, MF_BYPOSITION);
DeleteMenu(hmenu, 1, MF_BYPOSITION);
DeleteMenu(hmenu, 2, MF_BYPOSITION);
DeleteMenu(hmenu, 3, MF_BYPOSITION);
AppendMenu(hmenu, MF_STRING, 2, TEXT(&quot;Close&quot;));
while (GetMessage (&amp;msg, NULL, 0, 0))
{
TranslateMessage (&amp;msg) ;
DispatchMessage (&amp;msg) ;
}
return msg.wParam ;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
return 0 ;

case WM_PAINT:
return 0 ;

case WM_DESTROY:
PostQuitMessage (0) ;
return 0 ;
case WM_SYSCOMMAND:
switch(LOWORD(wParam))
{
case 1:
MessageBox(hwnd, TEXT(&quot;INFO&quot;), TEXT(&quot;Information&quot;), 0);
GetSystemMenu(hwnd, TRUE);
return 0;
case 2:
SendMessage(hwnd, WM_CLOSE, 0, 0);
return 0;
}
break;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1564353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564353</guid><dc:creator><![CDATA[1 Minute]]></dc:creator><pubDate>Wed, 13 Aug 2008 20:55:01 GMT</pubDate></item><item><title><![CDATA[Reply to bis MessageBox erscheint on Wed, 13 Aug 2008 22:14:48 GMT]]></title><description><![CDATA[<p>omg das Programm braucht 40% prozessorleistung<br />
da muss doch was falschgelaufen sein -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1564383</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564383</guid><dc:creator><![CDATA[1 Minute]]></dc:creator><pubDate>Wed, 13 Aug 2008 22:14:48 GMT</pubDate></item><item><title><![CDATA[Reply to bis MessageBox erscheint on Thu, 14 Aug 2008 06:55:39 GMT]]></title><description><![CDATA[<p>1. Wäre einrücken ganz nett<br />
2. versuchs mal unter WM_COMMAND und nicht WM_SYSCOMMAND<br />
3. Schreibt du in den cases immer ein return und am Ende des WM_ ein break, es gehört genau anders herum</p>
<p>Greetz Tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1564455</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564455</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Thu, 14 Aug 2008 06:55:39 GMT</pubDate></item><item><title><![CDATA[Reply to bis MessageBox erscheint on Thu, 14 Aug 2008 06:53:43 GMT]]></title><description><![CDATA[<p>1 Minute schrieb:</p>
<blockquote>
<p>verdammt close tag vergessen:</p>
</blockquote>
<p>&quot;Ein&quot; Post hätte trotzdem gereicht.</p>
<pre><code class="language-cpp">case WM_PAINT:
return 0 ;
</code></pre>
<p>Wer eine WM_PAINT abfängt, muss sie auch mit BeginPaint(...) EndPaint(...) verarbeiten, oder an DefWindowProc(..) weiter leiten.</p>
<p>Lösch die Zeilen und es funktioniert.</p>
<p>MfG Wally <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/1564456</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564456</guid><dc:creator><![CDATA[Wally]]></dc:creator><pubDate>Thu, 14 Aug 2008 06:53:43 GMT</pubDate></item><item><title><![CDATA[Reply to bis MessageBox erscheint on Thu, 14 Aug 2008 07:04:44 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>3. Schreibt du in den cases immer ein return und am Ende des WM_ ein break, es gehört genau anders herum<br />
Greetz Tobi</p>
</blockquote>
<p>Da geb ich dir so nicht recht, für die WM_* Nachrichten sollte man den Wert zurückgeben den MS in der MSDN empfiehlt, man kann auch andere Werte returnieren z.B. DefWindowProc(..), aber dann sollte man schon wissen was man macht und warum man es so macht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1564459</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564459</guid><dc:creator><![CDATA[case case]]></dc:creator><pubDate>Thu, 14 Aug 2008 07:04:44 GMT</pubDate></item><item><title><![CDATA[Reply to bis MessageBox erscheint on Thu, 14 Aug 2008 07:14:24 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/443">@case</a> case</p>
<p>Man &quot;muss&quot; DefWindowsProc(..) zurückgeben, wenn man die Nachricht nicht behandelt bzw. eine Begin-/EndPaint(..) Kombi aufruft. Wenn man Sie behandelt kann man eigentlich zurückgeben, was man möchte.</p>
<p>MfG Wally</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1564465</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564465</guid><dc:creator><![CDATA[Wally]]></dc:creator><pubDate>Thu, 14 Aug 2008 07:14:24 GMT</pubDate></item><item><title><![CDATA[Reply to bis MessageBox erscheint on Thu, 14 Aug 2008 07:32:39 GMT]]></title><description><![CDATA[<p>danke Wally ohne WM_PAINT gehts.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1564473</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1564473</guid><dc:creator><![CDATA[1 Minute]]></dc:creator><pubDate>Thu, 14 Aug 2008 07:32:39 GMT</pubDate></item></channel></rss>