<?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 erzeugen]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich lerne erst WinApi. Ich hab hier ein sehr kleinen code, welcher ein fenster erzeugen soll. Das Programm lässt sich problemlos compilieren und auch starten. Leider wird da kein Fenster angezeigt. Was habe ich falch gemacht?</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

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

char szClassName[] = &quot;WinAppTest&quot;;

int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
					LPSTR lpszCmdLine, int nShowCmd)
{
	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 */

    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowsProcedure;
    wincl.style = CS_DBLCLKS;
    wincl.cbSize = sizeof (WNDCLASSEX);
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = NULL;
    wincl.cbClsExtra = 0;
    wincl.cbWndExtra = 0;
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;

    if (!RegisterClassEx (&amp;wincl))
        return 0;

    hwnd = CreateWindowEx (
           0,                   /* Extended possibilites for variation */
           szClassName,         /* Classname */
           &quot;win_test1&quot;,       /* Title Text */
           WS_OVERLAPPEDWINDOW, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           100,                 /* The programs width */
           100,                 /* and height in pixels */
           HWND_DESKTOP,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           hThisInstance,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    ShowWindow (hwnd, 0);

	while(GetMessage(&amp;messages, NULL, 0, 0))
	{
		TranslateMessage(&amp;messages);
		DispatchMessage(&amp;messages);
	}

	return(messages.wParam);

}

LRESULT CALLBACK WindowsProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	return DefWindowProc(hwnd, message, wParam, lParam);
}
</code></pre>
<p>Für Eure Hilfe wäre ich Euch sehr dankbar</p>
<p>gruss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/118243/fenster-erzeugen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 21:56:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/118243.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Aug 2005 14:54:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fenster erzeugen on Tue, 16 Aug 2005 14:54:36 GMT]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich lerne erst WinApi. Ich hab hier ein sehr kleinen code, welcher ein fenster erzeugen soll. Das Programm lässt sich problemlos compilieren und auch starten. Leider wird da kein Fenster angezeigt. Was habe ich falch gemacht?</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

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

char szClassName[] = &quot;WinAppTest&quot;;

int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
					LPSTR lpszCmdLine, int nShowCmd)
{
	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 */

    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowsProcedure;
    wincl.style = CS_DBLCLKS;
    wincl.cbSize = sizeof (WNDCLASSEX);
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = NULL;
    wincl.cbClsExtra = 0;
    wincl.cbWndExtra = 0;
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;

    if (!RegisterClassEx (&amp;wincl))
        return 0;

    hwnd = CreateWindowEx (
           0,                   /* Extended possibilites for variation */
           szClassName,         /* Classname */
           &quot;win_test1&quot;,       /* Title Text */
           WS_OVERLAPPEDWINDOW, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           100,                 /* The programs width */
           100,                 /* and height in pixels */
           HWND_DESKTOP,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           hThisInstance,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    ShowWindow (hwnd, 0);

	while(GetMessage(&amp;messages, NULL, 0, 0))
	{
		TranslateMessage(&amp;messages);
		DispatchMessage(&amp;messages);
	}

	return(messages.wParam);

}

LRESULT CALLBACK WindowsProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	return DefWindowProc(hwnd, message, wParam, lParam);
}
</code></pre>
<p>Für Eure Hilfe wäre ich Euch sehr dankbar</p>
<p>gruss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/853501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/853501</guid><dc:creator><![CDATA[linu*x*bie]]></dc:creator><pubDate>Tue, 16 Aug 2005 14:54:36 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster erzeugen on Tue, 16 Aug 2005 14:59:30 GMT]]></title><description><![CDATA[<p>hmm fehler gefunden:</p>
<pre><code class="language-cpp">ShowWindow (hwnd, 0);
</code></pre>
<p>letzter Argument darf nicht 0 sein.<br />
Vielen Dank an alle die sich dennoch bemücht haben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>gruss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/853503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/853503</guid><dc:creator><![CDATA[linu*x*bie]]></dc:creator><pubDate>Tue, 16 Aug 2005 14:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster erzeugen on Tue, 16 Aug 2005 15:02:57 GMT]]></title><description><![CDATA[<p>Hi,<br />
ein Fehler liegt zumindst schonmal hier:</p>
<pre><code class="language-cpp">ShowWindow (hwnd, 0);
</code></pre>
<p>die 0 ist definiert als SW_HIDE. Nutze besser SW_SHOW <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Gruss,<br />
DeSoVoDaMu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/853505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/853505</guid><dc:creator><![CDATA[DeSoVoDaMu]]></dc:creator><pubDate>Tue, 16 Aug 2005 15:02:57 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster erzeugen on Wed, 17 Aug 2005 15:17:29 GMT]]></title><description><![CDATA[<p>Danke für Deine Antwort <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Das war der Fehler.</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/854317</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/854317</guid><dc:creator><![CDATA[linu*x*bie]]></dc:creator><pubDate>Wed, 17 Aug 2005 15:17:29 GMT</pubDate></item></channel></rss>