<?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[Fenster wird nur kurz angezeigt]]></title><description><![CDATA[<p>Hier der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR szCmdLine,
                    int iCmdShow)

{
    static TCHAR szAppName[] = TEXT (&quot;HelloWin!&quot;);
    HWND hwnd;               /* This is the handle for our window */
    MSG msg;            /* Here messages to the application are saved */
    WNDCLASS wndclass;        /* Data structure for the windowclass */

    wndclass.style = CS_HREDRAW | CS_VREDRAW;                 
    wndclass.lpfnWndProc = WndProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = hInstance;
    wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = szAppName;

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClass (&amp;wndclass))
    {
        MessageBox (NULL, TEXT (&quot;Dieses Programm setzt ein aktuelles Betriebsystem vorraus!&quot;), szAppName, MB_ICONERROR);
        return 0;
    }
    /* The class is registered, let's create the program*/
    hwnd = CreateWindow (szAppName,                   /* Extended possibilites for variation */
           TEXT (&quot;Das erste Windowsprogramm!&quot;),
           WS_OVERLAPPEDWINDOW,
           CW_USEDEFAULT,
           CW_USEDEFAULT,
           CW_USEDEFAULT,
           CW_USEDEFAULT,
           NULL,
           NULL,         
           hInstance,
           NULL);

    /* 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;msg, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&amp;msg);
        /* Send message to WindowProcedure */
        DispatchMessage(&amp;msg);
    }

    /* The program return-value is 0 - The value that PostQuitMessage() gave */
    return msg.wParam;
}

/*  This function is called by the Windows function DispatchMessage()  */

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
        HDC hdc;
        PAINTSTRUCT ps;
        RECT rect;

    switch (message)                  /* handle the messages */
    {
        case WM_PAINT:

            hdc = BeginPaint(hwnd, &amp;ps);

            GetClientRect(hwnd, &amp;rect);
            DrawText (hdc, TEXT (&quot;Hello WinXp!&quot;), -1, &amp;rect, DT_SINGLELINE|DT_CENTER|DT_VCENTER);
        case WM_DESTROY:
            PostQuitMessage(0);       /* send a WM_QUIT to the message queue */
            return 0;
    }
    return DefWindowProc(hwnd, message, wParam, lParam);
}
</code></pre>
<p>Mein Problem: Das Fenster bleibt nur ganz kurz da, und ist dann gleich weg.<br />
Ich code mit dem Dev-c++.<br />
Ich hab WinXp drauf und als ich das ding zum ersten mal zum laufen gebracht habe, hatte ich den style windows classic drin. da funktionierte das programm auch nicht. es erstellte einen prozess.<br />
als ich dann den style auf normal umschaltete, passiert es, dass das fenster nur kurz da bleibt.<br />
Bitte helft mir! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/130622/fenster-wird-nur-kurz-angezeigt</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 17:11:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/130622.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Dec 2005 15:25:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fenster wird nur kurz angezeigt on Sun, 25 Dec 2005 15:25:26 GMT]]></title><description><![CDATA[<p>Hier der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR szCmdLine,
                    int iCmdShow)

{
    static TCHAR szAppName[] = TEXT (&quot;HelloWin!&quot;);
    HWND hwnd;               /* This is the handle for our window */
    MSG msg;            /* Here messages to the application are saved */
    WNDCLASS wndclass;        /* Data structure for the windowclass */

    wndclass.style = CS_HREDRAW | CS_VREDRAW;                 
    wndclass.lpfnWndProc = WndProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = hInstance;
    wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = szAppName;

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClass (&amp;wndclass))
    {
        MessageBox (NULL, TEXT (&quot;Dieses Programm setzt ein aktuelles Betriebsystem vorraus!&quot;), szAppName, MB_ICONERROR);
        return 0;
    }
    /* The class is registered, let's create the program*/
    hwnd = CreateWindow (szAppName,                   /* Extended possibilites for variation */
           TEXT (&quot;Das erste Windowsprogramm!&quot;),
           WS_OVERLAPPEDWINDOW,
           CW_USEDEFAULT,
           CW_USEDEFAULT,
           CW_USEDEFAULT,
           CW_USEDEFAULT,
           NULL,
           NULL,         
           hInstance,
           NULL);

    /* 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;msg, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&amp;msg);
        /* Send message to WindowProcedure */
        DispatchMessage(&amp;msg);
    }

    /* The program return-value is 0 - The value that PostQuitMessage() gave */
    return msg.wParam;
}

/*  This function is called by the Windows function DispatchMessage()  */

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
        HDC hdc;
        PAINTSTRUCT ps;
        RECT rect;

    switch (message)                  /* handle the messages */
    {
        case WM_PAINT:

            hdc = BeginPaint(hwnd, &amp;ps);

            GetClientRect(hwnd, &amp;rect);
            DrawText (hdc, TEXT (&quot;Hello WinXp!&quot;), -1, &amp;rect, DT_SINGLELINE|DT_CENTER|DT_VCENTER);
        case WM_DESTROY:
            PostQuitMessage(0);       /* send a WM_QUIT to the message queue */
            return 0;
    }
    return DefWindowProc(hwnd, message, wParam, lParam);
}
</code></pre>
<p>Mein Problem: Das Fenster bleibt nur ganz kurz da, und ist dann gleich weg.<br />
Ich code mit dem Dev-c++.<br />
Ich hab WinXp drauf und als ich das ding zum ersten mal zum laufen gebracht habe, hatte ich den style windows classic drin. da funktionierte das programm auch nicht. es erstellte einen prozess.<br />
als ich dann den style auf normal umschaltete, passiert es, dass das fenster nur kurz da bleibt.<br />
Bitte helft mir! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/949593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949593</guid><dc:creator><![CDATA[IpOperator]]></dc:creator><pubDate>Sun, 25 Dec 2005 15:25:26 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster wird nur kurz angezeigt on Sun, 25 Dec 2005 15:29:03 GMT]]></title><description><![CDATA[<p>EndPaint und break vermisse ich in deinem Code.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/949595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949595</guid><dc:creator><![CDATA[LOL!]]></dc:creator><pubDate>Sun, 25 Dec 2005 15:29:03 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster wird nur kurz angezeigt on Sun, 25 Dec 2005 15:34:30 GMT]]></title><description><![CDATA[<p>thx, das hab ich übersehen <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/949598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949598</guid><dc:creator><![CDATA[IpOperator]]></dc:creator><pubDate>Sun, 25 Dec 2005 15:34:30 GMT</pubDate></item></channel></rss>