<?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[neues Fenster]]></title><description><![CDATA[<p>Ich versuch grade mal mein glück mit der win-api.</p>
<p>ich möchte gerne als reaktion auf einen Buttonklick ein neues Fenster öffnen. Nun bin ich aber etwas ratlos was wo hin gehört.</p>
<p>Normal bearbeite ich einen buttonklick ja bei WM_COMMAND, kann ich dort einfach ein neues fenster erstellen?!?</p>
<p>Scheinbar zumindest nicht(zumindest klappt es bei mir nicht, hat jemand ein paar gute Tutorials zum Thema Win-API? Mir scheint generell nocht viel vom grundsätzlichen verständnis zu fehlen.</p>
<p>Hier mal mein code</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;Adressbuch.h&quot;

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

const TCHAR szAppName[]=TEXT(&quot;Adressbuch&quot;);

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
	HWND		hMain;
	MSG			msg;
	WNDCLASS	wc;

	wc.cbClsExtra	 = 0;
	wc.cbWndExtra	 = 0;
	wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	wc.hCursor		 = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon         = LoadIcon(hInstance, TEXT(&quot;#130&quot;));
	wc.hInstance     = hInstance;
	wc.lpfnWndProc	 = WndProc;
	wc.lpszMenuName  = NULL;
	wc.lpszClassName = szAppName;
	wc.style		 = CS_HREDRAW | CS_VREDRAW;

	RegisterClass(&amp;wc);

	hMain = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
		NULL, NULL, hInstance, NULL);

	ShowWindow(hMain,nCmdShow);
	UpdateWindow(hMain);

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

	return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	HDC			hDC;
	PAINTSTRUCT ps;
	static HWND	hButNeu;
	static HWND	hButAbort;
	static HWND	hWndNeu;
	static int	cxClient;
	static int	cyClient;

	switch (message)
	{
	case WM_CREATE:
		{
			hButNeu = CreateWindow(TEXT(&quot;button&quot;), TEXT(&quot;Neu&quot;), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
								0, 0, 0, 0, hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);

			hButAbort = CreateWindow(TEXT(&quot;button&quot;), TEXT(&quot;Abbrechen&quot;), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
								0, 0, 0, 0, hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);

		return 0;
		}

	case WM_COMMAND:
		{
			if(lParam == (LPARAM)hButNeu)
			{
				if(HIWORD(wParam) == BN_CLICKED)
					hWndNeu = CreateWindow(TEXT(&quot;TEST&quot;), TEXT(&quot;TEST&quot;), WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
								hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);
			}

			if(lParam == (LPARAM)hButAbort)
				if(HIWORD(wParam) == BN_CLICKED)
					MessageBox(hWnd, TEXT(&quot;Abbruch&quot;), TEXT(&quot;Wird schon fertig...&quot;), MB_OK);

			return 0;
		}
	case WM_SIZE:
		{
		cxClient = LOWORD(lParam);
		cyClient = HIWORD(lParam);

		MoveWindow(hButNeu, 10, 10, cxClient / 8, cyClient / 12, TRUE);
		MoveWindow(hButAbort, 10, 70, cxClient / 8, cyClient / 12, TRUE);
		MoveWindow(hWndNeu, 10, 70, cxClient / 8, cyClient / 12, TRUE);
		return 0;
		}

	case WM_PAINT:
		{
			hDC = BeginPaint(hWnd, &amp;ps);
			SelectObject(hDC,GetStockObject(GRAY_BRUSH));
			Rectangle(hDC, 0, 0, cxClient / 4, cyClient);
			EndPaint(hWnd, &amp;ps);

			return 0;
		}

	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/150610/neues-fenster</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 00:06:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150610.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Jun 2006 16:44:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to neues Fenster on Sun, 18 Jun 2006 16:44:46 GMT]]></title><description><![CDATA[<p>Ich versuch grade mal mein glück mit der win-api.</p>
<p>ich möchte gerne als reaktion auf einen Buttonklick ein neues Fenster öffnen. Nun bin ich aber etwas ratlos was wo hin gehört.</p>
<p>Normal bearbeite ich einen buttonklick ja bei WM_COMMAND, kann ich dort einfach ein neues fenster erstellen?!?</p>
<p>Scheinbar zumindest nicht(zumindest klappt es bei mir nicht, hat jemand ein paar gute Tutorials zum Thema Win-API? Mir scheint generell nocht viel vom grundsätzlichen verständnis zu fehlen.</p>
<p>Hier mal mein code</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;Adressbuch.h&quot;

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

const TCHAR szAppName[]=TEXT(&quot;Adressbuch&quot;);

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
	HWND		hMain;
	MSG			msg;
	WNDCLASS	wc;

	wc.cbClsExtra	 = 0;
	wc.cbWndExtra	 = 0;
	wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	wc.hCursor		 = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon         = LoadIcon(hInstance, TEXT(&quot;#130&quot;));
	wc.hInstance     = hInstance;
	wc.lpfnWndProc	 = WndProc;
	wc.lpszMenuName  = NULL;
	wc.lpszClassName = szAppName;
	wc.style		 = CS_HREDRAW | CS_VREDRAW;

	RegisterClass(&amp;wc);

	hMain = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
		NULL, NULL, hInstance, NULL);

	ShowWindow(hMain,nCmdShow);
	UpdateWindow(hMain);

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

	return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	HDC			hDC;
	PAINTSTRUCT ps;
	static HWND	hButNeu;
	static HWND	hButAbort;
	static HWND	hWndNeu;
	static int	cxClient;
	static int	cyClient;

	switch (message)
	{
	case WM_CREATE:
		{
			hButNeu = CreateWindow(TEXT(&quot;button&quot;), TEXT(&quot;Neu&quot;), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
								0, 0, 0, 0, hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);

			hButAbort = CreateWindow(TEXT(&quot;button&quot;), TEXT(&quot;Abbrechen&quot;), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
								0, 0, 0, 0, hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);

		return 0;
		}

	case WM_COMMAND:
		{
			if(lParam == (LPARAM)hButNeu)
			{
				if(HIWORD(wParam) == BN_CLICKED)
					hWndNeu = CreateWindow(TEXT(&quot;TEST&quot;), TEXT(&quot;TEST&quot;), WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
								hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);
			}

			if(lParam == (LPARAM)hButAbort)
				if(HIWORD(wParam) == BN_CLICKED)
					MessageBox(hWnd, TEXT(&quot;Abbruch&quot;), TEXT(&quot;Wird schon fertig...&quot;), MB_OK);

			return 0;
		}
	case WM_SIZE:
		{
		cxClient = LOWORD(lParam);
		cyClient = HIWORD(lParam);

		MoveWindow(hButNeu, 10, 10, cxClient / 8, cyClient / 12, TRUE);
		MoveWindow(hButAbort, 10, 70, cxClient / 8, cyClient / 12, TRUE);
		MoveWindow(hWndNeu, 10, 70, cxClient / 8, cyClient / 12, TRUE);
		return 0;
		}

	case WM_PAINT:
		{
			hDC = BeginPaint(hWnd, &amp;ps);
			SelectObject(hDC,GetStockObject(GRAY_BRUSH));
			Rectangle(hDC, 0, 0, cxClient / 4, cyClient);
			EndPaint(hWnd, &amp;ps);

			return 0;
		}

	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1080110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080110</guid><dc:creator><![CDATA[Ulnk]]></dc:creator><pubDate>Sun, 18 Jun 2006 16:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Sun, 18 Jun 2006 16:53:48 GMT]]></title><description><![CDATA[<p>ne Fenster Klasse &quot;TEST&quot; existiert nicht nach dem Code den du geposted hast. du kannst bei WM_COMMAND auch nicht LPCREATESTRUCT benutzen, das geht nur bei WM_CREATE.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080114</guid><dc:creator><![CDATA[Ranner]]></dc:creator><pubDate>Sun, 18 Jun 2006 16:53:48 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Sun, 18 Jun 2006 17:39:09 GMT]]></title><description><![CDATA[<p>Jo... solltest, wenn de eine neue &quot;Fensterklasse&quot; haben willst, mal ne Wndclass ausfüllen und dann reggen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080146</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 18 Jun 2006 17:39:09 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Sun, 18 Jun 2006 21:41:44 GMT]]></title><description><![CDATA[<p>Du kannst auch (das macht vllt. nicht ganz so viel Arbeit) einen Dialog via Resource einbinden und den dann via CreateDialog() unter WM_COMMAND erstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080297</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sun, 18 Jun 2006 21:41:44 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 10:57:10 GMT]]></title><description><![CDATA[<blockquote>
<p>Jo... solltest, wenn de eine neue &quot;Fensterklasse&quot; haben willst, mal ne Wndclass ausfüllen und dann reggen...</p>
</blockquote>
<p>dachte das child-fenster automatisch registriert werden?</p>
<p>Also mein Ziel ist es, beim klick auf den button ein fenster zu öffnen(child-fenster?) und das man dort dann einfach informationen wie name etc. eingeben kann.</p>
<p>So ein neu registrieren, ginge das so?</p>
<pre><code class="language-cpp">int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
    HWND        hMain;
    MSG            msg;
    WNDCLASS    wc;

    wc.cbClsExtra     = 0;
    wc.cbWndExtra     = 0;
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.hCursor         = LoadCursor(NULL, IDC_ARROW);
    wc.hIcon         = LoadIcon(hInstance, TEXT(&quot;#130&quot;));
    wc.hInstance     = hInstance;
    wc.lpfnWndProc     = WndProc;
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = szAppName;
    wc.style         = CS_HREDRAW | CS_VREDRAW;

    RegisterClass(&amp;wc);

WNDCLASS    wc2;

    wc2.cbClsExtra     = 0;
    wc2.cbWndExtra     = 0;
    wc2.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc2.hCursor         = LoadCursor(NULL, IDC_ARROW);
    wc2.hIcon         = LoadIcon(hInstance, TEXT(&quot;#130&quot;));
    wc2.hInstance     = hInstance;
    wc2.lpfnWndProc     = AndereProc;
    wc2.lpszMenuName  = NULL;
    wc2.lpszClassName = szAppName;
    wc2.style         = CS_HREDRAW | CS_VREDRAW;

    RegisterClass(&amp;wc2);

    hMain = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
        NULL, NULL, hInstance, NULL);

    ShowWindow(hMain,nCmdShow);
    UpdateWindow(hMain);

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

    return (int) msg.wParam;
}
</code></pre>
<p>oder wäre es besser sowas in einem dialog zu machen?</p>
<p>btw.<br />
Wäre es sinnvoll die menu-Buttons auf ein eigenes child-fenster zu setzen oder die einfach seperat in den Anwendungsbereich zu setzen wie in meinem code?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080526</guid><dc:creator><![CDATA[Ulnk]]></dc:creator><pubDate>Mon, 19 Jun 2006 10:57:10 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 11:10:04 GMT]]></title><description><![CDATA[<blockquote>
<p>dachte das child-fenster automatisch registriert werden?</p>
</blockquote>
<p>Nur, wenn WS-Style auf einen Control-Style gesetzt wird (z. B. &quot;button, combobox&quot; o. ä.)</p>
<p>Hier ein Tutorial:</p>
<p><a href="http://www.win-api.de/tutorials.php?tutid=15" rel="nofollow">http://www.win-api.de/tutorials.php?tutid=15</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080536</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 19 Jun 2006 11:10:04 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 11:10:38 GMT]]></title><description><![CDATA[<p>Ulnk schrieb:</p>
<blockquote>
<pre><code class="language-cpp">//...
wc.lpszClassName = szAppName;
//...
RegisterClass(&amp;wc);
//...
wc2.lpszClassName = szAppName;
//...
</code></pre>
</blockquote>
<p>Zwei Fensterklassen mit selben Namen wird IMHO nicht funktionieren. Prüf doch bitte mal deine RegisterClass()-Aufrufe auf Fehler!</p>
<p>Greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080537</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 19 Jun 2006 11:10:38 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 18:00:26 GMT]]></title><description><![CDATA[<p>(D)Evil schrieb:</p>
<blockquote>
<p>Jo... solltest, wenn de eine neue &quot;Fensterklasse&quot; haben willst, mal ne Wndclass ausfüllen und dann reggen...</p>
</blockquote>
<p>also eigentlich möchte ich nur, dass sich beim klick auf meinen button, ein neues fenster öffnet. Was das für ein fenster ist ist erstmal egal.(oder?)</p>
<p>Wenn ich die fensterklasse direkt nach der ersten aufbaue, wird mir diese doch immer angezeigt? Ich möchte aber, das mein fenster nur auf den buttonklick erstellt wird......</p>
<p>diese ganzen tuts zeigen zwar mit man buttons erzeugt, aber so einfaches fenster auf buttonklick öffnen behandeln sie irgendwie nicht.....</p>
<p><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>
<p>Nach meinem Verständnis müsste man in WM_Command noch ein createwindow ausführen......das scheint aber nicht zu klappen. Ich bin echt ratlos. Wie kann sowas einfach so kompliziert sein....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080831</guid><dc:creator><![CDATA[Ulnk]]></dc:creator><pubDate>Mon, 19 Jun 2006 18:00:26 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 18:06:45 GMT]]></title><description><![CDATA[<p>dann nimm doch</p>
<pre><code class="language-cpp">// ...
case WM_COMMAND:
    if( LOWORD( wParam ) == DIE_ID_DEINES_BUTTONS )
        MessageBox( window, &quot;Hm, you clicked a button!?&quot;, &quot;MSG:&quot;, MB_OK );
    return 0;
// ...
</code></pre>
<p>um zu sehen, ob es überhaupt funktionieren kann...</p>
<p>Greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080835</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 19 Jun 2006 18:06:45 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 18:38:06 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>dann nimm doch</p>
<pre><code class="language-cpp">// ...
case WM_COMMAND:
    if( LOWORD( wParam ) == DIE_ID_DEINES_BUTTONS )
        MessageBox( window, &quot;Hm, you clicked a button!?&quot;, &quot;MSG:&quot;, MB_OK );
    return 0;
// ...
</code></pre>
<p>um zu sehen, ob es überhaupt funktionieren kann...</p>
<p>Greetz, Swordfish</p>
</blockquote>
<p>das klappt, messagebox ist kein problem, aber wenn ich das richtig verstanden hab, kan ich bei wm_command kein neues Fenster erzeugen?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080857</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080857</guid><dc:creator><![CDATA[Ulnk]]></dc:creator><pubDate>Mon, 19 Jun 2006 18:38:06 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 18:55:40 GMT]]></title><description><![CDATA[<p>Doch, das kannst du eigntlt. überall....:</p>
<p>und zwar so:<br />
(vereinfacht)</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK SubWndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{[cpp]
   HWND         hwnd;
   MSG          msg;
   WNDCLASSEX   wndclassex = {0};

   wndclassex.cbSize        = sizeof(WNDCLASSEX);
   wndclassex.style         = CS_HREDRAW | CS_VREDRAW;
   wndclassex.lpfnWndProc   = MainWndProc;
   wndclassex.cbClsExtra    = 0;
   wndclassex.cbWndExtra    = 0;
   wndclassex.hInstance     = hInstance;
   wndclassex.hIcon         = LoadIcon (NULL, IDI_APPLICATION);
   wndclassex.hCursor       = LoadCursor (NULL, IDC_ARROW);
   wndclassex.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
   wndclassex.lpszMenuName  = NULL;
   wndclassex.lpszClassName = TEXT (&quot;MAIN_WND&quot;);
   wndclassex.hIconSm       = wndclassex.hIcon;

   if (!RegisterClassEx (&amp;wndclassex))
   {
      MessageBox (NULL, TEXT (&quot;RegisterClassEx fehlgeschlagen!&quot;),
                  szAppName, MB_ICONERROR);
      return 0;
   }
   wndclassex.lpszClassName = TEXT (&quot;SUB_WND&quot;);
   wndclassex.lpfnWndProc   = SubWndProc;

   if (!RegisterClassEx (&amp;wndclassex))
   {
      MessageBox (NULL, TEXT (&quot;RegisterClassEx fehlgeschlagen!&quot;),
                  szAppName, MB_ICONERROR);
      return 0;
   }

   hwnd = CreateWindowEx (WS_EX_OVERLAPPEDWINDOW, // erweiterter Fensterstil
                  TEXT (&quot;MAIN_WND&quot;), // Name der Fensterklasse
                  TEXT (&quot;Fenstertitel&quot;), // 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);

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

// Die Hauptnachrichtenschleife
LRESULT CALLBACK MainWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static HWND hWndNew;
   HDC hdc;
   PAINTSTRUCT ps;

   switch (message)
   {
   case WM_CREATE:
      return (0);

   case WM_COMMAND:
      switch(LOWORD(wParam))
      {
         case 1: // hier die richtige Button ID
            hWndNew= CreateWindowEx (WS_EX_OVERLAPPEDWINDOW, // erweiterter Fensterstil
                  TEXT(&quot;SUB_WND&quot;), // Name der Fensterklasse
                  TEXT (&quot;Fenstertitel&quot;), // 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
            break;
         // Weitere CASE - Zweige...
      }
      return (0);

   case WM_PAINT:
      hdc = BeginPaint (hwnd, &amp;ps);
      TextOut (hdc, 0, 0, &quot;Hallo, ich bin ein Fenster!&quot;, 27);
      EndPaint (hwnd, &amp;ps);
      return (0);

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

   return DefWindowProc (hwnd, message, wParam, lParam);
}

// Die Nachrichtenschleife des neuen Fensters
LRESULT CALLBACK SubWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   HDC hdc;
   PAINTSTRUCT ps;

   switch (message)
   {
   case WM_CREATE:
      return (0);

   case WM_PAINT:
      hdc = BeginPaint (hwnd, &amp;ps);
      TextOut (hdc, 0, 0, &quot;Hallo, ich bin ein Fenster!&quot;, 27);
      EndPaint (hwnd, &amp;ps);
      return (0);

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

   return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
<p>PS: Code ist nicht getestet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080877</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080877</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 19 Jun 2006 18:55:40 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:41:46 GMT]]></title><description><![CDATA[<p>Doch, das kannst du eigentlich überall, und zwar so:<br />
(nicht vereinfacht)</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

const int id_show = 300;
const int id_hide = 301;

long __stdcall WindowProcedure( HWND window, unsigned int message, unsigned int first, long second );
long __stdcall ChildWindowProcedure( HWND window, unsigned int message, unsigned int first, long second );

int __stdcall WinMain( HINSTANCE instance, HINSTANCE prev_instance, char *cmd_line, int show_state )
{
    HWND window;

    WNDCLASSEX wcex;
    memset( &amp;wcex, 0, sizeof( WNDCLASSEX ) );

    wcex.cbSize        = sizeof( WNDCLASSEX );	
    wcex.hInstance     = instance;
    wcex.lpszClassName = &quot;TestWindowClass&quot;;
    wcex.lpfnWndProc   = WindowProcedure;
    wcex.style         = CS_HREDRAW | CS_VREDRAW;
    wcex.hIcon         = LoadIcon ( 0, IDI_APPLICATION );
    wcex.hIconSm       = LoadIcon ( 0, IDI_APPLICATION );
    wcex.hCursor       = LoadCursor ( 0, IDC_ARROW );
    wcex.hbrBackground = reinterpret_cast&lt; HBRUSH &gt;( COLOR_BACKGROUND + 1 );

    unsigned short class_atom = RegisterClassEx( &amp;wcex );

    if( !class_atom ) {
        MessageBox( 0, &quot;Couldn't register Window Class!&quot;, &quot;Error:&quot;, MB_OK );
        return 0;
    }

    window = CreateWindowEx(
        0,
        reinterpret_cast&lt; char* &gt;( class_atom ),
        &quot;Windows App&quot;,
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        230,
        150,
        0,
        0,
        instance,
        0
    );

    if( !window ) {
        MessageBox( 0, &quot;Couldn't create window!&quot;, &quot;Error:&quot;, MB_OK );
        return 0;
    }

    UpdateWindow( window );
    ShowWindow( window, show_state );

    MSG message;

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

    return static_cast&lt;int&gt;( message.wParam );
}

long __stdcall WindowProcedure( HWND window, unsigned int message, unsigned int first, long second )
{
    static HWND btn_show = 0;
    static HWND btn_hide = 0;
    static HWND child_window = 0;

    static unsigned short child_class_atom = 0;

    WNDCLASSEX wcex;

    switch( message ) {

        case WM_CREATE:

            memset( &amp;wcex, 0, sizeof( WNDCLASSEX ) );

            wcex.cbSize        = sizeof( WNDCLASSEX );	
            wcex.hInstance     = reinterpret_cast&lt; HINSTANCE &gt;( GetWindowLong( window, GWL_HINSTANCE ) );
            wcex.lpszClassName = &quot;ChildWindowClass&quot;;
            wcex.lpfnWndProc   = ChildWindowProcedure;
            wcex.style         = CS_HREDRAW | CS_VREDRAW;
            wcex.hIcon         = LoadIcon ( 0, IDI_APPLICATION );
            wcex.hIconSm       = LoadIcon ( 0, IDI_APPLICATION );
            wcex.hCursor       = LoadCursor ( 0, IDC_ARROW );
            wcex.hbrBackground = reinterpret_cast&lt; HBRUSH &gt;( COLOR_BACKGROUND + 1 );

            child_class_atom = RegisterClassEx( &amp;wcex );

            if( !child_class_atom ) {
                MessageBox( 0, &quot;Couldn't register Window Class!&quot;, &quot;Error:&quot;, MB_OK );
                return -1;
            }

            btn_show = CreateWindow(
                &quot;BUTTON&quot;,
                &quot;show&quot;,
                WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
                10,
                10,
                100,
                100, 
                window,
                reinterpret_cast&lt; HMENU &gt; ( IDC_SHOW ),
                reinterpret_cast&lt; HINSTANCE &gt;( GetWindowLong( window, GWL_HINSTANCE ) ),
                0
            );

            btn_hide = CreateWindow(
                &quot;BUTTON&quot;,
                &quot;hide&quot;,
                WS_VISIBLE | WS_CHILD | WS_DISABLED | BS_DEFPUSHBUTTON,
                120,
                10,
                100,
                100, 
                window,
                reinterpret_cast&lt; HMENU &gt; ( IDC_HIDE ),
                reinterpret_cast&lt; HINSTANCE &gt;( GetWindowLong( window, GWL_HINSTANCE ) ),
                0
            );

            return 0;

        case WM_COMMAND:
            switch( LOWORD( first ) ) {
                case IDC_SHOW:
                    child_window = CreateWindowEx(
                        0,
                        reinterpret_cast&lt; char* &gt;( child_class_atom ),
                        &quot;Windows App - Child&quot;,
                        WS_BORDER | WS_CAPTION | WS_VISIBLE,
                        10,
                        10,
                        500,
                        20,
                        window,
                        0,
                        reinterpret_cast&lt; HINSTANCE &gt;( GetWindowLong( window, GWL_HINSTANCE ) ),
                        0
                    );
                    EnableWindow( btn_show, false );
                    EnableWindow( btn_hide, true );
                    return 0;

                case IDC_HIDE:
                    DestroyWindow( child_window );
                    EnableWindow( btn_hide, false );
                    EnableWindow( btn_show, true );
                    return 0;
            }
            break;

        case WM_CLOSE:
            PostQuitMessage( 0 );
            return 0;
    }
    return static_cast&lt; long &gt;( DefWindowProc( window, message, first, second ) );
}

long __stdcall ChildWindowProcedure( HWND window, unsigned int message, unsigned int first, long second )
{
    return static_cast&lt; long &gt;( DefWindowProc( window, message, first, second ) );
}
</code></pre>
<p>BugFree<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/2122.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--trade_mark"
      title=":trade_mark:"
      alt="™"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <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>
<p>Greetz, Swordfish</p>
<p>[edit]&quot;Style&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /> [/edit]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080910</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:41:46 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:32:19 GMT]]></title><description><![CDATA[<p>Hmm Swordfish... entweder man zeiht einen Style durch, oder man lässt es bleiben... du hast ihn weder durch gezogen noch ist der style der manchmal sichbar ist gut <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>
<p>define erstetzt man durch was anders... und WINAPI ist auch nen __stdcall usw <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/1080926</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080926</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:32:19 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:39:56 GMT]]></title><description><![CDATA[<p>Ich lach mich schlapp...OK aber ich wollte ja nur das Prinzip demontrieren... Aber ok ok ok...LOL</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080940</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:39:56 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:41:08 GMT]]></title><description><![CDATA[<p>Danke für die Beispiele, aber so richtig klappen tuts noch nicht. ich bin jetzt soweit, ich hab versucht die Infos aus euren Beispielen rauszupicken:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;Adressbuch.h&quot;

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

const TCHAR szAppName[]=TEXT(&quot;Adressbuch&quot;);

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
	HWND		hMain;
	MSG			msg;
	WNDCLASS	wc;
	WNDCLASS	wc2;

	wc.cbClsExtra	 = 0;
	wc.cbWndExtra	 = 0;
	wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	wc.hCursor		 = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon         = LoadIcon(hInstance, TEXT(&quot;#130&quot;));
	wc.hInstance     = hInstance;
	wc.lpfnWndProc	 = WndProc;
	wc.lpszMenuName  = NULL;
	wc.lpszClassName = szAppName;
	wc.style		 = CS_HREDRAW | CS_VREDRAW;

	RegisterClass(&amp;wc);

	wc.lpszClassName = TEXT(&quot;SUB&quot;);
	wc.lpfnWndProc	 = ChildProc;

	RegisterClass(&amp;wc);

	hMain = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
		NULL, NULL, hInstance, NULL);

	ShowWindow(hMain,nCmdShow);
	UpdateWindow(hMain);

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

	return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	HDC			hDC;
	PAINTSTRUCT ps;
	static HWND	hButNeu;
	static HWND	hButAbort;
	static HWND	hWndNeu;
	static int	cxClient;
	static int	cyClient;

	switch (message)
	{
	case WM_CREATE:
		{
			hButNeu = CreateWindow(TEXT(&quot;button&quot;), TEXT(&quot;Neu&quot;), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
								0, 0, 0, 0, hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);

			hButAbort = CreateWindow(TEXT(&quot;button&quot;), TEXT(&quot;Abbrechen&quot;), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
								0, 0, 0, 0, hWnd, NULL, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);

		return 0;
		}

	case WM_COMMAND:
		{
			if(lParam == (LPARAM)hButNeu)
			{
				if(HIWORD(wParam) == BN_CLICKED)
				{
					hWndNeu = CreateWindow(TEXT(&quot;SUB&quot;), TEXT(&quot;PoP&quot;), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
											NULL, NULL, NULL, NULL);

				}
			}

			if(lParam == (LPARAM)hButAbort)
				if(HIWORD(wParam) == BN_CLICKED)
					MessageBox(hWnd, TEXT(&quot;Abbruch&quot;), TEXT(&quot;Wird schon fertig...&quot;), MB_OK);

			return 0;
		}
	case WM_SIZE:
		{
		cxClient = LOWORD(lParam);
		cyClient = HIWORD(lParam);

		MoveWindow(hButNeu, 10, 10, cxClient / 8, cyClient / 12, TRUE);
		MoveWindow(hButAbort, 10, 70, cxClient / 8, cyClient / 12, TRUE);
		return 0;
		}

	case WM_PAINT:
		{
			hDC = BeginPaint(hWnd, &amp;ps);
			SelectObject(hDC,GetStockObject(LTGRAY_BRUSH));
			Rectangle(hDC, 0, 0, cxClient / 4, cyClient);
			EndPaint(hWnd, &amp;ps);

			return 0;
		}

	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}

LRESULT CALLBACK ChildProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ 
	switch(message)
	{
	case WM_DESTROY:
     PostQuitMessage (0);
     return (0);
	}

   return DefWindowProc (hwnd, message, wParam, lParam); 
}
</code></pre>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/8250">@Swordfish</a><br />
Dein Beispiel unterscheidet sich deutlich von dem was ich bisher gesehen hab und ich bin etwas damit überfordert....... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>Wo liegt den da jetzt noch der Fehler? ich kriegs kompiliert, nur auf buttonklick öffnet sich kein neues Fenster.....(es geht um den Button hButNeu)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080942</guid><dc:creator><![CDATA[Ulnk]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:41:08 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:43:24 GMT]]></title><description><![CDATA[<p>Du musst das Fenster auch anzeigen...entweder ShowWindow() oder WS_VISIBLE mit in die Styles <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/1080945</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080945</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:43:24 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:50:32 GMT]]></title><description><![CDATA[<p>(D)Evil schrieb:</p>
<blockquote>
<p>Hmm Swordfish... entweder man zeiht einen Style durch, oder man lässt es bleiben... du hast ihn weder durch gezogen noch ist der style der manchmal sichbar ist gut <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>Passts dir jetzt!? *schmoll*</p>
<p>CodeFinder schrieb:</p>
<blockquote>
<p>Ich lach mich schlapp...OK aber ich wollte ja nur das Prinzip demontrieren... Aber ok ok ok...LOL</p>
</blockquote>
<p>Wieso?</p>
<p>Ulnk schrieb:</p>
<blockquote>
<p>Dein Beispiel unterscheidet sich deutlich von dem was ich bisher gesehen hab und ich bin etwas damit überfordert....... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
</blockquote>
<p>Jetzt lach ich mich schlapp <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>
<p>Greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080956</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:50:32 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:52:40 GMT]]></title><description><![CDATA[<p>CodeFinder schrieb:</p>
<blockquote>
<p>Du musst das Fenster auch anzeigen...entweder ShowWindow() oder WS_VISIBLE mit in die Styles <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>
</blockquote>
<p>ahhhhh <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>
<p>Allerdings scheint das neue Fenster mit dem neuen verbunden zu sein, schließe ich das neue fenster, schließt sich auch mein altes. Eigentlich sollte sich nur das fenster selbst schließen, wenn ich auf das &quot;x&quot; klicke.</p>
<p>Hängt das damit zusammen, das sich die über die selbe WNDCLASS Variable registriert hab? wie krieg ich die auseinander?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080957</guid><dc:creator><![CDATA[Ulnk]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:52:40 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 19:59:15 GMT]]></title><description><![CDATA[<p>@Ulnk:<br />
Ist zwar n bissl dirty wg. der globalen HWND aber: erstell nen globlalen Handle zu deinem Hauptfenster und sende unter WM_CLOSE oder WM_DESTROY deine neuen Fenstern mit</p>
<pre><code class="language-cpp">SendMessage(g_hWndMain, WM_CLOSE, 0, 0L);
</code></pre>
<p>ne 'Schließen-Nachricht' <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>
<p>Oder via Get/Set-WindowLongPtr und GWL_USERDATA...aber das is glaube ich zuviel des Guten <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>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/8250">@Swordfish</a>:</p>
<p>Swordfish schrieb:</p>
<blockquote>
<p>CodeFinder schrieb:</p>
<blockquote>
<p>Ich lach mich schlapp...OK aber ich wollte ja nur das Prinzip demontrieren... Aber ok ok ok...LOL</p>
</blockquote>
<p>Wieso?</p>
</blockquote>
<p>Weil ich mir das:</p>
<p>Swordfish schrieb:</p>
<blockquote>
<p>Ulnk schrieb:</p>
<blockquote>
<p>Dein Beispiel unterscheidet sich deutlich von dem was ich bisher gesehen hab und ich bin etwas damit überfordert....... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
</blockquote>
<p>Jetzt lach ich mich schlapp <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>
</blockquote>
<p>schon gedacht hab... Muhaha. ich sterbe...vor lachen...deine ganzen C++ Casts sind für 'neue' nämlich etwas ''''verwirrend'''' *GRINZ*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080967</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 19 Jun 2006 19:59:15 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 20:00:39 GMT]]></title><description><![CDATA[<p>Ne, die kleben nicht zusammen...<br />
Schau dir doch mal deine</p>
<pre><code class="language-cpp">LRESULT CALLBACK ChildProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
    case WM_DESTROY:
     PostQuitMessage (0); // &lt;--- *räusper*
     return (0);
    }

   return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
<p>_genau_ an...</p>
<p>Greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1080969</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1080969</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 19 Jun 2006 20:00:39 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Mon, 19 Jun 2006 21:56:17 GMT]]></title><description><![CDATA[<p>Tutorials:<br />
<a href="http://www.winprog.org/tutorial/" rel="nofollow">http://www.winprog.org/tutorial/</a><br />
<a href="http://www.winapi.net/" rel="nofollow">http://www.winapi.net/</a><br />
<a href="http://www.win-api.de/tutorials.php?SessID=b941259b1f32665474357edee03e9aa4&amp;SessID=b941259b1f32665474357edee03e9aa4" rel="nofollow">http://www.win-api.de/tutorials.php?SessID=b941259b1f32665474357edee03e9aa4&amp;SessID=b941259b1f32665474357edee03e9aa4</a><br />
<a href="http://www.henkessoft.de/C++/WinAPI/WinAPI%20Kapitel%201%20bis%206/api1.htm" rel="nofollow">http://www.henkessoft.de/C++/WinAPI/WinAPI Kapitel 1 bis 6/api1.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081013</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Mon, 19 Jun 2006 21:56:17 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Tue, 20 Jun 2006 06:33:46 GMT]]></title><description><![CDATA[<p>CodeFinder schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/8250">@Swordfish</a>:</p>
<p>Swordfish schrieb:</p>
<blockquote>
<p>CodeFinder schrieb:</p>
<blockquote>
<p>Ich lach mich schlapp...OK aber ich wollte ja nur das Prinzip demontrieren... Aber ok ok ok...LOL</p>
</blockquote>
<p>Wieso?</p>
</blockquote>
<p>Weil ich mir das:</p>
<p>Swordfish schrieb:</p>
<blockquote>
<p>Ulnk schrieb:</p>
<blockquote>
<p>Dein Beispiel unterscheidet sich deutlich von dem was ich bisher gesehen hab und ich bin etwas damit überfordert....... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
</blockquote>
<p>Jetzt lach ich mich schlapp <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>
</blockquote>
<p>schon gedacht hab... Muhaha. ich sterbe...vor lachen...deine ganzen C++ Casts sind für 'neue' nämlich etwas ''''verwirrend'''' *GRINZ*</p>
</blockquote>
<p>/nod</p>
<p>Erhard Henkes schrieb:</p>
<blockquote>
<p>Tutorials:<br />
<a href="http://www.winprog.org/tutorial/" rel="nofollow">http://www.winprog.org/tutorial/</a><br />
<a href="http://www.winapi.net/" rel="nofollow">http://www.winapi.net/</a><br />
<a href="http://www.win-api.de/tutorials.php?SessID=b941259b1f32665474357edee03e9aa4&amp;SessID=b941259b1f32665474357edee03e9aa4" rel="nofollow">http://www.win-api.de/tutorials.php?SessID=b941259b1f32665474357edee03e9aa4&amp;SessID=b941259b1f32665474357edee03e9aa4</a><br />
<a href="http://www.henkessoft.de/C++/WinAPI/WinAPI%20Kapitel%201%20bis%206/api1.htm" rel="nofollow">http://www.henkessoft.de/C++/WinAPI/WinAPI Kapitel 1 bis 6/api1.htm</a></p>
</blockquote>
<p>danke!</p>
<p>Swordfish schrieb:</p>
<blockquote>
<p>Ne, die kleben nicht zusammen...<br />
Schau dir doch mal deine</p>
<pre><code class="language-cpp">LRESULT CALLBACK ChildProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
    case WM_DESTROY:
     PostQuitMessage (0); // &lt;--- *räusper*
     return (0);
    }

   return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
<p>_genau_ an...</p>
<p>Greetz, Swordfish</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> danke</p>
<p>Danke @ll für eure Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1081092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1081092</guid><dc:creator><![CDATA[Ulnk]]></dc:creator><pubDate>Tue, 20 Jun 2006 06:33:46 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Thu, 22 Jun 2006 08:52:45 GMT]]></title><description><![CDATA[<p>Normalerweise erstellt man für solche Zwecke aber per Resourcen-Editor einen modalen Dialog. <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-143003.html" rel="nofollow">Hier</a> findest du einige Resourcen-Editoren, und wenn du VC++ 6.0 hast, dann ist da auch direkt einer eingebaut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1082738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1082738</guid><dc:creator><![CDATA[WebFritzi]]></dc:creator><pubDate>Thu, 22 Jun 2006 08:52:45 GMT</pubDate></item><item><title><![CDATA[Reply to neues Fenster on Thu, 22 Jun 2006 13:53:44 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/358">@WebFritzi</a>: Hab ich doch gesagt! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1082757</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1082757</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 22 Jun 2006 13:53:44 GMT</pubDate></item></channel></rss>