<?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[Eigene Vorlage]]></title><description><![CDATA[<p>Hey Leute.<br />
Ich hab mir ne eigene Vorlage gemacht, weil ich die beim Wizard bekackt find...<br />
Ich poste mal den Code hier, falls etwas falsch ist oder man besser machen könnte korriegiert mich bittö^^</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;--&gt;Hier AppName&lt;--&quot;); // Hier eigenen AppNamen eintragen!

    HWND     hwnd;
    MSG      msg;
    WNDCLASS wndclass;

    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(LTGRAY_BRUSH);
    wndclass.lpszMenuName  = NULL;
    wndclass.lpszClassName = szAppName;

    if(!RegisterClass(&amp;wndclass))
    {
        MessageBox(NULL,TEXT(&quot;Programm arbeitet mit Unicode und setzt Windows NT voraus!&quot;),szAppName,MB_ICONERROR);
        return 0;
    }

    hwnd = CreateWindow(szAppName,              /* Name der Fensterklasse */
                        szAppName,              /* Fenstertitel */
                        WS_OVERLAPPEDWINDOW,    /* Fensterstil */
                        CW_USEDEFAULT,          /* X-Position des Fensters */
                        CW_USEDEFAULT,          /* Y-Position des Fensters */
                        CW_USEDEFAULT,          /* Fensterbreite */
                        CW_USEDEFAULT,          /* Fensterhöhe */
                        NULL,                   /* Übergeordnetes Fenster */
                        NULL,                   /* Menü */
                        hInstance,              /* Programm-Kopiezähler (Programm-ID) */
                        NULL);                  /* Zusätzlicher Parameter (MDI) */

    ShowWindow(hwnd,iCmdShow);
    UpdateWindow(hwnd);

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

    return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
        case WM_CREATE:
            return 0;
        case WM_PAINT:
            return 0;
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
        default:
            return DefWindowProc(hwnd,message,wParam,lParam);
    }

    return 0;
}
</code></pre>
<p>Mfg Wikinger75!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/244065/eigene-vorlage</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 03:21:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/244065.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 Jun 2009 15:32:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Eigene Vorlage on Wed, 24 Jun 2009 15:32:16 GMT]]></title><description><![CDATA[<p>Hey Leute.<br />
Ich hab mir ne eigene Vorlage gemacht, weil ich die beim Wizard bekackt find...<br />
Ich poste mal den Code hier, falls etwas falsch ist oder man besser machen könnte korriegiert mich bittö^^</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;--&gt;Hier AppName&lt;--&quot;); // Hier eigenen AppNamen eintragen!

    HWND     hwnd;
    MSG      msg;
    WNDCLASS wndclass;

    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(LTGRAY_BRUSH);
    wndclass.lpszMenuName  = NULL;
    wndclass.lpszClassName = szAppName;

    if(!RegisterClass(&amp;wndclass))
    {
        MessageBox(NULL,TEXT(&quot;Programm arbeitet mit Unicode und setzt Windows NT voraus!&quot;),szAppName,MB_ICONERROR);
        return 0;
    }

    hwnd = CreateWindow(szAppName,              /* Name der Fensterklasse */
                        szAppName,              /* Fenstertitel */
                        WS_OVERLAPPEDWINDOW,    /* Fensterstil */
                        CW_USEDEFAULT,          /* X-Position des Fensters */
                        CW_USEDEFAULT,          /* Y-Position des Fensters */
                        CW_USEDEFAULT,          /* Fensterbreite */
                        CW_USEDEFAULT,          /* Fensterhöhe */
                        NULL,                   /* Übergeordnetes Fenster */
                        NULL,                   /* Menü */
                        hInstance,              /* Programm-Kopiezähler (Programm-ID) */
                        NULL);                  /* Zusätzlicher Parameter (MDI) */

    ShowWindow(hwnd,iCmdShow);
    UpdateWindow(hwnd);

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

    return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
        case WM_CREATE:
            return 0;
        case WM_PAINT:
            return 0;
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
        default:
            return DefWindowProc(hwnd,message,wParam,lParam);
    }

    return 0;
}
</code></pre>
<p>Mfg Wikinger75!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732232</guid><dc:creator><![CDATA[Wikinger75]]></dc:creator><pubDate>Wed, 24 Jun 2009 15:32:16 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Vorlage on Wed, 24 Jun 2009 19:42:56 GMT]]></title><description><![CDATA[<blockquote>
<pre><code class="language-cpp">static TCHAR szAppName[] = TEXT(&quot;--&gt;Hier AppName&lt;--&quot;); // Hier eigenen AppNamen eintragen!
</code></pre>
</blockquote>
<p>1. Warum static?<br />
2. WinMain?, Wenn schon TCHAR dann tWinMain!<br />
3. WM_PAINT ohne NeginPaint/EndPaint heißt endlose WM_APINT bearbeitung und hohe Prozessorlast</p>
<p>Da finde ich den Code den der Wizard erzeugt aber x-mal besser.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732359</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 24 Jun 2009 19:42:56 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Vorlage on Thu, 25 Jun 2009 14:53:10 GMT]]></title><description><![CDATA[<p>Hi Wikinger75,<br />
Deine Frage wird kaum alle Teilnehmer einhellig mit einem bestimmten Ergebnis beantworten, denn dazu sind die Geschmäcker, Prioritäten und Interessen einfach zu unterschiedlich.</p>
<p>Aber wenn es um das einfachste Win32-API Grundgerüst geht und Du die Punkte von Martin beachtest, siehts so in Ordnung aus (habs nur gelesen, nicht compiliert o.ä.)</p>
<p>Guck Dir mal zum Vergleich auch das &quot;scratch program&quot; von Raymond Chen an:<br />
<a href="http://blogs.msdn.com/oldnewthing/archive/2003/07/23/54576.aspx" rel="nofollow">http://blogs.msdn.com/oldnewthing/archive/2003/07/23/54576.aspx</a><br />
Er verwendet dieses Grundgerüst für seine Untersuchungen bzw. Erklärungen im Rahmen seines Blogs &quot;The Old New Thing&quot;.</p>
<p>@ Martin Richter:</p>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>2. WinMain?, Wenn schon TCHAR dann tWinMain!</p>
</blockquote>
<p>tWinMain ?<br />
Hab ich noch nie gehört (gelesen).<br />
Wieder was neues gelernt, auch wenns nur ne Kleinigkeit ist, Danke Martin!</p>
<p>Gruß Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732750</guid><dc:creator><![CDATA[Mmacher]]></dc:creator><pubDate>Thu, 25 Jun 2009 14:53:10 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Vorlage on Thu, 25 Jun 2009 15:19:43 GMT]]></title><description><![CDATA[<blockquote>
<p>1. Warum static?</p>
</blockquote>
<p>Ka^^</p>
<blockquote>
<p>2. WinMain?, Wenn schon TCHAR dann tWinMain!</p>
</blockquote>
<p>Hmm nie gehört, aber gut. THX!^^</p>
<blockquote>
<p>3. WM_PAINT ohne NeginPaint/EndPaint heißt endlose WM_APINT bearbeitung und hohe Prozessorlast</p>
</blockquote>
<p>Muss ich noch einfügen.</p>
<blockquote>
<p>Hi Wikinger75,<br />
Deine Frage wird kaum alle Teilnehmer einhellig mit einem bestimmten Ergebnis beantworten, denn dazu sind die Geschmäcker, Prioritäten und Interessen einfach zu unterschiedlich.</p>
<p>Aber wenn es um das einfachste Win32-API Grundgerüst geht und Du die Punkte von Martin beachtest, siehts so in Ordnung aus (habs nur gelesen, nicht compiliert o.ä.)</p>
<p>Guck Dir mal zum Vergleich auch das &quot;scratch program&quot; von Raymond Chen an:<br />
<a href="http://blogs.msdn.com/oldnewthing/archive/2003/07/23/54576.aspx" rel="nofollow">http://blogs.msdn.com/oldnewthing/archive/2003/07/23/54576.aspx</a><br />
Er verwendet dieses Grundgerüst für seine Untersuchungen bzw. Erklärungen im Rahmen seines Blogs &quot;The Old New Thing&quot;.</p>
</blockquote>
<p>Hmm interesanter Artikel.^^</p>
<p>Kleine Info noch ich habe das Buch &quot;Windows Programmierung 5. Auflage - Das Entwicklerhandbuch zur Win32-API&quot;. Da hab ich das her er benutzt auch immer WinMain statt tWinMain und dabei TCHAR, wo ist der unterschied da?<br />
Ich bin auch im iNet auf folgendes gestoßen<br />
RegisterClass und RegisterClassEx, wo ist der unterschied von den Normalen und den Ex funktionen?</p>
<p>Neben Frage:<br />
Wie sollte man ein WinAPI Prog schreiben? Im Prozeduallem C-Still und das was man braucht in Klassen oder alles Komplett mit Klasen im OOP-C++-Stil?</p>
<p>Mfg Wikinger75!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732766</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732766</guid><dc:creator><![CDATA[Wikinger75]]></dc:creator><pubDate>Thu, 25 Jun 2009 15:19:43 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Vorlage on Thu, 25 Jun 2009 15:44:57 GMT]]></title><description><![CDATA[<p>Du hast den Petzold. Vollziehe einfach nach, was Petzold als Beispiele vorgibt. Damit lernst Du - auch ohne Klassen und OOP - Windows-Anwendungen zu programmieren. Viele Deiner Fragen erledigen sich dann von allein. Alles weitere probierst Du selbst aus. Es gibt keinen allgemein gültigen einzigen Programmierstil.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732776</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Thu, 25 Jun 2009 15:44:57 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Vorlage on Thu, 25 Jun 2009 15:47:18 GMT]]></title><description><![CDATA[<blockquote>
<p>Du hast den Petzold. Vollziehe einfach nach, was Petzold als Beispiele vorgibt. Damit lernst Du - auch ohne Klassen und OOP - Windows-Anwendungen zu programmieren. Viele Deiner Fragen erledigen sich dann von allein. Alles weitere probierst Du selbst aus. Es gibt keinen allgemein gültigen einzigen Programmierstil.</p>
</blockquote>
<p>Gut, dann lese ich mir den Petzold mal richtig durch und wnen noch fragen offen sind kuck ich im iNet nach oder Frage notfalls hier nach^^<br />
THX for help!^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732777</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732777</guid><dc:creator><![CDATA[Wikinger75]]></dc:creator><pubDate>Thu, 25 Jun 2009 15:47:18 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Vorlage on Thu, 25 Jun 2009 15:51:17 GMT]]></title><description><![CDATA[<p>von welchem wizard ist hier die rede? gibt es so einen im vs2008 pro?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1732782</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1732782</guid><dc:creator><![CDATA[wizzer3]]></dc:creator><pubDate>Thu, 25 Jun 2009 15:51:17 GMT</pubDate></item></channel></rss>