<?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[2. Fenster]]></title><description><![CDATA[<p>Hi.</p>
<p>Ich bräuchte mal wieder eure Hilfe.</p>
<p>Ich möchte gerne ein neues 2. Fenster ersten. Wie stelle ich das am besten. Muss ich in der WinMain noch eine 2 Fensterklasse anlegen?</p>
<p>Eigentlich bräuchte ich nur einen kleinen dialog für eine url-eingabe...gibts da vieleicht sogar alternativen???</p>
<p>Freue mich auf eure Antworten. <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/topic/177521/2-fenster</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 19:43:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177521.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 01 Apr 2007 12:14:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 12:14:33 GMT]]></title><description><![CDATA[<p>Hi.</p>
<p>Ich bräuchte mal wieder eure Hilfe.</p>
<p>Ich möchte gerne ein neues 2. Fenster ersten. Wie stelle ich das am besten. Muss ich in der WinMain noch eine 2 Fensterklasse anlegen?</p>
<p>Eigentlich bräuchte ich nur einen kleinen dialog für eine url-eingabe...gibts da vieleicht sogar alternativen???</p>
<p>Freue mich auf eure Antworten. <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/1257134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257134</guid><dc:creator><![CDATA[moes]]></dc:creator><pubDate>Sun, 01 Apr 2007 12:14:33 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 12:19:28 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/ms908192.aspx" rel="nofollow">CreateWindow ()</a>, wie du es beim Erstellen des Parentfensters auch schon gemacht hast.</p>
<p>Hier ein Beispiel:</p>
<pre><code class="language-cpp">HWND DeinFenster;
DeinFenster = CreateWindow (
                        &quot;Name&quot;,
                        &quot;CaptionText&quot;,
                        WS_CHILD,
                        60,
                        80,
                        170,
                        30,
                        hwnd, // Muss aber der Name des Parentfensters sein !
                        NULL,
                        ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                        NULL);
</code></pre>
<p>..und dann irgendwann nach Belieben mit <strong>ShowWindow (DeinFenster, SW_SHOW)</strong> anzeigen lassen !</p>
<p>Mfg mikey.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257139</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257139</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 01 Apr 2007 12:19:28 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 12:30:37 GMT]]></title><description><![CDATA[<p>Hi mikey...</p>
<p>danke für deine schnelle antwort...</p>
<p>habe deinen code unter case WM_CREATE folgent eingefügt:</p>
<pre><code class="language-cpp">hwnd2 = CreateWindow (
                        &quot;Name&quot;,
                        &quot;CaptionText&quot;,
                        WS_CHILD,
                        60,
                        80,
                        170,
                        30,
                        hwnd, // Muss aber der Name des Parentfensters sein !
                        NULL,
                        ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                        NULL);
</code></pre>
<p>und mein button sollte das dann eigentlich so aufrufen:</p>
<pre><code class="language-cpp">ShowWindow (hwnd2, SW_SHOW);
</code></pre>
<p>macht er aber leider nicht. woran könnts denn liegen? <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257152</guid><dc:creator><![CDATA[moes]]></dc:creator><pubDate>Sun, 01 Apr 2007 12:30:37 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 12:33:59 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>sende mal bitte deinen kompletten Source, ich werde es dir verbessern ! (Zu viele Faktoren spielen da eine Rolle)</p>
<p>MfG mikey.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257155</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257155</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 01 Apr 2007 12:33:59 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 12:50:03 GMT]]></title><description><![CDATA[<p>sry bin noch nicht angemeldet...aber ich setzte es mal hier rein...<br />
ist nur ein minimaler code...</p>
<pre><code class="language-cpp">#include &lt;Windows.h&gt;
#include &lt;commctrl.h&gt;
#pragma comment(lib,&quot;Comctl32.lib&quot;)

HWND hwnd, hwndButton1;

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

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance,
                   PSTR szCmdLine, int iCmdShow)
{
	InitCommonControls();
	static TCHAR szAppName[] = TEXT(&quot;LeWi-Player&quot;);
	MSG msg;
	g_hInst=hInstance; 

	WNDCLASS wndclass;

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

	RegisterClass(&amp;wndclass);

	hwnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,szAppName, TEXT(&quot;LeWi-Player&quot;), WS_OVERLAPPEDWINDOW,
						CW_USEDEFAULT, CW_USEDEFAULT,
						350, 300,
						NULL, NULL, hInstance, NULL);

	ShowWindow(hwnd, iCmdShow);
	UpdateWindow(hwnd);

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

	return msg.lParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

	switch (message)
	{

	case WM_CREATE:
		{
hwndButton1 = CreateWindow(TEXT(&quot;Button&quot;),
                           &quot;OK&quot;,
                           WS_CHILD | WS_VISIBLE | BS_ICON,
                           0, 0,
                           100, 21,
                           hwnd,
                           NULL,
                           ((LPCREATESTRUCT) lParam)-&gt;hInstance,
                           NULL);

	return 0;
		}

case WM_SIZE:
	{
		MoveWindow(hwndButton1, 1, 1,LOWORD(lParam)-1, 50, TRUE);

	return 0;
	}

	case WM_DESTROY:
		PostQuitMessage (0);
	return 0;
	}

return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1257173</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257173</guid><dc:creator><![CDATA[moes]]></dc:creator><pubDate>Sun, 01 Apr 2007 12:50:03 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 13:32:39 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;Windows.h&gt;
#include &lt;commctrl.h&gt;
#pragma comment(lib,&quot;Comctl32.lib&quot;)

HWND hwnd, hwndButton1, hwnd2;

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

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance,
                   PSTR szCmdLine, int iCmdShow)
{

    static TCHAR szAppName[] = TEXT(&quot;LeWi-Player&quot;);
    MSG msg;
    g_hInst=hInstance;

    WNDCLASS wndclass;

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

    RegisterClass(&amp;wndclass);

    hwnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,szAppName, TEXT(&quot;LeWi-Player&quot;), WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT, CW_USEDEFAULT,
                        350, 300,
                        NULL, NULL, hInstance, NULL);

    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);

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

    return msg.lParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    switch (message)
    {

    case WM_CREATE:
        {
hwndButton1 = CreateWindow(TEXT(&quot;Button&quot;),
                           &quot;OK&quot;,
                           WS_CHILD | WS_VISIBLE,
                           0, 0,
                           100, 21,
                           hwnd,
                           NULL,
                           ((LPCREATESTRUCT) lParam)-&gt;hInstance,
                           NULL);

                           hwnd2 = CreateWindow(
                           &quot;EDIT&quot;,
                           &quot;Neues Fenster&quot;,
                           WS_OVERLAPPEDWINDOW,
                           200, 200,
                           100, 150,
                           hwnd,
                           NULL,
                           ((LPCREATESTRUCT) lParam)-&gt;hInstance,
                           NULL);
                           ShowWindow (hwnd2, SW_SHOW);
                           break;

    return 0;
        }

case WM_SIZE:
    {
        MoveWindow(hwndButton1, 1, 1,LOWORD(lParam)-1, 50, TRUE);

    return 0;
    }

    case WM_DESTROY:
        PostQuitMessage (0);
    return 0;
    }

return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
<p>..und du verwendest Dev-C++, und möchtest den XP Style aktivieren ? Vergiss das mit dem &quot;InitCommonControls();&quot; geh einfach unter dem folgenden Menüpunkt von Dev-C++:</p>
<p><strong>Projekt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> Projekt Optionen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> Windows XP Themen unterstützen</strong></p>
<p>...natürlich musst du vorher ein Projekt angelegt haben !</p>
<p>MfG mikey.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257210</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257210</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 01 Apr 2007 13:32:39 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 13:57:27 GMT]]></title><description><![CDATA[<p>so...hab mich jetzt mal angemeldet...</p>
<p>danke für die super tips.</p>
<p>hab leider nur noch ein problem. hab jetzt die ShowWindow (hwnd2, SW_SHOW); in meinen button eingebaut. wenn ich jetzt aber das fenster schliese, lässt es sich kein 2. mal öffnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257244</guid><dc:creator><![CDATA[moes]]></dc:creator><pubDate>Sun, 01 Apr 2007 13:57:27 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 14:06:22 GMT]]></title><description><![CDATA[<blockquote>
<p>hab leider nur noch ein problem. hab jetzt die ShowWindow (hwnd2, SW_SHOW); in meinen button eingebaut.</p>
</blockquote>
<p>Wie in deinen Button eingebaut ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257250</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 01 Apr 2007 14:06:22 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 14:14:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">case WM_COMMAND:
		{
			if (lParam == (LPARAM)hwndButton1)
			{
			    if (HIWORD(wParam) == BN_CLICKED)
			    {
				ShowWindow (hwnd2, SW_SHOW);
			    }
			}
		}
</code></pre>
<p>und kann man das fenster auch ohne editfeld anzeigen lassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257261</guid><dc:creator><![CDATA[moes]]></dc:creator><pubDate>Sun, 01 Apr 2007 14:14:43 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Sun, 01 Apr 2007 14:51:01 GMT]]></title><description><![CDATA[<p>Musst du mal warten, ich weis es nicht. Bin halt ein Noob in Sachen WinAPI. Aber muss man für das Childfenster nicht eine eigene WndProc einsetzen !?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257299</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 01 Apr 2007 14:51:01 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Fri, 06 Apr 2007 19:52:13 GMT]]></title><description><![CDATA[<p>*hochschieb*</p>
<p>wollte nochmal nach anderen meinungen ausschau halten. hat jemand von euch eine idee??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1260885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1260885</guid><dc:creator><![CDATA[moes]]></dc:creator><pubDate>Fri, 06 Apr 2007 19:52:13 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Fri, 06 Apr 2007 20:08:07 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">HWND DeinFenster;
// g_MainWindow ist global und ist das Handle des Haupt-Fensters
if(hwnd == g_MainWindow)  // Sonst bekommst du unendlich viele Fenster
{
   DeinFenster = CreateWindow (
                        &quot;Name&quot;,// Muss genauso lauten wie die Class des Parent-Fensters
                        &quot;CaptionText&quot;,
                        WS_VISIBLE|WS_MINIMIZEBOX|WS_SYSMENU,// WICHTIG!!!
                        60,
                        80,
                        170,
                        200,
                        hwnd, // Muss aber der Name des Parentfensters sein !
                        NULL,
                        ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                        NULL);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1260889</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1260889</guid><dc:creator><![CDATA[WebFritzi]]></dc:creator><pubDate>Fri, 06 Apr 2007 20:08:07 GMT</pubDate></item><item><title><![CDATA[Reply to 2. Fenster on Fri, 06 Apr 2007 20:43:19 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/358">@webfritzi</a>:</p>
<p>ist aber hwnd nicht normalerweise das handle zum hauptfenster??? leider funktioniert das bei mir nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1260908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1260908</guid><dc:creator><![CDATA[moes]]></dc:creator><pubDate>Fri, 06 Apr 2007 20:43:19 GMT</pubDate></item></channel></rss>