<?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[zwei leere Fenster anzeigen]]></title><description><![CDATA[<p>ich möchte nichts anderes als zwei leere Fenster anzeigen:<br />
Fenster1 wird angezeigt... Fenster2 nicht - warum?</p>
<pre><code class="language-cpp">//-----------------------------------------------------------------------------
// Defines

#define WIN32_LEAN_AND_MEAN // MFC wird nicht benoetigt

//-----------------------------------------------------------------------------
// Header

#include &lt;windows.h&gt;
#include &lt;TCHAR.h&gt;

//-----------------------------------------------------------------------------
// Event Handler
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	switch(msg)
	{
		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;

		default: break;
	}

	return (DefWindowProc(hwnd, msg, wparam, lparam));
}

//-----------------------------------------------------------------------------
// Main
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdline, int nCmdShow)
{
	WNDCLASSEX winclass;
	winclass.cbSize = sizeof(WNDCLASSEX);
	winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
	winclass.lpfnWndProc = WindowProc;
	winclass.cbClsExtra = 0; // extra class info space
	winclass.cbWndExtra = 0; // extra window info space
	winclass.hInstance = hInstance; // assign the application instance
	winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	winclass.lpszMenuName = NULL; // the name of the menu to attach
	winclass.lpszClassName = __T(&quot;WINCLASS1&quot;); // the name of the class itself
	winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	RegisterClassEx(&amp;winclass);
	HWND hwnd;
	hwnd = CreateWindowEx(	NULL,
							__T(&quot;WINCLASS1&quot;),
							__T(&quot;Fenstertitel&quot;),
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							0,
							0,
							200,
							200,
							NULL, // handle to parent
							NULL, // handle to menu
							hInstance, // instance of this application
							NULL);

	if(hwnd==NULL)
		return -10;

	// create a second window
	HWND hwnd2;
	hwnd2 = CreateWindowEx(	NULL,
							__T(&quot;WINCLASS1&quot;),
							__T(&quot;Fenster 2&quot;),
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							0,
							0,
							300,
							300,
							NULL, // handle to parent
							NULL, // handle to menu
							hInstance, // instance of this application
							NULL);

	if(hwnd2==NULL)
		return -11;

	UpdateWindow(hwnd2);
	ShowWindow(hwnd2, 0);

	MSG msg;
	while(GetMessage(&amp;msg, NULL, 0, 0))
	{
		// translate any accelerator keys
		TranslateMessage(&amp;msg);
		// send the message to the window proc
		DispatchMessage(&amp;msg);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/133797/zwei-leere-fenster-anzeigen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 07:56:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133797.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Jan 2006 20:49:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to zwei leere Fenster anzeigen on Fri, 20 Jan 2006 20:49:06 GMT]]></title><description><![CDATA[<p>ich möchte nichts anderes als zwei leere Fenster anzeigen:<br />
Fenster1 wird angezeigt... Fenster2 nicht - warum?</p>
<pre><code class="language-cpp">//-----------------------------------------------------------------------------
// Defines

#define WIN32_LEAN_AND_MEAN // MFC wird nicht benoetigt

//-----------------------------------------------------------------------------
// Header

#include &lt;windows.h&gt;
#include &lt;TCHAR.h&gt;

//-----------------------------------------------------------------------------
// Event Handler
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	switch(msg)
	{
		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;

		default: break;
	}

	return (DefWindowProc(hwnd, msg, wparam, lparam));
}

//-----------------------------------------------------------------------------
// Main
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdline, int nCmdShow)
{
	WNDCLASSEX winclass;
	winclass.cbSize = sizeof(WNDCLASSEX);
	winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
	winclass.lpfnWndProc = WindowProc;
	winclass.cbClsExtra = 0; // extra class info space
	winclass.cbWndExtra = 0; // extra window info space
	winclass.hInstance = hInstance; // assign the application instance
	winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	winclass.lpszMenuName = NULL; // the name of the menu to attach
	winclass.lpszClassName = __T(&quot;WINCLASS1&quot;); // the name of the class itself
	winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	RegisterClassEx(&amp;winclass);
	HWND hwnd;
	hwnd = CreateWindowEx(	NULL,
							__T(&quot;WINCLASS1&quot;),
							__T(&quot;Fenstertitel&quot;),
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							0,
							0,
							200,
							200,
							NULL, // handle to parent
							NULL, // handle to menu
							hInstance, // instance of this application
							NULL);

	if(hwnd==NULL)
		return -10;

	// create a second window
	HWND hwnd2;
	hwnd2 = CreateWindowEx(	NULL,
							__T(&quot;WINCLASS1&quot;),
							__T(&quot;Fenster 2&quot;),
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							0,
							0,
							300,
							300,
							NULL, // handle to parent
							NULL, // handle to menu
							hInstance, // instance of this application
							NULL);

	if(hwnd2==NULL)
		return -11;

	UpdateWindow(hwnd2);
	ShowWindow(hwnd2, 0);

	MSG msg;
	while(GetMessage(&amp;msg, NULL, 0, 0))
	{
		// translate any accelerator keys
		TranslateMessage(&amp;msg);
		// send the message to the window proc
		DispatchMessage(&amp;msg);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/971726</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971726</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Fri, 20 Jan 2006 20:49:06 GMT</pubDate></item><item><title><![CDATA[Reply to zwei leere Fenster anzeigen on Fri, 20 Jan 2006 21:36:34 GMT]]></title><description><![CDATA[<p>unteranderem weil du net ShowWindow(hwnd); aufrufst... du sagst nur das der ShowWindow(hwnd2); machen soll -.- und anders <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/971749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971749</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Fri, 20 Jan 2006 21:36:34 GMT</pubDate></item><item><title><![CDATA[Reply to zwei leere Fenster anzeigen on Fri, 20 Jan 2006 22:26:38 GMT]]></title><description><![CDATA[<p>(D)Evil schrieb:</p>
<blockquote>
<p>unteranderem weil du net ShowWindow(hwnd); aufrufst... du sagst nur das der ShowWindow(hwnd2); machen soll -.- und anders <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>Nein, das ist es nicht, da er ja bei beiden WS_VISIBLE als Style übergibt, dann ist das ShowWindow(hwnd); nicht mehr erforferlich.</p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971776</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Fri, 20 Jan 2006 22:26:38 GMT</pubDate></item><item><title><![CDATA[Reply to zwei leere Fenster anzeigen on Sat, 21 Jan 2006 13:25:41 GMT]]></title><description><![CDATA[<p>läßt man folgenden Code weg:</p>
<pre><code class="language-cpp">UpdateWindow(hwnd2);
ShowWindow(hwnd2, 0);
</code></pre>
<p>dann funktiniert es. Ich hab aber keine Ahnung warum...</p>
<p>also:</p>
<pre><code class="language-cpp">//-----------------------------------------------------------------------------
// Defines

#define WIN32_LEAN_AND_MEAN // MFC wird nicht benoetigt

//-----------------------------------------------------------------------------
// Header

#include &lt;windows.h&gt;
#include &lt;TCHAR.h&gt;

//-----------------------------------------------------------------------------
// Event Handler
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
    switch(msg)
    {
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;

        default: break;
    }

    return (DefWindowProc(hwnd, msg, wparam, lparam));
}

//-----------------------------------------------------------------------------
// Main
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdline, int nCmdShow)
{
    WNDCLASSEX winclass;
    winclass.cbSize = sizeof(WNDCLASSEX);
    winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
    winclass.lpfnWndProc = WindowProc;
    winclass.cbClsExtra = 0; // extra class info space
    winclass.cbWndExtra = 0; // extra window info space
    winclass.hInstance = hInstance; // assign the application instance
    winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
    winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    winclass.lpszMenuName = NULL; // the name of the menu to attach
    winclass.lpszClassName = __T(&quot;WINCLASS1&quot;); // the name of the class itself
    winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

    RegisterClassEx(&amp;winclass);
    HWND hwnd;
    hwnd = CreateWindowEx(    NULL,
                            __T(&quot;WINCLASS1&quot;),
                            __T(&quot;Fenstertitel&quot;),
                            WS_OVERLAPPEDWINDOW | WS_VISIBLE,
                            0,
                            0,
                            200,
                            200,
                            NULL, // handle to parent
                            NULL, // handle to menu
                            hInstance, // instance of this application
                            NULL);

    if(hwnd==NULL)
        return -10;

    // create a second window
    HWND hwnd2;
    hwnd2 = CreateWindowEx(    NULL,
                            __T(&quot;WINCLASS1&quot;),
                            __T(&quot;Fenster 2&quot;),
                            WS_OVERLAPPEDWINDOW | WS_VISIBLE,
                            0,
                            0,
                            300,
                            300,
                            NULL, // handle to parent
                            NULL, // handle to menu
                            hInstance, // instance of this application
                            NULL);

    if(hwnd2==NULL)
        return -11;

   // UpdateWindow(hwnd2);
    //ShowWindow(hwnd2, 0);

    MSG msg;
    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
        // translate any accelerator keys
        TranslateMessage(&amp;msg);
        // send the message to the window proc
        DispatchMessage(&amp;msg);
    }
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/971954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971954</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Sat, 21 Jan 2006 13:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to zwei leere Fenster anzeigen on Sat, 21 Jan 2006 13:29:36 GMT]]></title><description><![CDATA[<p>ups hab jetzt herausgefunden woran es liegt:</p>
<pre><code class="language-cpp">ShowWindow(hwnd2, 0 );
</code></pre>
<p>ist gleichbedeutend mit</p>
<pre><code class="language-cpp">ShowWindow(hwnd2, SW_HIDE );
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/971956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971956</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Sat, 21 Jan 2006 13:29:36 GMT</pubDate></item></channel></rss>