<?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[Menü auch ohne ExtendedClass-Anmeldung ???]]></title><description><![CDATA[<p>Hey!! ..</p>
<p>Ich versuche gerade ein Fenster mit Menüpunkten zu erstellen. Dazu habe ich mir mal Beispiele aus dem Net geholt ..</p>
<p>Bei der Anmeldung des Fensters habe ich jedoch früher nie eine gesamte WINDOWCLASSEX angemeldet ..</p>
<p>also nie so:</p>
<pre><code>wc.cbSize = sizeof(WNDCLASSEX);
   wc.style = 0;
   wc.lpfnWndProc = WndProc;
   wc.cbClsExtra = 0;
   wc.cbWndExtra = 0;
   wc.hInstance = hInstance;
   wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
   wc.hCursor         = LoadCursor(NULL, IDC_ARROW);
   wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
   wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);  //HIER MUSS JA DIE BEZEICHNUNG DES MENÜS HIN
   wc.lpszClassName = MainClassName;
   wc.hIconSm         = LoadIcon(hInstance, IDI_APPLICATION);
</code></pre>
<p>sonder immer mit:</p>
<pre><code>HWND Fenster = CreateWindowEX(0, WC_DIALOG, ... ) // ERSTELLUNG DES FENSTERS OHNE KLASSENANMELDUNG
</code></pre>
<p>Meine Frage nun:<br />
Gibt es eine Möglichkeit ohne eine Klassenanmeldung (so wie oben) ein Fenster mit einem Menü zu erstellen ???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/233246/menü-auch-ohne-extendedclass-anmeldung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 22:22:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/233246.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Feb 2009 15:53:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Mon, 02 Feb 2009 15:53:38 GMT]]></title><description><![CDATA[<p>Hey!! ..</p>
<p>Ich versuche gerade ein Fenster mit Menüpunkten zu erstellen. Dazu habe ich mir mal Beispiele aus dem Net geholt ..</p>
<p>Bei der Anmeldung des Fensters habe ich jedoch früher nie eine gesamte WINDOWCLASSEX angemeldet ..</p>
<p>also nie so:</p>
<pre><code>wc.cbSize = sizeof(WNDCLASSEX);
   wc.style = 0;
   wc.lpfnWndProc = WndProc;
   wc.cbClsExtra = 0;
   wc.cbWndExtra = 0;
   wc.hInstance = hInstance;
   wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
   wc.hCursor         = LoadCursor(NULL, IDC_ARROW);
   wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
   wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);  //HIER MUSS JA DIE BEZEICHNUNG DES MENÜS HIN
   wc.lpszClassName = MainClassName;
   wc.hIconSm         = LoadIcon(hInstance, IDI_APPLICATION);
</code></pre>
<p>sonder immer mit:</p>
<pre><code>HWND Fenster = CreateWindowEX(0, WC_DIALOG, ... ) // ERSTELLUNG DES FENSTERS OHNE KLASSENANMELDUNG
</code></pre>
<p>Meine Frage nun:<br />
Gibt es eine Möglichkeit ohne eine Klassenanmeldung (so wie oben) ein Fenster mit einem Menü zu erstellen ???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1656636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1656636</guid><dc:creator><![CDATA[System_Shutdown]]></dc:creator><pubDate>Mon, 02 Feb 2009 15:53:38 GMT</pubDate></item><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Tue, 03 Feb 2009 07:36:52 GMT]]></title><description><![CDATA[<p>MSDN oder Tutorial lesen: SetMenu!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1656983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1656983</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 03 Feb 2009 07:36:52 GMT</pubDate></item><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Tue, 03 Feb 2009 11:28:05 GMT]]></title><description><![CDATA[<p>Danke werds mir ansehen ^^ ..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1657137</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1657137</guid><dc:creator><![CDATA[System_Shutdown]]></dc:creator><pubDate>Tue, 03 Feb 2009 11:28:05 GMT</pubDate></item><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Tue, 03 Feb 2009 15:17:55 GMT]]></title><description><![CDATA[<p>Also folgendes hab ich jetzt aber das Menü zeigt sich nicht ..</p>
<p><strong>Menü.cpp</strong></p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;resource.h&gt;

bool Prozedur(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
     if(message == WM_CLOSE)
     {
                PostQuitMessage(0);
                }

     return 0;
     }

int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    MSG msg;
    HWND Fenster = CreateWindowEx(0, WC_DIALOG, &quot;Mein Fenster&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, NULL, NULL, NULL, NULL);

    SetWindowLong(Fenster, DWL_DLGPROC, (long)Prozedur);
    SetMenu(Fenster, (HMENU)MAKEINTRESOURCE(IDR_MENU1));

    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
                           TranslateMessage(&amp;msg);
                           DispatchMessage(&amp;msg);
                           }
    return 0; 
    }
</code></pre>
<p><strong>resource.rc</strong></p>
<pre><code class="language-cpp">IDR_MENU1 MENU
BEGIN
    POPUP &quot;Datei&quot;
    BEGIN
        MENUITEM &quot;Öffnen&quot;,             ID_FILE_OPEN
        MENUITEM &quot;Speichern&quot;,          ID_FILE_SAVE
        MENUITEM &quot;Ende&quot;,               ID_FILE_EXIT
    END
    POPUP &quot;Optionen&quot;
    BEGIN
        POPUP &quot;Optionen&quot;
        BEGIN
            MENUITEM &quot;Option&amp;1&quot;,       ID_OPTIONS_OPTIONS_OPTION1
            MENUITEM &quot;Option&amp;2&quot;,       ID_OPTIONS_OPTIONS_OPTION2
        END
    END
    MENUITEM &quot;Über&quot;,                   ID_ABOUT
END

/////////////////////////////////////////////////////////////////
//
//Stringtabelle
//
STRINGTABLE
BEGIN
        ID_STRING_OPEN,      &quot;Der Dialog Öffnen&quot;
        ID_STRING_SAVE,      &quot;Der Dialog Speichern&quot;
        ID_STRING_OPTION1,   &quot;Erste Option im Untermenü&quot;
        ID_STRING_OPTION2,   &quot;Zweite Option im Untermenü&quot;
        ID_STRING_ABOUT,     &quot;Ein Menü-Beispiel\nCoded by J.Wolf&quot;
END
</code></pre>
<p><strong>resource.h</strong></p>
<pre><code class="language-cpp">#define ID_STRING_OPEN                  1
#define ID_STRING_SAVE                  2
#define ID_STRING_OPTION1               3
#define ID_STRING_OPTION2               4
#define ID_STRING_ABOUT                 5

#define IDR_MENU1                       101

#define ID_FILE_OPEN                    40001
#define ID_FILE_SAVE                    40002
#define ID_FILE_EXIT                    40003
#define ID_OPTIONS_OPTIONS_OPTION1      40004
#define ID_OPTIONS_OPTIONS_OPTION2      40005
#define ID_ABOUT                        65535
</code></pre>
<p>was mach ich noch falsch -.- .. Danke für alle weiteren Bemühungen !!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1657293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1657293</guid><dc:creator><![CDATA[System_Shutdown]]></dc:creator><pubDate>Tue, 03 Feb 2009 15:17:55 GMT</pubDate></item><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Tue, 03 Feb 2009 16:49:20 GMT]]></title><description><![CDATA[<p>Du könntest das Menü aus den Resourcen erstmal laden:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms647990(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms647990(VS.85).aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1657361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1657361</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 03 Feb 2009 16:49:20 GMT</pubDate></item><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Tue, 03 Feb 2009 18:34:50 GMT]]></title><description><![CDATA[<p>also ich weiss nicht recht das will i-wie alles nich so recht hinhauen sry ..</p>
<p>kann jemand konkret sagen welche Funktionen ich brauche bzw. wo genau ich sie</p>
<p>aufrufen muss ?! ..</p>
<p>so sieht mein derzeitiger Versuch aus:</p>
<pre><code>HWND Fenster = CreateWindowEx(0, WC_DIALOG, &quot;Mein Fenster&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, NULL, NULL, NULL, NULL);

    SetWindowLong(Fenster, DWL_DLGPROC, (long)Prozedur);
    LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU1));
    SetMenu(Fenster, (HMENU)MAKEINTRESOURCE(IDR_MENU1));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1657464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1657464</guid><dc:creator><![CDATA[System_Shutdown]]></dc:creator><pubDate>Tue, 03 Feb 2009 18:34:50 GMT</pubDate></item><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Tue, 03 Feb 2009 19:08:26 GMT]]></title><description><![CDATA[<p>Ich würde für SetMenu den Rückgabeparameter von LoadMenu verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1657495</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1657495</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Tue, 03 Feb 2009 19:08:26 GMT</pubDate></item><item><title><![CDATA[Reply to Menü auch ohne ExtendedClass-Anmeldung ??? on Tue, 03 Feb 2009 19:17:32 GMT]]></title><description><![CDATA[<p>Juhuuuuuu !!!! xDDD .. funzt danke</p>
<p>ich hatte sowas vorher schonmal probiert also sowas wie:</p>
<p>char a = LoadMenu( ... );<br />
SetMenu(Fenster, a);</p>
<p>aber da der erforderliche Wert ja HWND ist (hätt ich wissen müssen) musses ja anders aussehen ..</p>
<p>Danke! ..</p>
<p>Nochmal der cpp-Source-Code für Leute die ähnliche Probleme haben:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;resource.h&gt;

bool Prozedur(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
     if(message == WM_CLOSE)
     {
                PostQuitMessage(0);
                }

     return 0;
     }

int WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
{
    HMENU a = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU1));

    MSG msg;
    HWND Fenster = CreateWindowEx(0, WC_DIALOG, &quot;Mein Fenster&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, NULL, NULL, NULL, NULL);

    SetWindowLong(Fenster, DWL_DLGPROC, (long)Prozedur);

    SetMenu(Fenster, a);

    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
                           TranslateMessage(&amp;msg);
                           DispatchMessage(&amp;msg);
                           }
    return 0; 
    }
</code></pre>
<p>Nun müsst ihr nur noch die resource-datei + header datei schreiben ..<br />
Diese stehen ganz oben ..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1657502</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1657502</guid><dc:creator><![CDATA[System_Shutdown]]></dc:creator><pubDate>Tue, 03 Feb 2009 19:17:32 GMT</pubDate></item></channel></rss>