<?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[Konsole immer offen -&amp;gt; nicht gut]]></title><description><![CDATA[<p>Hallöchen.</p>
<p>Ich habe grad wieder eines meiner ersten WinAPI-Programme geschrieben und stehe schon wieder vor einem Problem.<br />
Alles lässt sich wunderbar compilieren, aber wenn ich das Programm ausführe, ist die Konsole noch im HIntergrund zu sehen.</p>
<p>Das möchte ich eigentlich nicht.<br />
Hier mal zu meiner WinMain-Funktion:</p>
<pre><code class="language-cpp">int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR szCmdLine,
                    int iCmdShow)

{
    HWND hwnd;               /* 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 = hInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW;                 /* 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 = NULL;                 /* No menu */
    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
    wincl.cbWndExtra = 0;                      /* structure or the window instance */
    /* Use Windows's default color as the background of the window */
    wincl.hbrBackground = (HBRUSH) (COLOR_BACKGROUND);

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClassEx (&amp;wincl)){
        MessageBox (NULL, &quot;Fehler beim öffnen des Fensters&quot;, &quot;Fehler&quot;, 
                    MB_OK | MB_ICONINFORMATION);    
        return 0;
    }  

    /* The class is registered, let's create the program*/
    hwnd = CreateWindowEx (
           WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT, /* Extended possibilites for variation */
           szClassName,         /* Classname */
           &quot;Testfenster&quot;,       /* Title Text */
           WS_OVERLAPPEDWINDOW, /* default window */
           200,       /* Windows decides the position */
           100,       /* where the window ends up on the screen */
           400,                 /* The programs width */
           300,                 /* and height in pixels */
           HWND_DESKTOP,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           hInstance,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (hwnd, iCmdShow);
    UpdateWindow (hwnd);

    /* 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>Erkennt hier jemand einen Fehler?<br />
Ich glaub ja es hat was mit der ShowWindow-Funktion zu tun, aber hab damit auch schon alles ausprobiert.</p>
<p>Vielen Dank schon mal jetzt!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147895/konsole-immer-offen-gt-nicht-gut</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 02:07:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147895.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 May 2006 13:30:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Konsole immer offen -&amp;gt; nicht gut on Sun, 21 May 2006 13:30:29 GMT]]></title><description><![CDATA[<p>Hallöchen.</p>
<p>Ich habe grad wieder eines meiner ersten WinAPI-Programme geschrieben und stehe schon wieder vor einem Problem.<br />
Alles lässt sich wunderbar compilieren, aber wenn ich das Programm ausführe, ist die Konsole noch im HIntergrund zu sehen.</p>
<p>Das möchte ich eigentlich nicht.<br />
Hier mal zu meiner WinMain-Funktion:</p>
<pre><code class="language-cpp">int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR szCmdLine,
                    int iCmdShow)

{
    HWND hwnd;               /* 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 = hInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW;                 /* 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 = NULL;                 /* No menu */
    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
    wincl.cbWndExtra = 0;                      /* structure or the window instance */
    /* Use Windows's default color as the background of the window */
    wincl.hbrBackground = (HBRUSH) (COLOR_BACKGROUND);

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClassEx (&amp;wincl)){
        MessageBox (NULL, &quot;Fehler beim öffnen des Fensters&quot;, &quot;Fehler&quot;, 
                    MB_OK | MB_ICONINFORMATION);    
        return 0;
    }  

    /* The class is registered, let's create the program*/
    hwnd = CreateWindowEx (
           WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT, /* Extended possibilites for variation */
           szClassName,         /* Classname */
           &quot;Testfenster&quot;,       /* Title Text */
           WS_OVERLAPPEDWINDOW, /* default window */
           200,       /* Windows decides the position */
           100,       /* where the window ends up on the screen */
           400,                 /* The programs width */
           300,                 /* and height in pixels */
           HWND_DESKTOP,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           hInstance,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (hwnd, iCmdShow);
    UpdateWindow (hwnd);

    /* 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>Erkennt hier jemand einen Fehler?<br />
Ich glaub ja es hat was mit der ShowWindow-Funktion zu tun, aber hab damit auch schon alles ausprobiert.</p>
<p>Vielen Dank schon mal jetzt!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062100</guid><dc:creator><![CDATA[Max3000]]></dc:creator><pubDate>Sun, 21 May 2006 13:30:29 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole immer offen -&amp;gt; nicht gut on Sun, 21 May 2006 14:55:06 GMT]]></title><description><![CDATA[<p>Erezueg doch eine &quot;Windows&quot; Anwendung und keine &quot;Consolen&quot; Anwendung!<br />
Was für eine IDE? Das kannst Du bei den Compiler-Settings einstellen (Subsystem:WINDOWS)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062145</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062145</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 21 May 2006 14:55:06 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole immer offen -&amp;gt; nicht gut on Sun, 21 May 2006 16:39:10 GMT]]></title><description><![CDATA[<p>Ich benutze den Devcpp.</p>
<p>Aber so eine einstellung hab ich dort noch nicht gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062222</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062222</guid><dc:creator><![CDATA[Max3000]]></dc:creator><pubDate>Sun, 21 May 2006 16:39:10 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole immer offen -&amp;gt; nicht gut on Sun, 21 May 2006 18:00:38 GMT]]></title><description><![CDATA[<p>Soll ich Dich ins Compiler-Forum verschieben? Mit WinAPI hat das nix zu tun...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062292</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 21 May 2006 18:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole immer offen -&amp;gt; nicht gut on Mon, 22 May 2006 09:27:18 GMT]]></title><description><![CDATA[<p>Danke, ist nicht mehr notwendig.<br />
Wenn ich ein Projekt öffne, dann geht das jetzt, nur als einzelne cpp-datei nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062596</guid><dc:creator><![CDATA[Max3000]]></dc:creator><pubDate>Mon, 22 May 2006 09:27:18 GMT</pubDate></item></channel></rss>