<?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[Fehler 1400 - Invalid Window Handle]]></title><description><![CDATA[<pre><code class="language-cpp">if (!(m_hWnd = CreateWindowEx(dwExStyle,m_strClass,strTitle,dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,0,0,iWidth,iHeight,NULL,NULL,m_hInstance,NULL)))
	{
		int i = GetLastError();

		MessageBox(NULL,&quot;Fehler beim Erstellen des Fensters.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
	}
</code></pre>
<p>Warum ist m_hWnd == NULL? und warum invalid Window handle...<br />
<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/107137/fehler-1400-invalid-window-handle</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 00:58:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/107137.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Apr 2005 14:51:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 14:51:57 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if (!(m_hWnd = CreateWindowEx(dwExStyle,m_strClass,strTitle,dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,0,0,iWidth,iHeight,NULL,NULL,m_hInstance,NULL)))
	{
		int i = GetLastError();

		MessageBox(NULL,&quot;Fehler beim Erstellen des Fensters.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
	}
</code></pre>
<p>Warum ist m_hWnd == NULL? und warum invalid Window handle...<br />
<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/768395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768395</guid><dc:creator><![CDATA[CreateWindowExler]]></dc:creator><pubDate>Sat, 16 Apr 2005 14:51:57 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 15:02:08 GMT]]></title><description><![CDATA[<p>Hast du vorher auch das Handle mit &quot;HWND m_hWnd;&quot; erstellt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768400</guid><dc:creator><![CDATA[Ynnus]]></dc:creator><pubDate>Sat, 16 Apr 2005 15:02:08 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 15:46:41 GMT]]></title><description><![CDATA[<p>Erzeugt er denn das Fenster ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768425</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sat, 16 Apr 2005 15:46:41 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 16:14:45 GMT]]></title><description><![CDATA[<p>jep HWND m_hWnd gibt es<br />
Das Fenster wird nicht erzeugt auch wenn ich die Fehlermeldung auskommentiere<br />
es wird lediglich der Prozess erstellt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768443</guid><dc:creator><![CDATA[CreateWindowExler]]></dc:creator><pubDate>Sat, 16 Apr 2005 16:14:45 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 16:21:13 GMT]]></title><description><![CDATA[<p>Wie sieht die WindowProc aus? Welchen Inhalt haben die Variablen die an CreateWindowEx übergeben werden? Wie sieht die Fensterklasse aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768447</guid><dc:creator><![CDATA[fragen über fragen]]></dc:creator><pubDate>Sat, 16 Apr 2005 16:21:13 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 16:32:33 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">DWORD dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
  DWORD dwStyle=WS_OVERLAPPEDWINDOW;
  HINSTANCE m_hInstance = GetModuleHandle(NULL);
  strcpy(m_strClass,&quot;Simple WinClass&quot;);
  strcpy(strTitle,&quot;Simple WinTitle&quot;);
  int iWidth = 800;
  int iHeight = 600;
  HWND m_hWnd = NULL;
  m_hWnd = CreateWindowEx(dwExStyle,m_strClass,strTitle,dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,0,0,iWidth,iHeight,NULL,NULL,m_hInstance,NULL);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/768455</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768455</guid><dc:creator><![CDATA[CreateWindowExler]]></dc:creator><pubDate>Sat, 16 Apr 2005 16:32:33 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 17:47:55 GMT]]></title><description><![CDATA[<p>Du erzeugst, aber auch die &quot;Simple WinClass&quot; oder ? (WNDCLASSEX und RegisterClassEx()...)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768491</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sat, 16 Apr 2005 17:47:55 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 20:48:16 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">WNDCLASS wc;
	m_hInstance = GetModuleHandle(NULL);

	wc.style			= CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
	wc.lpfnWndProc		= (WNDPROC)WndProc;
	wc.cbClsExtra		= 0;
	wc.cbWndExtra		= 0;
	wc.hInstance		= m_hInstance;
	wc.hIcon			= LoadIcon(NULL, IDI_APPLICATION);
	wc.hCursor			= LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground	= NULL;
	wc.lpszMenuName		= NULL;
	wc.lpszClassName	= m_strClass;

	if (!RegisterClass(&amp;wc))
	{
		MessageBox(NULL,&quot;Fehler beim Registrieren der Windowklasse.&quot;,&quot;FEHLER&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}
</code></pre>
<p>ja wird erstellt... registrieren funktioniert auch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768585</guid><dc:creator><![CDATA[CreateWindowExler]]></dc:creator><pubDate>Sat, 16 Apr 2005 20:48:16 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sat, 16 Apr 2005 21:14:41 GMT]]></title><description><![CDATA[<p>MSDN: <em>hWndParent<br />
[in] Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows.</em></p>
<p>Sieht so aus, als müßtest du für WS_OVERLAPPED ein parent-Fenster angeben. GetDesktopWindow() ist wahrscheinlich das, was Du suchst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768598</guid><dc:creator><![CDATA[peterchen]]></dc:creator><pubDate>Sat, 16 Apr 2005 21:14:41 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sun, 17 Apr 2005 10:15:06 GMT]]></title><description><![CDATA[<p>Was sagt denn GetLastError() dazu?<br />
Wird m_strClass auch schon vor RegisterClass initialisert?<br />
Und zeig am Besten mal deine gesamte WinMain().</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/4165">@peterchen</a>: daran dürfte es IMHO nicht liegen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768738</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Sun, 17 Apr 2005 10:15:06 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sun, 17 Apr 2005 10:17:28 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35122">@Daniel</a>:<br />
bin mir auch nicht sicher - aber es gibt ein paar Stellen, wo NULL als Parent Window nicht durchgeht, und der Titel sagt ja &quot;Fehler 1400 - Invalid Window Handle&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/768741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768741</guid><dc:creator><![CDATA[peterchen]]></dc:creator><pubDate>Sun, 17 Apr 2005 10:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sun, 17 Apr 2005 10:42:14 GMT]]></title><description><![CDATA[<p>Ach, im Titel stehts ja, mmmhhhh.....ich habs jetzt extra nochmal mit den gleichen Styles getestet, bei mir funktionierts.<br />
Ein Parent muss man ja normalerweise auch nur bei Childwindows angeben.</p>
<p>Gibst du in WM_CREATE auch IMMER 0 zurück?<br />
Wenn ja, dann probiers halt mal mit dem DesktopHandle <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/768757</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768757</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Sun, 17 Apr 2005 10:42:14 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sun, 17 Apr 2005 14:08:07 GMT]]></title><description><![CDATA[<p>Das ganze ist ziemlich unlogisch... ich hab das doch nur kopiert und in eine Klasse eingefügt...<br />
Sry aber hier der komplette Quellcode:</p>
<pre><code class="language-cpp">class CWindow;
</code></pre>
<pre><code class="language-cpp">#include &quot;Main.h&quot;

CWindow::CWindow()
{
	m_hWnd = NULL;
}

CWindow::~CWindow()
{

}

bool CWindow::CreateGLWindow(const char *strClass, const char *strTitle, int iWidth, int iHeight, bool bSizeFixed, int iBits, bool bFullscreen,HINSTANCE hInstance)
{
	unsigned int iPixelFormat;
	WNDCLASS wc;
	DWORD dwExStyle = 0;
	DWORD dwStyle = 0;
	RECT rcWindowRect;
	rcWindowRect.left=(long)0;
	rcWindowRect.right=(long)iWidth;
	rcWindowRect.top=(long)0;
	rcWindowRect.bottom=(long)iHeight;

	m_bFullscreen = bFullscreen;
	m_hInstance = hInstance;

	strcpy(m_strClass,strClass);
	wc.style			= CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
	wc.lpfnWndProc		= (WNDPROC)WndProc;
	wc.cbClsExtra		= 0;
	wc.cbWndExtra		= 0;
	wc.hInstance		= m_hInstance;
	wc.hIcon			= LoadIcon(NULL, IDI_APPLICATION);
	wc.hCursor			= LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground	= NULL;
	wc.lpszMenuName		= NULL;
	wc.lpszClassName	= m_strClass;
    if (!RegisterClass(&amp;wc))
	{
		MessageBox(NULL,&quot;Fehler beim Registrieren der Windowklasse.&quot;,&quot;FEHLER&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}
	if (m_bFullscreen)
	{
		DEVMODE dmScreenSettings;
		memset(&amp;dmScreenSettings,0,sizeof(dmScreenSettings));
		dmScreenSettings.dmSize=sizeof(dmScreenSettings);
		dmScreenSettings.dmPelsWidth	= iWidth;
		dmScreenSettings.dmPelsHeight	= iHeight;
		dmScreenSettings.dmBitsPerPel	= iBits;
		dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
		if (ChangeDisplaySettings(&amp;dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)
		{
			if(MessageBox(NULL,&quot;Der benötigte Vollbildmodus wird nicht unterstützt von\ndeiner Grafikkarte. Soll anstelle ein Fenstermodus benutzt werden?&quot;,&quot;Eingabeaufforderung&quot;,MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
			{
				m_bFullscreen = false;
			}
			else
			{
				MessageBox(NULL,&quot;Programm wird beendet.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONSTOP);
				return false;
			}
		}
	}

	if (m_bFullscreen)
	{
		dwExStyle=WS_EX_APPWINDOW;
		dwStyle=WS_POPUP;
		ShowCursor(FALSE);
	}
	else
	{
		dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
		dwStyle=WS_OVERLAPPEDWINDOW;
	}

	AdjustWindowRectEx(&amp;rcWindowRect, dwStyle, FALSE, dwExStyle);
    //m_hWnd = CreateWindowEx(dwExStyle,m_strClass,strTitle,dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,0,0,iWidth,iHeight,NULL,NULL,m_hInstance,NULL);
	m_hWnd = CreateWindow(m_strClass,
                       &quot;Titelleiste&quot;,
                       WS_OVERLAPPEDWINDOW,
                       CW_USEDEFAULT,          /* X-Position auf dem Monitor */
                       CW_USEDEFAULT,          /* Y-Position auf dem Monitor */
                       CW_USEDEFAULT,          /* Fensterbreite              */
                       CW_USEDEFAULT,          /* Fensterhoehe               */
                       NULL,
                       NULL,
                       m_hInstance,
                       NULL);
	if (m_hWnd == NULL)
	{
		int i = GetLastError();
		KillWindow();

		MessageBox(NULL,&quot;Fehler beim Erstellen des Fensters.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}

	static PIXELFORMATDESCRIPTOR pfd =
	{
		sizeof(PIXELFORMATDESCRIPTOR),
		1,
		PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
		PFD_TYPE_RGBA,								// Request An RGBA Format
		iBits,										// Select Our Color Depth
		0, 0, 0, 0, 0, 0,							// Color Bits Ignored
		0,											// No Alpha Buffer
		0,											// Shift Bit Ignored
		0,											// No Accumulation Buffer
		0, 0, 0, 0,									// Accumulation Bits Ignored
		16,											// 16Bit Z-Buffer (Depth Buffer)  
		0,											// No Stencil Buffer
		0,											// No Auxiliary Buffer
		PFD_MAIN_PLANE,								// Main Drawing Layer
		0,											// Reserved
		0, 0, 0										// Layer Masks Ignored
	};

	if (!(m_hDC=GetDC(m_hWnd)))
	{
		KillWindow();
		MessageBox(NULL,&quot;Fehler beim Erstellen des Device Contextes.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}

	if (!(iPixelFormat=ChoosePixelFormat(m_hDC,&amp;pfd)))
	{
		KillWindow();
		MessageBox(NULL,&quot;Fehler beim Finden des richtigen Pixel Formates.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}

	if(!SetPixelFormat(m_hDC,iPixelFormat,&amp;pfd))
	{
		KillWindow();
		MessageBox(NULL,&quot;Fehler beim Setzen des Pixel Formates.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}

	if (!(m_hRC=wglCreateContext(m_hDC)))
	{
		KillWindow();
		MessageBox(NULL,&quot;Fehler beim Erstellen des Render Contextes.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}

	if(!wglMakeCurrent(m_hDC,m_hRC))
	{
		KillWindow();
		MessageBox(NULL,&quot;Fehler beim Aktivieren des Device und Render Contextes.&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONEXCLAMATION);
		return FALSE;
	}
	ShowWindow(m_hWnd,SW_SHOW);
	SetForegroundWindow(m_hWnd);
	SetFocus(m_hWnd);
	ReSizeScene(iWidth, iHeight,100.0f);
	if(!Init())
	{
		KillWindow();
		MessageBox(NULL,&quot;Fehler beim Initalisieren.&quot;,&quot;ERROR&quot;,MB_OK|MB_ICONEXCLAMATION);
		return false;
	}
	return true;
}

void CWindow::KillWindow()
{
	if(m_bFullscreen)
	{
		ChangeDisplaySettings(NULL,0);
		ShowCursor(true);
	}
	if (m_hRC)
	{
		if (!wglMakeCurrent(NULL,NULL))
		{
			MessageBox(NULL,&quot;Fehler beim Freigeben des Render und Device Kontextes.&quot;,&quot;Fehler&quot;,MB_OK | MB_ICONINFORMATION);
		}

		if (!wglDeleteContext(m_hRC))
		{
			MessageBox(NULL,&quot;Fehler beim Löschen des Device Kontextes.&quot;,&quot;Fehler&quot;,MB_OK | MB_ICONINFORMATION);
		}
		m_hRC=NULL;
	}

	if (m_hDC &amp;&amp; !ReleaseDC(m_hWnd,m_hDC))
	{
		MessageBox(NULL,&quot;Fehler beim Freigeben des Device Kontextes des Fensters.&quot;,&quot;Fehler&quot;,MB_OK | MB_ICONINFORMATION);
		m_hDC=NULL;
	}

	if (m_hWnd &amp;&amp; !DestroyWindow(m_hWnd))
	{
		MessageBox(NULL,&quot;Fehler beim Freigeben des Fenster Handles.&quot;,&quot;Fehler&quot;,MB_OK | MB_ICONINFORMATION);
		m_hWnd=NULL;
	}

	if (!UnregisterClass(m_strClass,m_hInstance))
	{
		MessageBox(NULL,&quot;Fehler beim Deregistrieren der Klasse.&quot;,&quot;Fehler&quot;,MB_OK | MB_ICONINFORMATION);
		m_hInstance=NULL;
	}
}

bool CWindow::Init()
{
	glShadeModel(GL_SMOOTH);
	glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
	glClearDepth(1.0f);
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
	m_bActive = true;
	return true;
}

void CWindow::ReSizeScene(unsigned int iWidth, unsigned int iHeight,float fDepth)
{
	if(iHeight==0)
	{
		iHeight=1;
	}
	glViewport(0,0,iWidth,iHeight);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(45.0f,(GLfloat)iWidth/(GLfloat)iHeight,0.1f,fDepth);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}

void CWindow::DrawScene()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	SwapBuffers(m_hDC);
}

LRESULT CALLBACK CWindow::WindowProc(unsigned int iMsg, WPARAM wParam, LPARAM lParam)
{
	switch (iMsg)
	{
		case WM_ACTIVATE:
		{
			if (!HIWORD(wParam)) m_bActive = true;
			else m_bActive = false;
			return 0;
		}
		case WM_SYSCOMMAND:
		{
			switch (wParam)
			{
				case SC_SCREENSAVE:
				case SC_MONITORPOWER:
				return 0;
			}
			break;
		}
		case WM_CLOSE:
		{
			PostQuitMessage(0);
			return 0;
		}
		case WM_CREATE:
		{
			return 0;
		}
		case WM_KEYDOWN:
		{
			m_bKeys[wParam] = true;
			return 0;
		}
		case WM_KEYUP:
		{
			m_bKeys[wParam] = false;
			return 0;
		}
		case WM_SIZE:
		{
			ReSizeScene(LOWORD(lParam),HIWORD(lParam),100.0f);
			return 0;
		}
	}
	return DefWindowProc(m_hWnd,iMsg,wParam,lParam);
}

bool CWindow::MainLoop()
{
	if(m_bActive)
	{
		if(m_bKeys[VK_ESCAPE]) return true;
		DrawScene();
	}
	return false;
}
</code></pre>
<pre><code class="language-cpp">#include &quot;Main.h&quot;
#ifndef _WINDOW_H
#define _WINDOW_H

class CWindow  
{
public:
	bool MainLoop();
	LRESULT CALLBACK WindowProc(unsigned int iMsg,WPARAM wParam,LPARAM lParam);
	void DrawScene();
	void ReSizeScene(unsigned int iWidth,unsigned int iHeight,float fDepth);
	bool Init();
	void KillWindow();
	bool CreateGLWindow(const char *strClass,const char *strTitle,int iWidth,int iHeight, bool bSizeFixed,int iBits, bool bFullscreen, HINSTANCE hInstance);
	CWindow();
	~CWindow();
private:
	bool m_bActive;
	char m_strClass[256];
	bool m_bKeys[256];
	bool m_bFullscreen;
	HGLRC m_hRC;
	HINSTANCE m_hInstance;
	HWND m_hWnd;
	HDC m_hDC;
};

#endif
</code></pre>
<p>und die Main.cpp</p>
<pre><code class="language-cpp">#include &quot;Main.h&quot;

CWindow Window;

LRESULT CALLBACK WndProc(HWND hWnd,UINT	uMsg,WPARAM	wParam,LPARAM lParam)
{
    return Window.WindowProc(uMsg,wParam,lParam);
}

int WINAPI WinMain(	HINSTANCE	hInstance,HINSTANCE	hPrevInstance,LPSTR	lpCmdLine,int nCmdShow)
{
	MSG msg;
	if (!Window.CreateGLWindow(&quot;Simple WinClass&quot;,&quot;Simple WinTitle&quot;,800,600,false,32,false,hInstance))
	{
		return 0;
	}
	while(true)
	{
		if (PeekMessage(&amp;msg,NULL,0,0,PM_REMOVE))
		{
			if (msg.message==WM_QUIT) break;
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);

		}
		else
		{
			if(Window.MainLoop()) break;
		}
	}
    Window.KillWindow();
	return (msg.wParam);							// Exit The Program
}
</code></pre>
<p>Sry das ich jetzt den ganzen Code poste aber ich komm da nicht weiter... typisch Windoof <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/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/768885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/768885</guid><dc:creator><![CDATA[CreateWindowExler]]></dc:creator><pubDate>Sun, 17 Apr 2005 14:08:07 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sun, 17 Apr 2005 17:40:40 GMT]]></title><description><![CDATA[<p>CreateWindowEx() liefert erst einen Handle zurück, nachdem es bereits einige Nachrichten an das Fenster gesendet hat (das ist nicht nur WM_CREATE !)<br />
Du rufst in deiner WndProc() die Window.WindowProc() auf, aber für die ist m_hWnd noch NULL!<br />
Du solltest also auch an deine Window.WindowProc() das richtige Fenster-Handle mit übergeben!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/769019</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769019</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 17 Apr 2005 17:40:40 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sun, 17 Apr 2005 20:17:33 GMT]]></title><description><![CDATA[<p>Danke geeky das wars... danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/769118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769118</guid><dc:creator><![CDATA[CreateWindowExler]]></dc:creator><pubDate>Sun, 17 Apr 2005 20:17:33 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler 1400 - Invalid Window Handle on Sun, 17 Apr 2005 20:49:04 GMT]]></title><description><![CDATA[<p>Am gleichen Problem hab ich damals auch stundenlang rumgesucht bis es mir dann plötzlich beim debuggen aufgefallen war <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=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/769132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769132</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 17 Apr 2005 20:49:04 GMT</pubDate></item></channel></rss>