<?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[Nach menü anklicken ,  soll ein Fenster erscheinen]]></title><description><![CDATA[<p>Hallo , ich habe ein problem undzwar das wenn ich im menü auf ein knopf drücke , soll ein fenster erscheinen ... aber wie mache ich das ?</p>
<pre><code class="language-cpp">LRESULT CALLBACK ConPrefProc (HWND hConnectWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    HDC hdc;
  PAINTSTRUCT ps;

 switch (message)
 {

  case WM_PAINT:
      hdc = BeginPaint (hConnectWnd, &amp;ps);
      SetBkColor(hdc, RGB(212,208,200) );
      TextOut (hdc, 100, 40, &quot;Fenster B&quot;, 9);
      EndPaint (hConnectWnd, &amp;ps);

  return 0; 
        case WM_DESTROY:
            PostQuitMessage (0);
        return 0;
    }

    return DefWindowProc (hConnectWnd, message, wParam, lParam);
}
</code></pre>
<p>Hat der zwar ausgeführt aber beim klicken im menü kamm nix <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="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/206721/nach-menü-anklicken-soll-ein-fenster-erscheinen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 01:04:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/206721.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Feb 2008 06:10:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 06:10:46 GMT]]></title><description><![CDATA[<p>Hallo , ich habe ein problem undzwar das wenn ich im menü auf ein knopf drücke , soll ein fenster erscheinen ... aber wie mache ich das ?</p>
<pre><code class="language-cpp">LRESULT CALLBACK ConPrefProc (HWND hConnectWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    HDC hdc;
  PAINTSTRUCT ps;

 switch (message)
 {

  case WM_PAINT:
      hdc = BeginPaint (hConnectWnd, &amp;ps);
      SetBkColor(hdc, RGB(212,208,200) );
      TextOut (hdc, 100, 40, &quot;Fenster B&quot;, 9);
      EndPaint (hConnectWnd, &amp;ps);

  return 0; 
        case WM_DESTROY:
            PostQuitMessage (0);
        return 0;
    }

    return DefWindowProc (hConnectWnd, message, wParam, lParam);
}
</code></pre>
<p>Hat der zwar ausgeführt aber beim klicken im menü kamm nix <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="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464499</guid><dc:creator><![CDATA[Ver2felt]]></dc:creator><pubDate>Thu, 28 Feb 2008 06:10:46 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 06:13:39 GMT]]></title><description><![CDATA[<p>sorry ich meinte diesen code hier:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND hWnd,UINT iMsg,
                         WPARAM wParam, LPARAM lParam)
{

    int iCmdShow;
    char string[255];
    HWND  hConnectWnd,hMain;
    char ConnectWin[] = &quot;fenster2&quot;;
    WNDCLASS wc;
    HINSTANCE hI;
   ...
         case WM_COMMAND:
            switch(LOWORD(wParam))
               {
                case ID_CONNECT:

     hConnectWnd = CreateWindow (ConnectWin, &quot;test2&quot;,WS_SYSMENU | WS_MINIMIZEBOX, 400, 400, 285,112, NULL, NULL, hI, NULL);

    ShowWindow (hConnectWnd, iCmdShow);

               break;
              ...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1464500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464500</guid><dc:creator><![CDATA[Ver2felt]]></dc:creator><pubDate>Thu, 28 Feb 2008 06:13:39 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 06:48:15 GMT]]></title><description><![CDATA[<p>Wie setzt du denn</p>
<pre><code>WNDCLASS wc;
HINSTANCE hI;
</code></pre>
<p>?<br />
Was sagt GetLastError?</p>
<p>schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464508</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464508</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Thu, 28 Feb 2008 06:48:15 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 07:02:26 GMT]]></title><description><![CDATA[<p>iCmdShow ist nicht definiert. Du kannst Die das sparen, wenn Du WS_VISIBLE verwendest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464515</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 28 Feb 2008 07:02:26 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:04:18 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>ShowWindow (hConnectWnd, WS_VISIBLE);</p>
<p>TUTS NICHT ! <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="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464792</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464792</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:04:18 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:07:24 GMT]]></title><description><![CDATA[<p>WS_VISIBLE muß in CreateWindow nach WS_MINIMIZEBOX angegeben werden. Bei ShowWindow mußt Du SW_SHOW angeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464797</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464797</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:07:24 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:10:33 GMT]]></title><description><![CDATA[<p>cool aber das fenster soll ja erst erscheinen , wenn man im menü auf &quot;verbinen &quot; geklickt hat <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464801</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464801</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:10:33 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:18:58 GMT]]></title><description><![CDATA[<p>Dann WS_VISIBLE bei CreateWindow weglassen und beim Anwählen des Menüpunktes ShowWindow(hConnectWnd, WS_SHOW) aufrufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464812</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464812</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:18:58 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:25:40 GMT]]></title><description><![CDATA[<p>hab ich ja auh schon aber dann kommt das fenster ja nicht <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/1464816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464816</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:25:40 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:31:26 GMT]]></title><description><![CDATA[<p>Die Deklaration von iCmdShow in Deiner WndProc solltest Du weglassen. iCmdShow wird von der WinMain übergeben. Wenn Du das lokal nochmal deklarierst, wird der eigentliche Show-Parameter ignoriert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464820</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:31:26 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:39:48 GMT]]></title><description><![CDATA[<p>also ich hab jetzt nix verstanden ...</p>
<p>da so ist mein code mom:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND hWnd,UINT iMsg,
                         WPARAM wParam, LPARAM lParam)
{

    char string[255];
    HWND  hConnectWnd,hMain;

   switch (iMsg)
      {
         case WM_CLOSE:
            DestroyWindow(hWnd);
            break;
         case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
         case WM_COMMAND:
            switch(LOWORD(wParam))
               {
                case ID_CONNECT:

                ShowWindow (hConnectWnd,SW_SHOW);

               break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1464830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464830</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:39:48 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:41:35 GMT]]></title><description><![CDATA[<p>Ja, genau so meinte ich das.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464833</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:41:35 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:43:04 GMT]]></title><description><![CDATA[<p>ja ABER da kommt Kein 2Tes Fenster <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="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464836</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464836</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:43:04 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 15:43:55 GMT]]></title><description><![CDATA[<p>Wenn der Timer schnell genug ist, hast Du eine Endlosschleife mit Stack-Overflow....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464838</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464838</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 28 Feb 2008 15:43:55 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 16:34:51 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> kann man mir mal jetzt sagen Was los ist also nicht mit expertenausdrücke ???? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464878</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464878</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 16:34:51 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:00:48 GMT]]></title><description><![CDATA[<p>alllllllso</p>
<p>ich will wenn man auf ein menü-button (fenster mit menü)<br />
drück soll ein 2tes fenster erscheinen</p>
<p>aber es kommt kein 2tes fenster ... !!!</p>
<p>ich habe allles schon probiert:</p>
<p>________________________________</p>
<p>ShowWindow (hConnectWnd,SW_SHOW);</p>
<p>ShowWindow (hConnectWnd,SW_SHOW); (mit CreateWindow ... SW_VISIBLE) und ohne</p>
<p>ich hab case zu if gemacht<br />
______________________________</p>
<p>ABER NIX TUTS <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464908</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:00:48 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:04:26 GMT]]></title><description><![CDATA[<p>du musst hConnectWnd noch vor WinMain definieren, also z.B.</p>
<pre><code class="language-cpp">HWND hConnectWnd;

int WINAPI WinMain ...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1464911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464911</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:04:26 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:21:52 GMT]]></title><description><![CDATA[<p>tja tuts immer noch nicht <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="😞"
    /> <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="😞"
    /> <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="😞"
    /> <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="😞"
    /> <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/1464936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464936</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:23:43 GMT]]></title><description><![CDATA[<p>dann zeig doch einfach deinen gesamten code, ich habs jetzt schon mit wahrsagen probiert, hat nicht geklappt. also jetzt hilft nur noch dein code^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464939</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:23:43 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:30:08 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;
HINSTANCE g_hInst;

LPCSTR MainClassName = &quot;Ein Menü-Beispiel&quot;;

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

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, LPSTR szCmdLine, int iCmdShow)
{
    char MainWin[] = &quot;fenster1&quot;;

    char ConnectWin[] = &quot;fenster2&quot;;

    UNREFERENCED_PARAMETER (hPrI);
    UNREFERENCED_PARAMETER (szCmdLine);

    g_hInst = hI;
    WNDCLASS wc;
    HWND  hConnectWnd,hMain;

    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hI;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);
    wc.lpszClassName = MainWin;

    RegisterClass (&amp;wc);

    hMain = CreateWindow (MainWin, &quot;test&quot;, WS_OVERLAPPEDWINDOW, 300, 300,410, 250, NULL, NULL, hI, NULL);
    ShowWindow (hMain, iCmdShow);

    UpdateWindow (hMain);

    wc.lpfnWndProc = ConPrefProc;
    wc.lpszMenuName = NULL;
    wc.lpszClassName = ConnectWin;

    RegisterClass (&amp;wc);

    hConnectWnd = CreateWindow (ConnectWin, &quot;test2&quot;,WS_SYSMENU | WS_MINIMIZEBOX   , 400, 400, 285,112, NULL, NULL, hI, NULL);

    MSG msg;
    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        TranslateMessage (&amp;msg);
        DispatchMessage (&amp;msg);
    }
    return msg.wParam;

}

LRESULT CALLBACK WndProc(HWND hWnd,UINT iMsg,
                         WPARAM wParam, LPARAM lParam)
{

    char string[255];
    HWND  hConnectWnd,hMain;

   switch (iMsg)
      {
         case WM_CLOSE:
            DestroyWindow(hWnd);
            break;
         case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
         case WM_COMMAND:
            switch(LOWORD(wParam))
               {
                case ID_CONNECT:

                ShowWindow (hConnectWnd,SW_SHOW);

               break;

               case ID_\1:
               LoadString(GetModuleHandle(NULL),ID_STRING_ABOUT,
                          string,sizeof(string));
               MessageBox(hWnd,string,&quot;Über&quot;,MB_ICONINFORMATION);
               break;

               case ID_FILE_EXIT:
                  DestroyWindow(hWnd);
                  break;
         }
        break;
      }
   return DefWindowProc(hWnd,iMsg,wParam,lParam);
}

LRESULT CALLBACK ConPrefProc (HWND hConnectWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    HDC hdc;
  PAINTSTRUCT ps;

 switch (message)
 {

  case WM_PAINT:
      hdc = BeginPaint (hConnectWnd, &amp;ps);
      SetBkColor(hdc, RGB(212,208,200) );
      TextOut (hdc, 100, 40, &quot;Fenster B&quot;, 9);
      EndPaint (hConnectWnd, &amp;ps);

  return 0; 
        case WM_DESTROY:
            PostQuitMessage (0);
        return 0;
    }

    return DefWindowProc (hConnectWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1464947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464947</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:30:08 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:34:56 GMT]]></title><description><![CDATA[<p>na ist ja kein wunder. du definierst hConnectWnd in der Callback-Funktion, aber woher soll das Programm denn wissen, dass du die gleiche hConnectWnd Variable meinst, wie in WinMain??<br />
Also muss das so aussehen:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;
HINSTANCE g_hInst;

LPCSTR MainClassName = &quot;Ein Menü-Beispiel&quot;;

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

HWND  hConnectWnd, hMain;

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, LPSTR szCmdLine, int iCmdShow)
{
    char MainWin[] = &quot;fenster1&quot;;

    char ConnectWin[] = &quot;fenster2&quot;;

    UNREFERENCED_PARAMETER (hPrI);
    UNREFERENCED_PARAMETER (szCmdLine);

    g_hInst = hI;
    WNDCLASS wc;

    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hI;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);
    wc.lpszClassName = MainWin;

    RegisterClass (&amp;wc);

    hMain = CreateWindow (MainWin, &quot;test&quot;, WS_OVERLAPPEDWINDOW, 300, 300,410, 250, NULL, NULL, hI, NULL);
    ShowWindow (hMain, iCmdShow);

    UpdateWindow (hMain);

    wc.lpfnWndProc = ConPrefProc;
    wc.lpszMenuName = NULL;
    wc.lpszClassName = ConnectWin;

    RegisterClass (&amp;wc);

    hConnectWnd = CreateWindow (ConnectWin, &quot;test2&quot;,WS_SYSMENU | WS_MINIMIZEBOX   , 400, 400, 285,112, NULL, NULL, hI, NULL);

    MSG msg;
    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        TranslateMessage (&amp;msg);
        DispatchMessage (&amp;msg);
    }
    return msg.wParam;

}

LRESULT CALLBACK WndProc(HWND hWnd,UINT iMsg,
                         WPARAM wParam, LPARAM lParam)
{

    char string[255];  

   switch (iMsg)
      {
         case WM_CLOSE:
            DestroyWindow(hWnd);
            break;
         case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
         case WM_COMMAND:
            switch(LOWORD(wParam))
               {
                case ID_CONNECT:

                ShowWindow (hConnectWnd,SW_SHOW);

               break;

               case ID_\1:
               LoadString(GetModuleHandle(NULL),ID_STRING_ABOUT,
                          string,sizeof(string));
               MessageBox(hWnd,string,&quot;Über&quot;,MB_ICONINFORMATION);
               break;

               case ID_FILE_EXIT:
                  DestroyWindow(hWnd);
                  break;
         }
        break;
      }
   return DefWindowProc(hWnd,iMsg,wParam,lParam);
}

LRESULT CALLBACK ConPrefProc (HWND hConnectWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    HDC hdc;
  PAINTSTRUCT ps;

 switch (message)
 {

  case WM_PAINT:
      hdc = BeginPaint (hConnectWnd, &amp;ps);
      SetBkColor(hdc, RGB(212,208,200) );
      TextOut (hdc, 100, 40, &quot;Fenster B&quot;, 9);
      EndPaint (hConnectWnd, &amp;ps);

  return 0; 
        case WM_DESTROY:
            PostQuitMessage (0);
        return 0;
    }

    return DefWindowProc (hConnectWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1464951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464951</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:34:56 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:36:49 GMT]]></title><description><![CDATA[<p>Mach dein hConnectWnd mal global, in deiner Wndproc hat hConnectWnd doch überhaupt keinen wert mehr.</p>
<p>schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464952</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:36:49 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:42:41 GMT]]></title><description><![CDATA[<p>wie global machen</p>
<p>hwnd hConnectWnd;<br />
ini hConnectWnd;</p>
<p>oder wie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464956</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:42:41 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:45:13 GMT]]></title><description><![CDATA[<p>so wie fake geschrieben hat</p>
<p>schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464958</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:45:13 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:49:50 GMT]]></title><description><![CDATA[<p>jetzt ist das menü weg</p>
<p><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>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;
HINSTANCE g_hInst;
HINSTANCE hConnectWnd;
LPCSTR MainClassName = &quot;Ein Menü-Beispiel&quot;;

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

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, LPSTR szCmdLine, int iCmdShow)
{
    char MainWin[] = &quot;fenster1&quot;;

    char ConnectWin[] = &quot;fenster2&quot;;

    UNREFERENCED_PARAMETER (hPrI);
    UNREFERENCED_PARAMETER (szCmdLine);

    g_hInst = hI;
    WNDCLASS wc;
    HWND  hConnectWnd,hMain;

    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hI;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);
    wc.lpszClassName = MainWin;

    RegisterClass (&amp;wc);

    hMain = CreateWindow (MainWin, &quot;test&quot;, WS_OVERLAPPEDWINDOW, 300, 300,410, 250, NULL, NULL, hI, NULL);
    ShowWindow (hMain, iCmdShow);

    UpdateWindow (hMain);

    wc.lpfnWndProc = ConPrefProc;
    wc.lpszMenuName = NULL;
    wc.lpszClassName = ConnectWin;

    RegisterClass (&amp;wc);

    hConnectWnd = CreateWindow (ConnectWin, &quot;test2&quot;,WS_SYSMENU | WS_MINIMIZEBOX   , 400, 400, 285,112, NULL, NULL, hI, NULL);

    MSG msg;
    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        TranslateMessage (&amp;msg);
        DispatchMessage (&amp;msg);
    }
    return msg.wParam;

}

LRESULT CALLBACK WndProc(HWND hWnd,UINT iMsg,
                         WPARAM wParam, LPARAM lParam)
{

    char string[255];
    HWND  hConnectWnd,hMain;

    static HWND hButton,hButton2,hButton3,hButton4,hButton5,hButton6,hButton7,hButton8,hButton9,hButton10; 

   switch (iMsg)
   {
            case WM_CLOSE:
            DestroyWindow(hWnd);
            break;
         case WM_DESTROY:
            PostQuitMessage(0);
            return 0;

   case WM_CREATE:
      {

   hButton = CreateWindow(  &quot;button&quot;,&quot;Hallo&quot;,WS_CHILD | WS_VISIBLE,0, 0, 0, 0,hWnd,NULL,((LPCREATESTRUCT) lParam) -&gt; hInstance,NULL);
   hButton2 = CreateWindow(  &quot;button&quot;,&quot;Ja&quot;,WS_CHILD | WS_VISIBLE,0, 0, 0, 0,hWnd,NULL,((LPCREATESTRUCT) lParam) -&gt; hInstance,NULL);
   hButton3 = CreateWindow(  &quot;button&quot;,&quot;Nein&quot;,WS_CHILD | WS_VISIBLE,0, 0, 0, 0,hWnd,NULL,((LPCREATESTRUCT) lParam) -&gt; hInstance,NULL);
   hButton4 = CreateWindow(  &quot;button&quot;,&quot;Warum&quot;,WS_CHILD | WS_VISIBLE,0, 0, 0, 0,hWnd,NULL,((LPCREATESTRUCT) lParam) -&gt; hInstance,NULL);
   hButton5 = CreateWindow(  &quot;button&quot;,&quot;Stimmt das&quot;,WS_CHILD | WS_VISIBLE,0, 0, 0, 0,hWnd,NULL,((LPCREATESTRUCT) lParam) -&gt; hInstance,NULL);
   hButton6 = CreateWindow(  &quot;button&quot;,&quot;Tschüss&quot;,WS_CHILD | WS_VISIBLE,0, 0, 0, 0,hWnd,NULL,((LPCREATESTRUCT) lParam) -&gt; hInstance,NULL);
   hButton7 = CreateWindow(  &quot;button&quot;,&quot;Achso&quot;,WS_CHILD | WS_VISIBLE,0, 0, 0, 0,hWnd,NULL,((LPCREATESTRUCT) lParam) -&gt; hInstance,NULL);

   return 0;
      }

   case WM_SIZE:
      {

        MoveWindow(hButton, LOWORD(lParam) / 2 - 143, HIWORD(lParam) - 100, 
                                                           60, 22, TRUE);

        MoveWindow(hButton2, LOWORD(lParam) / 2 - 83, HIWORD(lParam) - 100, 
                                                           40, 22, TRUE);

        MoveWindow(hButton3, LOWORD(lParam) / 2 - 43, HIWORD(lParam) - 100, 
                                                           40, 22, TRUE);

        MoveWindow(hButton4, LOWORD(lParam) / 2 - 3, HIWORD(lParam) - 100, 
                                                           60, 22, TRUE);

        MoveWindow(hButton5, LOWORD(lParam) / 2 - 83,  HIWORD(lParam) - 78, 
                                                           80, 22, TRUE);

        MoveWindow(hButton6, LOWORD(lParam) / 2 - 143, HIWORD(lParam) - 78, 
                                                           60, 22, TRUE);

        MoveWindow(hButton7, LOWORD(lParam) / 2 - 3, HIWORD(lParam) - 78, 
                                                           60, 22, TRUE);
         return 0;
      }

         case WM_COMMAND:
            switch(LOWORD(wParam))
               {
                case ID_CONNECT:

                ShowWindow (hConnectWnd,SW_SHOW);

               break;

               case ID_\1:
               LoadString(GetModuleHandle(NULL),ID_STRING_ABOUT,
                          string,sizeof(string));
               MessageBox(hWnd,string,&quot;Über&quot;,MB_ICONINFORMATION);
               break;

               case ID_FILE_EXIT:
                  DestroyWindow(hWnd);
                  break;
         }
        break;
      }
   return DefWindowProc(hWnd,iMsg,wParam,lParam);
}

LRESULT CALLBACK ConPrefProc (HWND hConnectWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    HDC hdc;
  PAINTSTRUCT ps;

 switch (message)
 {

  case WM_PAINT:
      hdc = BeginPaint (hConnectWnd, &amp;ps);
      SetBkColor(hdc, RGB(212,208,200) );
      TextOut (hdc, 100, 40, &quot;Fenster B&quot;, 9);
      EndPaint (hConnectWnd, &amp;ps);

  return 0; 
        case WM_DESTROY:
            PostQuitMessage (0);
        return 0;
    }

    return DefWindowProc (hConnectWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1464961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464961</guid><dc:creator><![CDATA[ver2feld]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:49:50 GMT</pubDate></item><item><title><![CDATA[Reply to Nach menü anklicken ,  soll ein Fenster erscheinen on Thu, 28 Feb 2008 17:51:24 GMT]]></title><description><![CDATA[<p>jetzt hab ich kein bock mehr <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /><br />
da poste ich dir extra den ganzen code nochmal, dmait du genau weißt wohin damit, und dann übernimmst du nichts davon <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1464962</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1464962</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Thu, 28 Feb 2008 17:51:24 GMT</pubDate></item></channel></rss>