<?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[C++ win application]]></title><description><![CDATA[<p>German:<br />
Hi @ all ich brauche hilfe undzwar....<br />
ich und mein kumpel wollen c++ lernen und programmieren...<br />
wir ham auch schon eine windows applikation hinbekommen....<br />
aber nun kommt mein problemm....<br />
ich habe ein windows Fenster wo nichts drinn steht<br />
aber ich möchte das da was drin steht wie bekomme ich das hin???<br />
unten ist ein code</p>
<p>English:<br />
Hi @ all I need help and ....<br />
I and my buddy want to learn C + + programming ...<br />
we have already a Windows application ....<br />
But now comes my problem ....<br />
I have a window where there is nothing<br />
but I would like to because there is something<br />
How does that work?<br />
below is a code</p>
<pre><code class="language-cpp">]#include &lt;windows.h&gt;

/*  Declare Windows procedure  */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/*  Make the class name into a global variable  */
char szClassName[ ] = &quot;Info&quot;;

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{
    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 = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS;                 /* 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))
        return 0;

    /* The class is registered, let's create the program*/
    hwnd = CreateWindowEx (
           0,                   /* Extended possibilites for variation */
           szClassName,         /* Classname */
           &quot;Info&quot;,              /* Title Text */
           WS_OVERLAPPEDWINDOW, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           544,                 /* The programs width */
           375,                 /* 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 */
           );

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

    /* 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;
}

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

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  /* handle the messages */
    {
        case WM_DESTROY:
            PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
            break;
        default:                     /* for messages that we don't deal with */
            return DefWindowProc (hwnd, message, wParam, lParam);
    }

    return 0;

}
</code></pre>
<p>mfG: Holger</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/229551/c-win-application</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 04:36:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/229551.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 Dec 2008 14:37:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 15:06:22 GMT]]></title><description><![CDATA[<p>German:<br />
Hi @ all ich brauche hilfe undzwar....<br />
ich und mein kumpel wollen c++ lernen und programmieren...<br />
wir ham auch schon eine windows applikation hinbekommen....<br />
aber nun kommt mein problemm....<br />
ich habe ein windows Fenster wo nichts drinn steht<br />
aber ich möchte das da was drin steht wie bekomme ich das hin???<br />
unten ist ein code</p>
<p>English:<br />
Hi @ all I need help and ....<br />
I and my buddy want to learn C + + programming ...<br />
we have already a Windows application ....<br />
But now comes my problem ....<br />
I have a window where there is nothing<br />
but I would like to because there is something<br />
How does that work?<br />
below is a code</p>
<pre><code class="language-cpp">]#include &lt;windows.h&gt;

/*  Declare Windows procedure  */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/*  Make the class name into a global variable  */
char szClassName[ ] = &quot;Info&quot;;

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{
    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 = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS;                 /* 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))
        return 0;

    /* The class is registered, let's create the program*/
    hwnd = CreateWindowEx (
           0,                   /* Extended possibilites for variation */
           szClassName,         /* Classname */
           &quot;Info&quot;,              /* Title Text */
           WS_OVERLAPPEDWINDOW, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           544,                 /* The programs width */
           375,                 /* 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 */
           );

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

    /* 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;
}

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

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  /* handle the messages */
    {
        case WM_DESTROY:
            PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
            break;
        default:                     /* for messages that we don't deal with */
            return DefWindowProc (hwnd, message, wParam, lParam);
    }

    return 0;

}
</code></pre>
<p>mfG: Holger</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629934</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629934</guid><dc:creator><![CDATA[Holger94]]></dc:creator><pubDate>Sat, 13 Dec 2008 15:06:22 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 14:40:35 GMT]]></title><description><![CDATA[<p>Musst Elemente in dem Fenster erstellen, Stichwort Child-Windows (siehe beliebiges WinAPI-Tutorial).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629935</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 13 Dec 2008 14:40:35 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 15:00:33 GMT]]></title><description><![CDATA[<p>Weg mit dem Gefrickel!<br />
Projekt auf Multibyte einstellen und los gehts:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;string&gt;

long __stdcall WindowProcess(HWND windowHandle, unsigned message, WPARAM wParam, LPARAM lParam);

int __stdcall WinMain(HINSTANCE, HINSTANCE, char*, int)
{
	WNDCLASS windowClass = { };
	windowClass.lpfnWndProc = WindowProcess;
	windowClass.hCursor = LoadCursor(0, IDC_ARROW);
	windowClass.lpszClassName = &quot;Main&quot;;

	RegisterClass(&amp;windowClass);

	CreateWindow(&quot;Main&quot;, 0, WS_VISIBLE | WS_POPUP, 100, 100, 640, 480, 0, 0, 0, 0);

	MSG message;
	while(GetMessage(&amp;message, 0 , 0, 0))
		DispatchMessage(&amp;message);
}

long __stdcall WindowProcess(HWND windowHandle, unsigned message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case WM_LBUTTONDOWN:
		SendMessage(windowHandle, WM_SYSCOMMAND, SC_MOVE | 0x0002, 0);
		return 0;
	case WM_PAINT:
		{
			// Erstmal paar Sachen holen
			RECT clientArea;
			GetClientRect(windowHandle, &amp;clientArea);
			HDC deviceContext = GetDC(windowHandle);

			// Dann paar Sachen erstellen
			HBRUSH backgroundBrush = CreateSolidBrush(RGB(75, 75, 75));
			HFONT textFont = CreateFont(-MulDiv(20, GetDeviceCaps(deviceContext, LOGPIXELSY), 72), 0, 0, 0, FW_BOLD, false, false, false, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, &quot;Arial&quot;);

			// Sachen als aktuell setzen
			SetBkColor(deviceContext, RGB(75, 75, 75));
			SetTextColor(deviceContext, RGB(255, 200, 100));
			SelectObject(deviceContext, textFont);

			// Endlich zeichnen
			BeginPaint(windowHandle, 0);
			FillRect(deviceContext, &amp;clientArea, backgroundBrush);
			std::string myText = &quot;Hello, World!&quot;;
			DrawText(deviceContext, myText.c_str(), myText.size(), &amp;clientArea, DT_SINGLELINE | DT_VCENTER | DT_CENTER);
			EndPaint(windowHandle, 0);

			// Und aufräumen
			DeleteObject(textFont);
			DeleteObject(backgroundBrush);
			DeleteDC(deviceContext);
		}
		return 0;
	}

	return DefWindowProc(windowHandle, message, wParam, lParam);
}
</code></pre>
<p><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/1629947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629947</guid><dc:creator><![CDATA[Entfrickler v2.2]]></dc:creator><pubDate>Sat, 13 Dec 2008 15:00:33 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 15:10:51 GMT]]></title><description><![CDATA[<p>sorry aber da ich noch ein anfänger insolchen sachen bin weiß ich nicht genau was ihr mir da gerade erzählen wollt<br />
<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>villeicht bearbeitet mir einer den c++ code und schreibt dan rein wo was rein muss???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629949</guid><dc:creator><![CDATA[Holger94]]></dc:creator><pubDate>Sat, 13 Dec 2008 15:10:51 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 15:11:36 GMT]]></title><description><![CDATA[<p>Copy &amp; Paste mein code, kompilieren, ausführen. Einfacher geht's kaum...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629951</guid><dc:creator><![CDATA[Entfrickler v2.2]]></dc:creator><pubDate>Sat, 13 Dec 2008 15:11:36 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 15:12:40 GMT]]></title><description><![CDATA[<p>Vergiss deinen code :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629952</guid><dc:creator><![CDATA[Entfrickler v2.2]]></dc:creator><pubDate>Sat, 13 Dec 2008 15:12:40 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 15:17:33 GMT]]></title><description><![CDATA[<p>Entfrickler v2.2 schrieb:</p>
<blockquote>
<p>Copy &amp; Paste mein code, kompilieren, ausführen. Einfacher geht's kaum...</p>
</blockquote>
<p>den kann man net schließen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629953</guid><dc:creator><![CDATA[Holger94]]></dc:creator><pubDate>Sat, 13 Dec 2008 15:17:33 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 16:38:45 GMT]]></title><description><![CDATA[<p>wenn du sagst ihr wollt es lernen, habt ihr da schon vorkenntnisse von c++ und wollt versuchen jetzt ein gui zu programmieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629991</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629991</guid><dc:creator><![CDATA[Fahrstuhlmusik]]></dc:creator><pubDate>Sat, 13 Dec 2008 16:38:45 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 16:48:58 GMT]]></title><description><![CDATA[<p>Ja wollen wir</p>
<p>Fahrstuhlmusik schrieb:</p>
<blockquote>
<p>wenn du sagst ihr wollt es lernen, habt ihr da schon vorkenntnisse von c++ und wollt versuchen jetzt ein gui zu programmieren?</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1630001</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1630001</guid><dc:creator><![CDATA[kampf-gurke]]></dc:creator><pubDate>Sat, 13 Dec 2008 16:48:58 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 16:54:08 GMT]]></title><description><![CDATA[<p>Holger94 schrieb:</p>
<blockquote>
<p>ich und mein kumpel wollen c++ lernen und programmieren...<br />
wir ham auch schon eine windows applikation hinbekommen....</p>
</blockquote>
<p>Keine gute Idee, so C++ zu lernen.</p>
<p>Die Programmiersprache C++ bietet von sich aus keine GUI an, man arbeitet anfänglich also in der Konsole. Das reicht aber längstens, um die Sprachmittel zu erlernen. Mit der Zeit kann man dann auch andere Bibliotheken benutzen.</p>
<p>Klar kannst du auch so anfangen. Nur lernst du auf diese Weise nicht C++, sondern WinAPI, also ein betriebssystemspezifisches Framework, und das noch in C.</p>
<p>Falls du dich mit &quot;echtem&quot; C++ beschäftigen willst, kannst du dir in den FAQ Bücher- und Tutorialvorschläge anschauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1630005</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1630005</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sat, 13 Dec 2008 16:54:08 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 17:05:33 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>Holger94 schrieb:</p>
<blockquote>
<p>ich und mein kumpel wollen c++ lernen und programmieren...<br />
wir ham auch schon eine windows applikation hinbekommen....</p>
</blockquote>
<p>Keine gute Idee, so C++ zu lernen.</p>
<p>Die Programmiersprache C++ bietet von sich aus keine GUI an, man arbeitet anfänglich also in der Konsole. Das reicht aber längstens, um die Sprachmittel zu erlernen. Mit der Zeit kann man dann auch andere Bibliotheken benutzen.</p>
<p>Klar kannst du auch so anfangen. Nur lernst du auf diese Weise nicht C++, sondern WinAPI, also ein betriebssystemspezifisches Framework, und das noch in C.</p>
<p>Falls du dich mit &quot;echtem&quot; C++ beschäftigen willst, kannst du dir in den FAQ Bücher- und Tutorialvorschläge anschauen.</p>
</blockquote>
<p>also wir wollen einfach nur die grundkenntnisse von c++ lernen und dann evt. wenn wir ein bissel mehr wissen irgendetwas schreiben....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1630016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1630016</guid><dc:creator><![CDATA[Holger94]]></dc:creator><pubDate>Sat, 13 Dec 2008 17:05:33 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 17:07:58 GMT]]></title><description><![CDATA[<p>Holger94 schrieb:</p>
<blockquote>
<p>also wir wollen einfach nur die grundkenntnisse von c++ lernen und dann evt. wenn wir ein bissel mehr wissen irgendetwas schreib....</p>
</blockquote>
<p>Dann ist das, was du machst, wie gesagt die falsche Vorgehensweise.</p>
<p>Du kannst dir die folgenden Bücher anschauen, um C++ zu lernen:</p>
<ul>
<li>C++ Primer</li>
<li>Thinking in C++ (gibt es auch gratis als Online-PDF)</li>
</ul>
<p>Oder zumindest folgendes Tutorial:<br />
<a href="http://tutorial.schornboeck.net/inhalt.htm" rel="nofollow">http://tutorial.schornboeck.net/inhalt.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1630017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1630017</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sat, 13 Dec 2008 17:07:58 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 17:34:08 GMT]]></title><description><![CDATA[<p>den code von entwickler würd ich so auch nicht benutzen.<br />
die paintmethode sollte mit einem beginpaint beginnen und mit einem endpaint abschließen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1630049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1630049</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Sat, 13 Dec 2008 17:34:08 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 19:17:18 GMT]]></title><description><![CDATA[<p>Und nach den Grundlagen der Programmiersprache, würde ich eher auf ein Framework setzen, anstatt alles auf WinAPI Basis zu machen. Wird auf die Dauer recht mühsam.</p>
<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-81596.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-81596.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1630099</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1630099</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 13 Dec 2008 19:17:18 GMT</pubDate></item><item><title><![CDATA[Reply to C++ win application on Sat, 13 Dec 2008 22:44:52 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-14199.html" rel="nofollow">Phoemuex</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1630144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1630144</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sat, 13 Dec 2008 22:44:52 GMT</pubDate></item></channel></rss>