<?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 in Parent aufrufen?]]></title><description><![CDATA[<p>Hallo,</p>
<p>also ich habe ein Hauptfenster. In diesem soll nach dem klicken eines Buttons ein neues Fenster geöffnet werden, jedoch ist mir nich klar wie ich der WM_COMMAND das neue Fenster aufrufen kann?. Kann mir da einer Helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203275/neues-fenster-in-parent-aufrufen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 08:58:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203275.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Jan 2008 08:32:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 08:32:30 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>also ich habe ein Hauptfenster. In diesem soll nach dem klicken eines Buttons ein neues Fenster geöffnet werden, jedoch ist mir nich klar wie ich der WM_COMMAND das neue Fenster aufrufen kann?. Kann mir da einer Helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440337</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440337</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Jan 2008 08:32:30 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 08:50:41 GMT]]></title><description><![CDATA[<p>am besten du erstellst das fenster gleich zu beginn mit, und wenn der klick auf den button kommt, lässt dus einfach über ShowWindow () anzeigen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440351</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Mon, 21 Jan 2008 08:50:41 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 08:53:16 GMT]]></title><description><![CDATA[<p>aber woher kriege ich das handle zu dem fenster weil das handle ist ja in der einen LRESULT CALLBACK wo das fenster dann angezeigt werden soll nicht bekannt. Woher bekomme ich also das Handle?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440353</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Jan 2008 08:53:16 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 08:59:21 GMT]]></title><description><![CDATA[<p>entwede3r über FindWindow () oder du machst das Handle für das Fenster global</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440359</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Mon, 21 Jan 2008 08:59:21 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 09:06:52 GMT]]></title><description><![CDATA[<p>hWnd = CreateWindow(...)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440366</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 21 Jan 2008 09:06:52 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 09:07:27 GMT]]></title><description><![CDATA[<p>ich mache es mal anders, ich poste hier mal den code für das fenster was aufgerufen werden soll und das wie ich es aufrufe.</p>
<pre><code class="language-cpp">char ClassName[ ] = &quot;Abrechnungsplaner&quot;;
int neues_Fenster(HINSTANCE Window,HWND Parent)
{

   RECT ScreenCoords;
	if(!SystemParametersInfo(SPI_GETWORKAREA,NULL,&amp;ScreenCoords,NULL) )
	{
		MessageBox(NULL,&quot;Achtung&quot;,&quot;Ein Fehler&quot;,MB_ICONWARNING | MB_OK | MB_DEFBUTTON1);
		ScreenCoords.right = 1024;
		ScreenCoords.bottom = 768;
	}

    HWND fenster;               /* This is the handle for our window */
    MSG messages;            /* Here messages to the application are saved */
    WNDCLASSEX wincl;        /* Data structure for the windowclass */

    /* The Window structure */
    wincl.hInstance = Window;
    wincl.lpszClassName = ClassName;
    wincl.lpfnWndProc = New_Window_Procedure;      /* This function is called by windows */
    wincl.style = CS_HREDRAW|CS_VREDRAW;                 /* Catch double-clicks */
    wincl.cbSize = sizeof (WNDCLASSEX);

    /* Use default icon and mouse-pointer */
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = 0;                 /* No menu */
    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
    wincl.cbWndExtra = 0;                      /* structure or the window instance */
    /* Use Windows's default colour as the background of the window */
    wincl.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClassEx (&amp;wincl))
        return 0;

    /* The class is registered, let's create the program*/
    fenster = CreateWindowEx (
           0,                   /* Extended possibilites for variation */
           ClassName,         /* Classname */
           &quot;Abrechnungsplaner&quot;,       /* Title Text */
           WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           HEIGHT,                 /* The programs width */
           WIDTH,                 /* and height in pixels */
           Parent,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           Window,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (fenster, SW_NORMAL);
    UpdateWindow(fenster);

    /* Run the message loop. It will run until GetMessage() returns 0 */
    while (GetMessage (&amp;messages, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&amp;messages);
        /* Send message to WindowProcedure */
        DispatchMessage(&amp;messages);
    }

    /* The program return-value is 0 - The value that PostQuitMessage() gave */
    return messages.wParam;
}
</code></pre>
<p>das ist das fenster was aufgerufen werden soll</p>
<p>und hier das wie ich es aufrufen möchte</p>
<pre><code class="language-cpp">LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
      switch (message)                  /* handle the messages */
    {

       case WM_COMMAND:
        {
                 switch(LOWORD(wParam))
                 {

                     case IDM_SCHLIESSEN:

                     {
                          DestroyWindow(hwnd);
                          PostQuitMessage(0);
                          break;
                     }
                     case IDM_DEUTSCH:
                     {

                         //So und hier möchte ich gerne das neue Fenster aufrufen
//Diese LRESULT ist aber die Procedure in einem anderem Fenster

                          //wie muss ich hier das neue Fenster aufrufen??
                     }
          }

        default:                      /* for messages that we don't deal with */
            return DefWindowProc (hwnd, message, wParam, lParam);
    }

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1440367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440367</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Jan 2008 09:07:27 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 13:29:25 GMT]]></title><description><![CDATA[<blockquote>
<p>/So und hier möchte ich gerne das neue Fenster aufrufen<br />
//Diese LRESULT ist aber die Procedure in einem anderem Fenster<br />
//wie muss ich hier das neue Fenster aufrufen??</p>
</blockquote>
<p>Wie schon gesagt: Mit hWnd = CreateWindowEx. Wenn Du eine vordefinierte Fensterclasse verwendest (Button oder so), gibst Du die im 2. Parameter an (LPCTSTR lpClassName). Wenn Du eine eigene Fensterklasse verwendest, mußt Du die global erstellen (neue WndClassEx-Struktur anlegen) und mit RegisterClassEx registrieren. Die Zuordnung der LRESULT CALLBACK-Funktion gibst Du in der WndClassEx-Struktur an. Diese Klasse gibst Du dann in CreateWindowEx() als 2. Parameter ein. Man kann eine Prozedur auch mehreren Fenstern zuordnen, macht aber i. d. R. keinen Sinn.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440587</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 21 Jan 2008 13:29:25 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 13:32:53 GMT]]></title><description><![CDATA[<p>nee ich glaube ich wurde falsch verstanden, also nochmal: der code der an 1. stelle steht steht für das fenster was ich gerne aufrufen möchte und die LRESULT die als 2. steht, gehört zu meinem hauptfenster was von anfang gezeigt wird. jetzt soll wenn der button gedrückt wurde, diese fenster was ich euch als erstes gezeigt habe, angezeigft werden, jedoch klappt es nicht wenn ich einfach nur die funktion dieses fenster aufrufe...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440590</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440590</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Jan 2008 13:32:53 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 13:42:21 GMT]]></title><description><![CDATA[<p>Natürlich klappt das so nicht. Wenn das Fenster erstellt wird, erhält es die Nachricht WM_CREATE. Diese muß in der CALLBACK bearbeitet werden, indem Du z. B. ShowWindow((hChild, SW_SHOW) angibst (gibt verschiedene Möglichkeiten).<br />
Im Zweifelsfall kannst ja mal die CALLBACK-Funktion Deines Childs zeigen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440598</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 21 Jan 2008 13:42:21 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 14:02:52 GMT]]></title><description><![CDATA[<p>sooo ich poste mal das Fenster mit LRESULT welches angezeigt werden soll, bei einem klick<br />
problem an der Sache die MessageBox welche &quot;Fehler bei der Regestrierung&quot; beinhaltet wird angezeigt, also setzt da shcon der fehler ein.</p>
<pre><code class="language-cpp">#include &quot;Includes.h&quot;

int WINAPI neues_Fenster(HINSTANCE Window,HWND Parent)
{
    char ClassName[ ] = &quot;Abrechnungsplaner&quot;;

   RECT ScreenCoords;
	if(!SystemParametersInfo(SPI_GETWORKAREA,NULL,&amp;ScreenCoords,NULL) )
	{
		MessageBox(NULL,&quot;Achtung&quot;,&quot;Ein Fehler&quot;,MB_ICONWARNING | MB_OK | MB_DEFBUTTON1);
		ScreenCoords.right = 1024;
		ScreenCoords.bottom = 768;
	}

    HWND fenster;               /* This is the handle for our window */
    MSG messages2;            /* Here messages to the application are saved */
    WNDCLASS WndClass2;        /* Data structure for the windowclass */

	WndClass2.cbClsExtra		= 0;
	WndClass2.cbWndExtra		= 0;
	WndClass2.hbrBackground		= (HBRUSH)GetStockObject(LTGRAY_BRUSH);
	WndClass2.hCursor			= LoadCursor(NULL,IDC_ARROW);
	WndClass2.hIcon				= LoadIcon(NULL,IDI_APPLICATION);
	WndClass2.hInstance			= Window;
	WndClass2.lpfnWndProc		= New_Window_Procedure;
	WndClass2.lpszClassName		= ClassName;
	WndClass2.lpszMenuName		= NULL;
	WndClass2.style				= CS_HREDRAW | CS_VREDRAW;

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClass (&amp;WndClass2))
	{
		MessageBox(NULL,&quot;Fehler bei Registrierung!&quot;,&quot;Fehler!&quot;,MB_OK);
        return 1;
	}

    /* The class is registered, let's create the program*/
    fenster = CreateWindowEx (
           0,                   /* Extended possibilites for variation */
           ClassName,         /* Classname */
           &quot;Abrechnungsplaner&quot;,       /* Title Text */
           WS_CHILDWINDOW|WS_VISIBLE, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           HEIGHT-200,                 /* The programs width */
           WIDTH-100,                 /* and height in pixels */
           Parent,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           Window,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (fenster, SW_NORMAL);
    UpdateWindow(fenster);

    /* Run the message loop. It will run until GetMessage() returns 0 */
    while (GetMessage (&amp;messages2, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&amp;messages2);
        /* Send message to WindowProcedure */
        DispatchMessage(&amp;messages2);
    }

    /* The program return-value is 0 - The value that PostQuitMessage() gave */

    return messages2.wParam;
}

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

    switch (message)                  /* handle the messages */
    {
        case WM_DESTROY:
        {
            PostQuitMessage(0);
        }

        default:                      /* for messages that we don't deal with */
            return DefWindowProc (hwnd, message, wParam, lParam);
    }

    return 0;
}
</code></pre>
<p>so und das soll bei einem klick in einer anderen callback aufgerufen werden und angezeigt werden. jedoch kommt schon der fehler mit der registrierung</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440625</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Jan 2008 14:02:52 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 14:23:53 GMT]]></title><description><![CDATA[<p>Du hast einige Member der WndClass falsch angegeben:</p>
<pre><code>WndClass2.hInstance = Window;
</code></pre>
<p>weglassen.<br />
Und sicherheitshalber</p>
<pre><code>WndClass2.cbSize = Sizeof(WndClass2)
</code></pre>
<p>mit angeben.</p>
<p>Um den Umgang mit Childs zu lernen, würde ich mal ein Tutorial durcharbeiten:</p>
<p><a href="http://www.win-api.de/tutorials.php" rel="nofollow">http://www.win-api.de/tutorials.php</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440636</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 21 Jan 2008 14:23:53 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 14:26:14 GMT]]></title><description><![CDATA[<p>also da sagt er mir das WNDCLASS keinen member hat der cbSize heißt.--.-- Was soll ich da nun machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440640</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440640</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Jan 2008 14:26:14 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 15:10:19 GMT]]></title><description><![CDATA[<p>Stimmt, sorry. Hab sie mit WndClassEx verwechselt... <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>Trotzdem Tutorial reinziehen! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440688</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 21 Jan 2008 15:10:19 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Fenster in Parent aufrufen? on Mon, 21 Jan 2008 15:21:32 GMT]]></title><description><![CDATA[<p>hehe ok, danke trotzdem</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1440698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1440698</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Jan 2008 15:21:32 GMT</pubDate></item></channel></rss>