<?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[Bringe mein MDI Fenster nicht zum erscheinen]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab ein kleines Problem mit einem MDI Fenster.<br />
Zuerst mal der Quelltext:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

#define IDM_FIRSTCHILD 5947375

wchar_t name[]=L&quot;LIBTEST&quot;;
wchar_t mdin[]=L&quot;MDI&quot;;
__w64 long __stdcall WndProc (HWND hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam);
__w64 long __stdcall ViewProc(HWND hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam);

int WINAPI WinMain (HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance,
				    char *szCmdLine, int iCmdShow)
{
	HACCEL          hAccel;
	MSG             msg;
	WNDCLASSW       wndclass;
	HWND			  hwnd, hwnd_client;
	HDC				  hdc = NULL;

    ZeroMemory(&amp;hwnd,     sizeof(HWND__*));
    ZeroMemory(&amp;msg,      sizeof(MSG));
	ZeroMemory(&amp;wndclass, sizeof(WNDCLASSW));

	wndclass.style         = CS_HREDRAW | CS_VREDRAW;
	wndclass.lpfnWndProc   = WndProc;
	wndclass.cbClsExtra    = 0;
	wndclass.cbWndExtra    = 0;
	wndclass.hInstance     = hInstance ;
	wndclass.hIcon         = NULL ;
	wndclass.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH);
	wndclass.lpszMenuName  = NULL;
	wndclass.lpszClassName = name;

	if(RegisterClass(&amp;wndclass))
    {
        MessageBoxW(hwnd, L&quot;Die Anwendung konnte nicht richtig initalisiert werden. Wenn es nicht klappt beten sie ein bisschen vielleicht klappts dann! ;-)&quot;, L&quot;Error&quot;, MB_OK);
        return 0;
    }

	wndclass.style         = CS_HREDRAW | CS_VREDRAW;
	wndclass.lpfnWndProc   = ViewProc;
	wndclass.cbClsExtra    = 0;
	wndclass.cbWndExtra    = 0;
	wndclass.hInstance     = hInstance ;
	wndclass.hIcon         = NULL ;
	wndclass.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH);
	wndclass.lpszMenuName  = NULL;
	wndclass.lpszClassName = L&quot;View&quot;;

	if (!RegisterClass(&amp;wndclass))
    {
        MessageBoxW(hwnd, L&quot;Die Anwendung konnte nicht richtig initalisiert werden. Wenn es nicht klappt beten sie ein bisschen vielleicht klappts dann! ;-)&quot;, L&quot;Error&quot;, MB_OK);
        return 0;
    }

	hAccel = LoadAccelerators(hInstance,name);

	hwnd = CreateWindow (name, name, WS_SYSMENU|WS_CAPTION ,
		                 CW_USEDEFAULT, CW_USEDEFAULT,
		                 640, 480,
						 NULL, NULL, hInstance, NULL);

	hwnd_client = GetWindow(hwnd, GW_CHILD);

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

	while (GetMessage (&amp;msg, NULL, 0, 0))
	{
		if(!TranslateMDISysAccel(hwnd_client,&amp;msg) &amp;&amp; 
		   !TranslateAccelerator(hwnd,hAccel,&amp;msg))
		{
			TranslateMessage (&amp;msg);
			DispatchMessage (&amp;msg);
		}
	}

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

__w64 long __stdcall WndProc (HWND__* hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam)
{
	CLIENTCREATESTRUCT clientcreate;
	static HWND	hwnd_client;
	HWND  hwnd_child;
	MDICREATESTRUCT mdicreate;
	HINSTANCE hInst = NULL;

    switch (message)
	{
	case WM_CREATE:
		clientcreate.idFirstChild = IDM_FIRSTCHILD;
		hwnd_client = CreateWindow (TEXT (&quot;MDICLIENT&quot;), NULL,
                                     WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,   
                                     10, 10, 100, 100, hwnd, 0, hInst,
                                     (PSTR) &amp;clientcreate) ;

        mdicreate.szClass = L&quot;HALLO&quot; ;
        mdicreate.szTitle = TEXT (&quot;Hello&quot;) ;
        mdicreate.hOwner  = hInst ;
        mdicreate.x       = 10 ;
        mdicreate.y       = 10 ;
        mdicreate.cx      = 100 ;
        mdicreate.cy      = 100 ;
        mdicreate.style   = 0 ;
        mdicreate.lParam  = 0 ;

        hwnd_child = (HWND) SendMessage (hwnd_client, WM_MDICREATE, 0,
                                   (LPARAM) (LPMDICREATESTRUCT) &amp;mdicreate) ;

		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		MessageBeep(50);
		break;
	}

     return DefFrameProc (hwnd, hwnd_client, message, wParam, lParam) ;
}

__w64 long __stdcall ViewProc(HWND hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam)
{
    static HWND     hwnd_client, hwndFrame ;

    switch (message)
	{
	case WM_CREATE:
        hwnd_client = GetParent (hwnd) ;
        hwndFrame  =  GetParent (hwnd_client) ;
		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		MessageBeep(50);
		break;
	}

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

}
</code></pre>
<p>Das Fenster erscheint wie erwartet aber es wird seltsamerweise kein MDI Fenster angezeigt!<br />
Ich bitte euch um Hilfe und bin euch über jede Hilfe dankbar<br />
Schon mal danke im vorraus</p>
<p>Multiple Document Interf.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/172181/bringe-mein-mdi-fenster-nicht-zum-erscheinen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 03:48:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/172181.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Feb 2007 09:44:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bringe mein MDI Fenster nicht zum erscheinen on Fri, 02 Feb 2007 09:44:34 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab ein kleines Problem mit einem MDI Fenster.<br />
Zuerst mal der Quelltext:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

#define IDM_FIRSTCHILD 5947375

wchar_t name[]=L&quot;LIBTEST&quot;;
wchar_t mdin[]=L&quot;MDI&quot;;
__w64 long __stdcall WndProc (HWND hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam);
__w64 long __stdcall ViewProc(HWND hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam);

int WINAPI WinMain (HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance,
				    char *szCmdLine, int iCmdShow)
{
	HACCEL          hAccel;
	MSG             msg;
	WNDCLASSW       wndclass;
	HWND			  hwnd, hwnd_client;
	HDC				  hdc = NULL;

    ZeroMemory(&amp;hwnd,     sizeof(HWND__*));
    ZeroMemory(&amp;msg,      sizeof(MSG));
	ZeroMemory(&amp;wndclass, sizeof(WNDCLASSW));

	wndclass.style         = CS_HREDRAW | CS_VREDRAW;
	wndclass.lpfnWndProc   = WndProc;
	wndclass.cbClsExtra    = 0;
	wndclass.cbWndExtra    = 0;
	wndclass.hInstance     = hInstance ;
	wndclass.hIcon         = NULL ;
	wndclass.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH);
	wndclass.lpszMenuName  = NULL;
	wndclass.lpszClassName = name;

	if(RegisterClass(&amp;wndclass))
    {
        MessageBoxW(hwnd, L&quot;Die Anwendung konnte nicht richtig initalisiert werden. Wenn es nicht klappt beten sie ein bisschen vielleicht klappts dann! ;-)&quot;, L&quot;Error&quot;, MB_OK);
        return 0;
    }

	wndclass.style         = CS_HREDRAW | CS_VREDRAW;
	wndclass.lpfnWndProc   = ViewProc;
	wndclass.cbClsExtra    = 0;
	wndclass.cbWndExtra    = 0;
	wndclass.hInstance     = hInstance ;
	wndclass.hIcon         = NULL ;
	wndclass.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH);
	wndclass.lpszMenuName  = NULL;
	wndclass.lpszClassName = L&quot;View&quot;;

	if (!RegisterClass(&amp;wndclass))
    {
        MessageBoxW(hwnd, L&quot;Die Anwendung konnte nicht richtig initalisiert werden. Wenn es nicht klappt beten sie ein bisschen vielleicht klappts dann! ;-)&quot;, L&quot;Error&quot;, MB_OK);
        return 0;
    }

	hAccel = LoadAccelerators(hInstance,name);

	hwnd = CreateWindow (name, name, WS_SYSMENU|WS_CAPTION ,
		                 CW_USEDEFAULT, CW_USEDEFAULT,
		                 640, 480,
						 NULL, NULL, hInstance, NULL);

	hwnd_client = GetWindow(hwnd, GW_CHILD);

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

	while (GetMessage (&amp;msg, NULL, 0, 0))
	{
		if(!TranslateMDISysAccel(hwnd_client,&amp;msg) &amp;&amp; 
		   !TranslateAccelerator(hwnd,hAccel,&amp;msg))
		{
			TranslateMessage (&amp;msg);
			DispatchMessage (&amp;msg);
		}
	}

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

__w64 long __stdcall WndProc (HWND__* hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam)
{
	CLIENTCREATESTRUCT clientcreate;
	static HWND	hwnd_client;
	HWND  hwnd_child;
	MDICREATESTRUCT mdicreate;
	HINSTANCE hInst = NULL;

    switch (message)
	{
	case WM_CREATE:
		clientcreate.idFirstChild = IDM_FIRSTCHILD;
		hwnd_client = CreateWindow (TEXT (&quot;MDICLIENT&quot;), NULL,
                                     WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,   
                                     10, 10, 100, 100, hwnd, 0, hInst,
                                     (PSTR) &amp;clientcreate) ;

        mdicreate.szClass = L&quot;HALLO&quot; ;
        mdicreate.szTitle = TEXT (&quot;Hello&quot;) ;
        mdicreate.hOwner  = hInst ;
        mdicreate.x       = 10 ;
        mdicreate.y       = 10 ;
        mdicreate.cx      = 100 ;
        mdicreate.cy      = 100 ;
        mdicreate.style   = 0 ;
        mdicreate.lParam  = 0 ;

        hwnd_child = (HWND) SendMessage (hwnd_client, WM_MDICREATE, 0,
                                   (LPARAM) (LPMDICREATESTRUCT) &amp;mdicreate) ;

		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		MessageBeep(50);
		break;
	}

     return DefFrameProc (hwnd, hwnd_client, message, wParam, lParam) ;
}

__w64 long __stdcall ViewProc(HWND hwnd, unsigned int message, __w64 unsigned int wParam, __w64 long lParam)
{
    static HWND     hwnd_client, hwndFrame ;

    switch (message)
	{
	case WM_CREATE:
        hwnd_client = GetParent (hwnd) ;
        hwndFrame  =  GetParent (hwnd_client) ;
		break;

	case WM_DESTROY:
		PostQuitMessage(0);
		MessageBeep(50);
		break;
	}

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

}
</code></pre>
<p>Das Fenster erscheint wie erwartet aber es wird seltsamerweise kein MDI Fenster angezeigt!<br />
Ich bitte euch um Hilfe und bin euch über jede Hilfe dankbar<br />
Schon mal danke im vorraus</p>
<p>Multiple Document Interf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1221580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1221580</guid><dc:creator><![CDATA[Multiple Document Interf.]]></dc:creator><pubDate>Fri, 02 Feb 2007 09:44:34 GMT</pubDate></item><item><title><![CDATA[Reply to Bringe mein MDI Fenster nicht zum erscheinen on Fri, 02 Feb 2007 20:14:13 GMT]]></title><description><![CDATA[<p>Hat sich im ICQ ja geklärt, hier aber nochmal ein simples Beispiel:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

// Globaler Unsinn
//
const TCHAR applicationClassName[] = TEXT( &quot;MainFrm&quot; );
const TCHAR mdiChildClassName[] = TEXT( &quot;MDIChildFrm&quot; );

enum { IDM_FIRSTCHILD = 0xff };

// Forwarddeclarations
//
LRESULT APIENTRY WndProc( HWND, UINT, WPARAM, LPARAM );
LRESULT APIENTRY WndProcMDIChild( HWND, UINT, WPARAM, LPARAM );

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow )
{
	MSG msg;

	// Mainframe registrieren
	//
	WNDCLASSEX cls =
	{
		sizeof( WNDCLASSEX ),
		CS_VREDRAW | CS_HREDRAW,
		WndProc,
		0, 0,
		hInstance,
		LoadIcon( NULL, IDI_APPLICATION ),
		LoadCursor( NULL, IDC_ARROW ),
		GetSysColorBrush( COLOR_BTNFACE ),
		NULL,
		applicationClassName,
		LoadIcon( NULL, IDI_APPLICATION )
	};

	if ( !RegisterClassEx( &amp;cls ) )
	{
		MessageBox( NULL, TEXT( &quot;Fehler beim registrieren der Klasse 'MainFrm'&quot; ), TEXT( &quot;Error&quot; ), MB_OK | MB_ICONERROR );
		return 0;
	}

	// MDI Child Frame registrieren
	//
	cls.lpfnWndProc   = WndProcMDIChild;
	cls.hIcon		  = NULL;
	cls.lpszClassName = mdiChildClassName;

	if ( !RegisterClassEx( &amp;cls ) )
	{
		MessageBox( NULL, TEXT( &quot;Fehler beim registrieren der Klasse 'MDIChildFrm'&quot; ), TEXT( &quot;Error&quot; ), MB_OK | MB_ICONERROR );
		return 0;
	}

	// Fenster erzeugen
	//
	HWND hWnd = CreateWindowEx( NULL, 
								applicationClassName,
								TEXT( &quot;My MDI Application&quot; ),
								WS_OVERLAPPEDWINDOW,
								0, 0,
								800, 600,
								NULL, 
								NULL,
								hInstance,
								NULL );

	HWND hWndMDIClient = GetWindow( hWnd, GW_CHILD );

	ShowWindow( hWnd, SW_SHOW );
	UpdateWindow( hWnd );

	while ( GetMessage( &amp;msg, NULL, 0, 0 ) )
	{
		if ( !TranslateMDISysAccel( hWndMDIClient, &amp;msg ) )
		{
			TranslateMessage( &amp;msg );
			DispatchMessage( &amp;msg );
		}
	}

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

LRESULT APIENTRY WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	switch ( uMsg )
	{
	case WM_CREATE:
		{
			// MDI Client erzeugen
			//
			CLIENTCREATESTRUCT ccs =
			{
				NULL,
				IDM_FIRSTCHILD
			}; 

			HINSTANCE hInstance = GetModuleHandle( NULL );
			HWND hWndClient = CreateWindowEx( NULL, 
											  TEXT( &quot;MDICLIENT&quot; ), 
											  NULL, 
											  WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL,
											  CW_USEDEFAULT, 
											  CW_USEDEFAULT,
											  CW_USEDEFAULT,
											  CW_USEDEFAULT,
											  hWnd,
											  NULL,
											  hInstance,
											  ( LPSTR )&amp;ccs );

			ShowWindow( hWndClient, SW_SHOW );

			// MDI Child hinzufuegen
			//

			MDICREATESTRUCT childFrm =
			{
				mdiChildClassName,
				TEXT( &quot;Foobar&quot; ),
				hInstance,
				0, 0, 200, 200,
				0,
				0
			};

			SendMessage( hWndClient, WM_MDICREATE, 0, ( LPARAM )( LPMDICREATESTRUCT )&amp;childFrm );
		}
		break;

	case WM_DESTROY:
		PostQuitMessage( 0 );
		break;

	case WM_SIZE:
		{
			HWND hWndMDIClient = GetWindow( hWnd, GW_CHILD );
			RECT rect;

			GetClientRect( hWnd, &amp;rect );	
			SetWindowPos( hWndMDIClient, NULL, 0, 0, rect.right, rect.bottom, SWP_NOZORDER );
		}
		break;
	}

	return DefWindowProc( hWnd, uMsg, wParam, lParam );
}

LRESULT APIENTRY WndProcMDIChild( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	return DefWindowProc( hWnd, uMsg, wParam, lParam );
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1221952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1221952</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Fri, 02 Feb 2007 20:14:13 GMT</pubDate></item></channel></rss>