<?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[MDI - Warum geht es nicht?]]></title><description><![CDATA[<p>Hi!<br />
Ja, ich habe schon die Suchfunktion benutzt - aber da kam ich auch nicht viel weiter.</p>
<p>Hier werden die Klassen registriert:</p>
<pre><code class="language-cpp">WNDCLASSEX wcex;

	wcex.cbSize         = sizeof(WNDCLASSEX); 

	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= (WNDPROC)WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInst;
	wcex.hIcon			= LoadIcon  (hInst, (LPCTSTR)IDI_MAINLARGE);
	wcex.hCursor		= LoadCursor(NULL,  IDC_ARROW);
	wcex.hbrBackground	= CreateSolidBrush( RGB(128, 128, 128) );
	wcex.lpszMenuName	= (LPCSTR)IDR_MAINMENU;
	wcex.lpszClassName	= MainClassName;
	wcex.hIconSm		= LoadIcon  (hInst, (LPCTSTR)IDI_MAINSMALL);

	if (!RegisterClassEx(&amp;wcex))
		return FALSE;

	//--------

	wcex.lpfnWndProc    = (WNDPROC)MapWindowProc;
	wcex.lpszClassName  = MapClassName;
	wcex.lpszMenuName	= NULL;

	if (!RegisterClassEx(&amp;wcex))
		return FALSE;

	//--------

	return TRUE;
</code></pre>
<p>Hier wird das MDIClient-Control erstellt:</p>
<pre><code class="language-cpp">CLIENTCREATESTRUCT ccs;
	ccs.hWindowMenu  = GetSubMenu(GetMenu(hWnd), 0);
	ccs.idFirstChild = 1000;

	hMDIClient = CreateWindow(&quot;MDICLIENT&quot;,
		                      &quot;&quot;,
							  WS_CHILD | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE,
							  150,
							  0,
							  440,
							  480,
							  hWnd,
							  NULL,
							  hInst,
							  &amp;ccs);
</code></pre>
<p>Hier wird das Fenster erstellt (Name der Klasse stimmt)</p>
<pre><code class="language-cpp">MDICREATESTRUCT mcs;
	mcs.x      = 10;
	mcs.y      = 10;
	mcs.cx     = width;
	mcs.cy     = height;
	mcs.hOwner = App-&gt;hInst;
	mcs.style  = WS_CHILD | WS_VISIBLE |  WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
	mcs.szClass= MapClassName;
	mcs.szTitle= Caption;
	mcs.lParam = NULL;

	MessageBox(NULL, MyClassName, Caption, 64);

	Handle = (HWND) SendMessage (ParentHandle, WM_MDICREATE, 0, 
             (LONG) (LPMDICREATESTRUCT) &amp;mcs);

	if (!Handle) MessageBox(NULL, &quot;Fenster kann nicht erstellt werden&quot;,&quot;Fehler&quot;,16);
	if (!Handle) return;
</code></pre>
<p>Dennoch bekomme ich den Fehler, dass das Fenster nicht erstellt werden konnte..</p>
<p>Oder muss hier noch was rein?</p>
<pre><code class="language-cpp">LRESULT CALLBACK MapWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

	return false;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/76084/mdi-warum-geht-es-nicht</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 08:36:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/76084.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Jun 2004 16:43:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MDI - Warum geht es nicht? on Mon, 07 Jun 2004 16:43:42 GMT]]></title><description><![CDATA[<p>Hi!<br />
Ja, ich habe schon die Suchfunktion benutzt - aber da kam ich auch nicht viel weiter.</p>
<p>Hier werden die Klassen registriert:</p>
<pre><code class="language-cpp">WNDCLASSEX wcex;

	wcex.cbSize         = sizeof(WNDCLASSEX); 

	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= (WNDPROC)WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInst;
	wcex.hIcon			= LoadIcon  (hInst, (LPCTSTR)IDI_MAINLARGE);
	wcex.hCursor		= LoadCursor(NULL,  IDC_ARROW);
	wcex.hbrBackground	= CreateSolidBrush( RGB(128, 128, 128) );
	wcex.lpszMenuName	= (LPCSTR)IDR_MAINMENU;
	wcex.lpszClassName	= MainClassName;
	wcex.hIconSm		= LoadIcon  (hInst, (LPCTSTR)IDI_MAINSMALL);

	if (!RegisterClassEx(&amp;wcex))
		return FALSE;

	//--------

	wcex.lpfnWndProc    = (WNDPROC)MapWindowProc;
	wcex.lpszClassName  = MapClassName;
	wcex.lpszMenuName	= NULL;

	if (!RegisterClassEx(&amp;wcex))
		return FALSE;

	//--------

	return TRUE;
</code></pre>
<p>Hier wird das MDIClient-Control erstellt:</p>
<pre><code class="language-cpp">CLIENTCREATESTRUCT ccs;
	ccs.hWindowMenu  = GetSubMenu(GetMenu(hWnd), 0);
	ccs.idFirstChild = 1000;

	hMDIClient = CreateWindow(&quot;MDICLIENT&quot;,
		                      &quot;&quot;,
							  WS_CHILD | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE,
							  150,
							  0,
							  440,
							  480,
							  hWnd,
							  NULL,
							  hInst,
							  &amp;ccs);
</code></pre>
<p>Hier wird das Fenster erstellt (Name der Klasse stimmt)</p>
<pre><code class="language-cpp">MDICREATESTRUCT mcs;
	mcs.x      = 10;
	mcs.y      = 10;
	mcs.cx     = width;
	mcs.cy     = height;
	mcs.hOwner = App-&gt;hInst;
	mcs.style  = WS_CHILD | WS_VISIBLE |  WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
	mcs.szClass= MapClassName;
	mcs.szTitle= Caption;
	mcs.lParam = NULL;

	MessageBox(NULL, MyClassName, Caption, 64);

	Handle = (HWND) SendMessage (ParentHandle, WM_MDICREATE, 0, 
             (LONG) (LPMDICREATESTRUCT) &amp;mcs);

	if (!Handle) MessageBox(NULL, &quot;Fenster kann nicht erstellt werden&quot;,&quot;Fehler&quot;,16);
	if (!Handle) return;
</code></pre>
<p>Dennoch bekomme ich den Fehler, dass das Fenster nicht erstellt werden konnte..</p>
<p>Oder muss hier noch was rein?</p>
<pre><code class="language-cpp">LRESULT CALLBACK MapWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

	return false;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/535291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535291</guid><dc:creator><![CDATA[ProfEich]]></dc:creator><pubDate>Mon, 07 Jun 2004 16:43:42 GMT</pubDate></item><item><title><![CDATA[Reply to MDI - Warum geht es nicht? on Mon, 07 Jun 2004 18:09:37 GMT]]></title><description><![CDATA[<p>Ich glaub ich sollte mir mal ne Brille kaufen. Zu bekloppt x.x</p>
<pre><code class="language-cpp">default:
   return DefMDIChildProc(hWnd, message, wParam, lParam);
</code></pre>
<p>Mit dem sollte es dann doch gehen...</p>
<p>Thread kann geschlossen / gelöscht (whatever) werdeen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/535390</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535390</guid><dc:creator><![CDATA[ProfEich]]></dc:creator><pubDate>Mon, 07 Jun 2004 18:09:37 GMT</pubDate></item><item><title><![CDATA[Reply to MDI - Warum geht es nicht? on Mon, 07 Jun 2004 18:11:20 GMT]]></title><description><![CDATA[<p>Wenn du in der WindowProc-Funktion ständig 'false' zurück gibst brauchst du dich nicht wundern wenn es nicht funktioniert <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>So sollte es funktionieren; wenn nicht, dann muss es noch wo anders Fehler geben.</p>
<pre><code class="language-cpp">LRESULT CALLBACK MapWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
  switch (message)
  {
  /*case:
  .
  .
  .*/
  case WM_DESTROY:
    PostQuitMessage(0);
    return 0;
  }
  return DefFrameProc(hWnd, hWndClient, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/535394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535394</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Mon, 07 Jun 2004 18:11:20 GMT</pubDate></item></channel></rss>