<?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[CreateWindow Problem]]></title><description><![CDATA[<p>Ich erstelle mit CreateWindow ein Fenster, ich bekomme auch ein Fensterhandle zurück. Jedoch ist der Inhalt des Fensters nicht sichtbar. Bis man rein klickt. ShowWindow() hab ich nicht vergessen.</p>
<p>Nach dem Aufruf von CreateWindow liefert GetLastError den Code 1400 ERROR_INVALID_WINDOW_HANDLE zurück? Was soll das heißen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/195525/createwindow-problem</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 00:04:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/195525.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Oct 2007 14:49:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateWindow Problem on Thu, 18 Oct 2007 14:49:40 GMT]]></title><description><![CDATA[<p>Ich erstelle mit CreateWindow ein Fenster, ich bekomme auch ein Fensterhandle zurück. Jedoch ist der Inhalt des Fensters nicht sichtbar. Bis man rein klickt. ShowWindow() hab ich nicht vergessen.</p>
<p>Nach dem Aufruf von CreateWindow liefert GetLastError den Code 1400 ERROR_INVALID_WINDOW_HANDLE zurück? Was soll das heißen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388003</guid><dc:creator><![CDATA[Sisko86]]></dc:creator><pubDate>Thu, 18 Oct 2007 14:49:40 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Thu, 18 Oct 2007 15:02:07 GMT]]></title><description><![CDATA[<p>ka, zeig mal was du machst</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388014</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Thu, 18 Oct 2007 15:02:07 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Thu, 18 Oct 2007 15:03:46 GMT]]></title><description><![CDATA[<p>Hast Du die Gültigkeit des Window-Handle von CreateWindow() überprüft?</p>
<p>Am besten, zeig mal Dein Code hier.</p>
<p>Prinzipielle Vorgehensweise wie ichs mache:</p>
<pre><code class="language-cpp">hwnd_window = CreateWindowEx( 0, tcharsz_app_name, tcharsz_app_fenstername,
                              WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
                              CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
                              (HWND)NULL, hmenu_hauptmenue, hinstance_app, NULL );
if ( hwnd_window == NULL )
{
  //Ein Fehler ist aufgetreten!
  //Abbruch des Programms oder GetLastError() auswerten.
}
ShowWindow( hwnd_window, iCmdShow );
if ( UpdateWindow( hwnd_window ) == NULL )            //Sendet eine WM_PAINT Nachricht an das Fenster.
{
  //Ein Fehler ist aufgetreten!
  //Abbruch des Programms oder GetLastError() auswerten.
}

//Ab hier die eigentliche Nachrichtenschleife mit GetMessage() usw.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1388016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388016</guid><dc:creator><![CDATA[Mmacher]]></dc:creator><pubDate>Thu, 18 Oct 2007 15:03:46 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 06:02:45 GMT]]></title><description><![CDATA[<p>Das Handle das ich zurück bekomme ist nicht NULL</p>
<pre><code>DWORD d;
HWND hwnd =
    CreateWindow(
    winclass, // gleiche wie bei meinem Main Window
    NULL,
    WS_CHILD,
    pos_u, pos_v,
    100, 30,
    hWndMain,
    NULL,
    hInst,
    NULL
    );

  d = GetLastError(); // Code: 1400
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1388266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388266</guid><dc:creator><![CDATA[Sisko86]]></dc:creator><pubDate>Fri, 19 Oct 2007 06:02:45 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 06:43:02 GMT]]></title><description><![CDATA[<p>Error 1400==Ungültiges Fensterhandle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388290</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Oct 2007 06:43:02 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 06:48:53 GMT]]></title><description><![CDATA[<p>Was ist denn ungültig hWndMain? kann nicht sein ist ja nicht NULL.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388295</guid><dc:creator><![CDATA[Sisko86]]></dc:creator><pubDate>Fri, 19 Oct 2007 06:48:53 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 07:31:56 GMT]]></title><description><![CDATA[<p>Eben! Wenn Du ein WS_CHILD Fenster anlegen willst Musst Du ein Fensterhandle angeben. NULL ist hier nicht erlaubt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388327</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Oct 2007 07:31:56 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 07:40:25 GMT]]></title><description><![CDATA[<p>hWndMain ist nicht NULL</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388337</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388337</guid><dc:creator><![CDATA[Sisko86]]></dc:creator><pubDate>Fri, 19 Oct 2007 07:40:25 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 08:56:12 GMT]]></title><description><![CDATA[<p>Sisko86 schrieb:</p>
<blockquote>
<p>hWndMain ist nicht NULL</p>
</blockquote>
<p>Upps überlesen. Kontrolliere das mal mit IsWindow!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388381</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388381</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Oct 2007 08:56:12 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 09:12:40 GMT]]></title><description><![CDATA[<p>IsWindow(hWndMain) liefert TRUE</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388391</guid><dc:creator><![CDATA[Sisko86]]></dc:creator><pubDate>Fri, 19 Oct 2007 09:12:40 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 09:16:39 GMT]]></title><description><![CDATA[<p>Muss irgendwas mit meiner WNDCLASS zu tun haben,<br />
Wenn ich eine neue erstelle und ein andere Funktion für lpfnWndProc angebe Funktionierts.<br />
Wieso dass?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388393</guid><dc:creator><![CDATA[Sisko86]]></dc:creator><pubDate>Fri, 19 Oct 2007 09:16:39 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 10:12:23 GMT]]></title><description><![CDATA[<p>Wie initialisierst Du die?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388425</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Oct 2007 10:12:23 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 13:43:59 GMT]]></title><description><![CDATA[<p>Hi, so müsste es funktionieren:</p>
<pre><code class="language-cpp">hChildWnd = 
           CreateWindow (
           winclass, 
           NULL,
           WS_CHILDWINDOW | WS_VISIBLE, //  :warning: 
           pos_u, pos_v,
           100, 30,
           hWndMain, 
           (HMENU) ChildWndID, //  :warning: 
           (HINSTANCE) GetWindowLong (hWndMain, GWL_HINSTANCE), //  :warning: 
           NULL) ;
</code></pre>
<p>Ich habe die Paramenter berichtigt und mit <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="⚠"
    /> gekennzeichnet!</p>
<p>MfG</p>
<p>WilMen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388434</guid><dc:creator><![CDATA[WilMen]]></dc:creator><pubDate>Fri, 19 Oct 2007 13:43:59 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 10:23:32 GMT]]></title><description><![CDATA[<p>Sisko86 schrieb:</p>
<blockquote>
<p>Das Handle das ich zurück bekomme ist nicht NULL</p>
<pre><code>DWORD d;
HWND hwnd =
    CreateWindow(
    winclass, // gleiche wie bei meinem Main Window
    NULL,
    WS_CHILD,
    pos_u, pos_v,
    100, 30,
    hWndMain,
    NULL,
    hInst,
    NULL
    );

  d = GetLastError(); // Code: 1400
</code></pre>
</blockquote>
<p>Wie ich schon schrieb sind seine Probleme wohl eher die Parameter die an CreateWindow() übergeben werden!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388436</guid><dc:creator><![CDATA[WilMen]]></dc:creator><pubDate>Fri, 19 Oct 2007 10:23:32 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 10:30:21 GMT]]></title><description><![CDATA[<p>WilMen schrieb:</p>
<blockquote>
<p>Hi, so müsste es funktionieren:</p>
<p>S_CHILDWINDOW | WS_VISIBLE, // <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>
</blockquote>
<p>Ein Fenster muss nicht sichtbar sein!</p>
<blockquote>
<p>(HMENU) ChildWndID, // <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>
</blockquote>
<p>Ein Fenster benötigt keine ID</p>
<blockquote>
<p>(HINSTANCE) GetWindowLong (hWnd, GWL_HINSTANCE), // <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>
</blockquote>
<p>Wenn man die HINSTANCE verwendet sollte man die nehmen, die auch vom entsprechenden Modul verwendet wird! Und nicht irgendein, die man von irendeinem anderen Fenster bekommt.</p>
<p>IMHO kann aber HINSTANCE NULL sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388441</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Oct 2007 10:30:21 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 10:34:40 GMT]]></title><description><![CDATA[<p>was ist denn ChildWndID bzw wie bekomm ich die.</p>
<p>Meine WNDCLASS:</p>
<pre><code>WNDCLASS  wc;

  char winclass[64];
  strcpy(winclass, &quot;MAINWINCLASS&quot;);

  /* remember instance handle */
  hInst = (HINSTANCE)hInstance;

  /* define and register application class */
  wc.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
  wc.lpfnWndProc   = MainWndProc;
  wc.cbClsExtra    = 0;
  wc.cbWndExtra    = 0;
  wc.hInstance     = (HINSTANCE)hInstance;
  wc.hIcon         = (icon_id &lt;= 0) ? NULL
                      : LoadIcon((HINSTANCE)hInstance, MAKEINTRESOURCE(icon_id));
  wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
  wc.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
  wc.lpszMenuName  = menu_id &lt;= 0 ? NULL : MAKEINTRESOURCE(menu_id);
  wc.lpszClassName = winclass;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1388445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388445</guid><dc:creator><![CDATA[Sisko86]]></dc:creator><pubDate>Fri, 19 Oct 2007 10:34:40 GMT</pubDate></item><item><title><![CDATA[Reply to CreateWindow Problem on Fri, 19 Oct 2007 13:44:39 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35992">@Martin</a> Richter</p>
<p>1. Man muss die Stil-Bits natürlich nicht setzen, aber da ich bei ihm keinen Aufruf von ShowWindow() bzw. SetWindowPos() gesehen habe, wäre es natürlich nicht schlecht, wenn er dann sein Fenster auch sehen würde! <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>
<p>2. Stimmt, man muss keine ID angeben!</p>
<ol start="3">
<li></li>
</ol>
<pre><code class="language-cpp">(HINSTANCE) GetWindowLong (hWndMain, GWL_HINSTANCE) ;
</code></pre>
<p>Ich habe den Bezeichner vergessen zu ändern! Hättest du auch selber drauf kommen können! <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>
<p>MfG</p>
<p>WilMen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1388580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1388580</guid><dc:creator><![CDATA[WilMen]]></dc:creator><pubDate>Fri, 19 Oct 2007 13:44:39 GMT</pubDate></item></channel></rss>