<?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[button = Neues Fenster]]></title><description><![CDATA[<p>hallo</p>
<p>ich würde gerne, durch den Drück auf einen Button ein neues Fenster erstellen lassen. wie kann ich die bewerkstelligen?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/163566/button-neues-fenster</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 12:42:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/163566.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Oct 2006 22:50:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to button = Neues Fenster on Mon, 30 Oct 2006 22:50:32 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>ich würde gerne, durch den Drück auf einen Button ein neues Fenster erstellen lassen. wie kann ich die bewerkstelligen?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1164976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164976</guid><dc:creator><![CDATA[Schnalle]]></dc:creator><pubDate>Mon, 30 Oct 2006 22:50:32 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Mon, 30 Oct 2006 23:15:04 GMT]]></title><description><![CDATA[<p>Und was soll Dein neues Fenster darstellen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1164985</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164985</guid><dc:creator><![CDATA[Opscript]]></dc:creator><pubDate>Mon, 30 Oct 2006 23:15:04 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Tue, 31 Oct 2006 11:04:16 GMT]]></title><description><![CDATA[<p>so ein Fenster wie das Hauptfenster bloß ohne die buttons als inhalt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165199</guid><dc:creator><![CDATA[Schnalle]]></dc:creator><pubDate>Tue, 31 Oct 2006 11:04:16 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Tue, 31 Oct 2006 11:31:41 GMT]]></title><description><![CDATA[<p><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="➡"
    /> <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp" rel="nofollow">CreateWindow</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165231</guid><dc:creator><![CDATA[eas]]></dc:creator><pubDate>Tue, 31 Oct 2006 11:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Tue, 31 Oct 2006 13:48:29 GMT]]></title><description><![CDATA[<p>Schreib einfach einen WM_COMMAND-Handler für deinen Button und ruf dort CreateWindow(Ex) auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165352</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 31 Oct 2006 13:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Tue, 31 Oct 2006 14:03:57 GMT]]></title><description><![CDATA[<p>huhu</p>
<p>meinste so:</p>
<pre><code>case WM_COMMAND:
             {
                  switch(LOWORD(wParam))
                  {    
                       case BUT_START:
                       {

                       hstart = CreateWindowEx (NULL ,&quot;test&quot; ,&quot;muh&quot; , WS_POPUPWINDOW | WS_CHILD | WS_VISIBLE,
                       0 ,0 , 500 ,500 , hwnd, (HMENU) 1, hInstance, NULL);  

                       }
                       break;
</code></pre>
<p>naja passiert nichts.... müsste doch irgendwie bei wm_create abgehandelt werden oderwie?</p>
<p>was hat es eigentliczh mit wm_create auf sich? wird die message nur bei programmstart gesendet oder wie?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165370</guid><dc:creator><![CDATA[schnalle]]></dc:creator><pubDate>Tue, 31 Oct 2006 14:03:57 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Tue, 31 Oct 2006 14:13:48 GMT]]></title><description><![CDATA[<p>schnalle schrieb:</p>
<blockquote>
<p>naja passiert nichts.... müsste doch irgendwie bei wm_create abgehandelt werden oderwie?</p>
</blockquote>
<p>Hm ist die Fensterklasse überhaupt regisitriert ?</p>
<p>schnalle schrieb:</p>
<blockquote>
<p>was hat es eigentliczh mit wm_create auf sich? wird die message nur bei programmstart gesendet oder wie?</p>
</blockquote>
<p>WM_CREATE wird beim Erstellen des Fensters gesendet. Also nur einmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165380</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 31 Oct 2006 14:13:48 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Tue, 31 Oct 2006 19:23:23 GMT]]></title><description><![CDATA[<p>huhu ich würde den Code gerne auslagern um alles ein wenig übersichtlicher zu halten. hab da erstmal folgendes entworfen</p>
<pre><code>LRESULT CALLBACK WndProc_start (HWND, UINT, WPARAM, LPARAM);

int but_start(HWND)
{ 

    LPCSTR lpszAppName = &quot; &quot;;
    LPCSTR lpszTitle   = &quot; &quot;;
    HINSTANCE hInstance;          
    HWND       hStart;
    MSG         msg_start;
    WNDCLASSEX   wc;

    wc.cbSize        =  sizeof(WNDCLASSEX);
    wc.style         =  CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   =  WndProc_start;
    wc.cbClsExtra    =  0;
    wc.cbWndExtra    =  0;
    wc.hInstance     =  hInstance;
    wc.hCursor       =  LoadCursor(NULL,IDC_ARROW);
    wc.hIcon         =  LoadIcon(NULL, IDI_APPLICATION);
    wc.hbrBackground =  (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.lpszClassName =  lpszAppName;
    wc.lpszMenuName  =  lpszAppName;
    wc.hIconSm       =  LoadIcon(NULL, IDI_APPLICATION);

    if(!RegisterClassEx(&amp;wc))
    {
        MessageBox(NULL, &quot;Window Registration Failed!&quot;, &quot;Error!&quot;,
        MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    hStart = CreateWindowEx(NULL,
                         lpszAppName,
                         lpszTitle,
                         WS_OVERLAPPEDWINDOW,
                         0,
                         0,
                         500,
                         500,
                         hwnd,
                         NULL,
                         hInstance,
                         NULL);

    if(hStart == NULL)
    {
         MessageBox(NULL, &quot;Window Creation Failed!&quot;, &quot;Error!&quot;,
         MB_ICONEXCLAMATION | MB_OK);
         return 0;
    }

    ShowWindow(hStart, SW_SHOW);
    UpdateWindow(hStart);

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

LRESULT CALLBACK WndProc_start(HWND hStart, UINT msg_start, WPARAM wParam, LPARAM lParam)
{
   switch (msg_start)
   {
   case WM_DESTROY:
      {
         PostQuitMessage(0);
         return 0;
      }
   }
   return DefWindowProc(hStart, msg_start, wParam, lParam);
}
</code></pre>
<p>würde die funktionen dann mit</p>
<pre><code>but_start(hwnd);
</code></pre>
<p>und</p>
<pre><code>LRESULT CALLBACK WndProc_start(HWND hStart, UINT msg_start, WPARAM wParam, LPARAM lParam)
</code></pre>
<p>im code einbinden<br />
so klappt aber alles irgendwie nicht. kann auch irgnedwie keine klaren gedanken mehr fassen... kann mir vllt jemand weiterhelfen?</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165690</guid><dc:creator><![CDATA[Schnalle]]></dc:creator><pubDate>Tue, 31 Oct 2006 19:23:23 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Tue, 31 Oct 2006 22:31:56 GMT]]></title><description><![CDATA[<p>Du solltest Dir besser noch einmal ein paar Tutorials<br />
durchlesen.</p>
<p>Siehe hier: <a href="http://win-api.de" rel="nofollow">http://win-api.de</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165822</guid><dc:creator><![CDATA[Opscript]]></dc:creator><pubDate>Tue, 31 Oct 2006 22:31:56 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Wed, 01 Nov 2006 06:35:36 GMT]]></title><description><![CDATA[<p>Du musst für deine neue Fensterklasse schon auch einen neuen Fensterklassennamen verwenden. 2x lpszAppName wird nicht gehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165887</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 01 Nov 2006 06:35:36 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Thu, 02 Nov 2006 08:32:23 GMT]]></title><description><![CDATA[<p>schnalle schrieb:</p>
<blockquote>
<pre><code>case WM_COMMAND:
             {
                  switch(LOWORD(wParam))
                  {    
                       case BUT_START:
                       {
                                   
                       hstart = CreateWindowEx (NULL ,&quot;test&quot; ,&quot;muh&quot; , WS_POPUPWINDOW | WS_CHILD | WS_VISIBLE,
                       0 ,0 , 500 ,500 , hwnd, (HMENU) 1, hInstance, NULL);  
                                
                                   
                       }
                       break;
</code></pre>
</blockquote>
<p>Bei hInstance eines Childfensters darf keine eigene Instanz stehen, sondern die hInstance des Parentfensters: ((LPCREATESTRUCT)lParam)-&gt;hInstance</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1166709</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1166709</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 02 Nov 2006 08:32:23 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Thu, 02 Nov 2006 15:29:44 GMT]]></title><description><![CDATA[<p>also wenn ich das Fenster in meiner main aufrufe gibt es keine probleme. Das Fenster lässt sich ohne Probleme öffnen.</p>
<p>Nun hab ich aber immer noch das problem mit der Auslagerung... irgendwie bekomme ich es nicht mit den Argumenten vorwärtsdeklarationen etc... hab so ne auslagerung noch nicht gemacht deswegen bin ich atm ein wenig Ratlos</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1167085</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1167085</guid><dc:creator><![CDATA[Schnalle]]></dc:creator><pubDate>Thu, 02 Nov 2006 15:29:44 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Sat, 04 Nov 2006 18:18:09 GMT]]></title><description><![CDATA[<p>bediene dich doch mit CreateDialog falls das hier noch nicht angesprochen wurde</p>
<p>HWND dlghwnd;</p>
<p>switch(msg)<br />
{<br />
case WM_COMMAND:<br />
{<br />
switch(LOWORD(wParam))<br />
{<br />
case IDD_BUTTON:<br />
dlghwnd = CreateDialog(GetModuleHandl(NULL),<br />
MAKEINTRESOURCE(IDD_TOOLBAR),<br />
hwnd, DlgProc);<br />
ShowWindow(dlghwnd,SW_SHOW);<br />
break;<br />
...</p>
<p>...oder bediene dich dem tutorial <a href="http://www.winprog.org/tutorial/" rel="nofollow">http://www.winprog.org/tutorial/</a> (ist mein liebling)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168443</guid><dc:creator><![CDATA[Fachmann]]></dc:creator><pubDate>Sat, 04 Nov 2006 18:18:09 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Sat, 04 Nov 2006 19:10:57 GMT]]></title><description><![CDATA[<p>Elektronix schrieb:</p>
<blockquote>
<p>[...]<br />
Bei hInstance eines Childfensters darf keine eigene Instanz stehen, sondern die hInstance des Parentfensters: ((LPCREATESTRUCT)lParam)-&gt;hInstance</p>
</blockquote>
<p><em>lParam</em> enthält NUR unter <em>WM_CREATE</em> ein Zeiger auf das <em>CREATESTRUCT</em> des entsprechenden Fensters. Man sollte hier</p>
<pre><code class="language-cpp">GetModuleHandle(NULL);
</code></pre>
<p>verwenden oder in der <em>WinMain</em> die Instanz-Handle-Variable globalisieren <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>Fachmann schrieb:</p>
<blockquote>
<p>bediene dich doch mit CreateDialog falls das hier noch nicht angesprochen wurde</p>
<p>HWND dlghwnd;</p>
<p>switch(msg)<br />
{<br />
case WM_COMMAND:<br />
{<br />
switch(LOWORD(wParam))<br />
{<br />
case IDD_BUTTON:<br />
dlghwnd = CreateDialog(GetModuleHandl(NULL),<br />
MAKEINTRESOURCE(IDD_TOOLBAR),<br />
hwnd, DlgProc);<br />
ShowWindow(dlghwnd,SW_SHOW);<br />
break;<br />
...</p>
</blockquote>
<p>Also <em>CreateDialog</em> erstellt Dialoge, keine Toolbars (?!)...und selbst wenn das irgendwie klappen könnte,<br />
tippe ich auf Glück. Für solche Dinge gibt es <em>CreateWindow(Ex)</em>. Übrigens braucht eine Toolbar keine<br />
Dialog-Prozedur <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/1168491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168491</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sat, 04 Nov 2006 19:10:57 GMT</pubDate></item><item><title><![CDATA[Reply to button = Neues Fenster on Sat, 04 Nov 2006 20:16:31 GMT]]></title><description><![CDATA[<p>toolbars werden häufig mit dem verfahren gemacht weil die nicht erst returnen wenn das fesnter geschlossen wird so wie es bei &quot;DialogBox(...)&quot; der fall ist. ausserdem kann man mit CreateDialog und DialogBox einfach eine fertige resource benutzen. ich benutz garkeine windowsklasse ich mach als hauptfenster einfach en dialog der flexibel ist <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/1168529</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168529</guid><dc:creator><![CDATA[Fachmann]]></dc:creator><pubDate>Sat, 04 Nov 2006 20:16:31 GMT</pubDate></item></channel></rss>