<?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[WindowProc trotz Definition nicht gefunden]]></title><description><![CDATA[<p>Hallo C++ Programmierer,</p>
<p>der Compiler sagt mir: error C2065: 'WindowProc': nichtdeklarierter Bezeichner<br />
Aber ich habe die Funktion definiert.</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;Test.h&quot;

#define WINDOW_CLASS_NAME L&quot;Game Window&quot;

#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code)&amp;0x8000)?1:0)
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code)&amp;0x8000)?0:1)

// Globals

HWND main_window_handle = NULL;
HINSTANCE hinstance_app = NULL;

// --------------
// --- System ---
// --------------

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
{
	MSG msg;
	HWND hwnd;
	WNDCLASSEX winclass;

	winclass.cbSize = sizeof(WNDCLASSEX);
	winclass.style = CS_HREDRAW | CS_VREDRAW;
	winclass.lpfnWndProc = WindowProc;
	winclass.cbClsExtra = 0;
	winclass.cbWndExtra = 0;
	winclass.hInstance = hinstance;
	winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	winclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
	winclass.lpszMenuName = NULL;
	winclass.lpszClassName = WINDOW_CLASS_NAME;
	winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	hinstance_app = hinstance;

	if (!RegisterClassEx(&amp;winclass))
	{
		return(0);
	}

	if (!(hwnd = CreateWindowEx(NULL, WINDOW_CLASS_NAME, L&quot;My Game&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 800, 600, NULL, NULL, hinstance, NULL)))
	{
		return(0);
	}

	main_window_handle = hwnd;

	GameInit();

	while(TRUE)
	{
		if (PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
		{
			if (msg.message == WM_QUIT)
			{
				break;
			}

			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}

		GameMain();
	}

	GameShutdown();

	return(msg.wParam);
}

LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	HDC hdc;
	PAINTSTRUCT paintstruct;

	switch (msg)
	{
		case WM_CREATE:
		{
			return(0);
		}

		case WM_PAINT:
		{
			hdc = BeginPaint(hwnd, &amp;paintstruct);
			EndPaint(hwnd, &amp;paintstruct);

			return(0);
		}

		case WM_DESTROY:
		{
			PostQuitMessage(0);

			return (0);
		}
	}

	return (DefWindowProc(hwnd, msg, wparam, lparam));
}

// ---------------
// --- Methods ---
// ---------------

void GameInit()
{

}

void GameMain()
{
	if (KEYDOWN(VK_ESCAPE))
	{
		SendMessage(main_window_handle, WM_CLOSE, 0, 0);
	}
}

void GameShutdown()
{

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/300126/windowproc-trotz-definition-nicht-gefunden</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 22:51:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/300126.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Feb 2012 22:34:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WindowProc trotz Definition nicht gefunden on Sat, 25 Feb 2012 22:34:02 GMT]]></title><description><![CDATA[<p>Hallo C++ Programmierer,</p>
<p>der Compiler sagt mir: error C2065: 'WindowProc': nichtdeklarierter Bezeichner<br />
Aber ich habe die Funktion definiert.</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;Test.h&quot;

#define WINDOW_CLASS_NAME L&quot;Game Window&quot;

#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code)&amp;0x8000)?1:0)
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code)&amp;0x8000)?0:1)

// Globals

HWND main_window_handle = NULL;
HINSTANCE hinstance_app = NULL;

// --------------
// --- System ---
// --------------

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
{
	MSG msg;
	HWND hwnd;
	WNDCLASSEX winclass;

	winclass.cbSize = sizeof(WNDCLASSEX);
	winclass.style = CS_HREDRAW | CS_VREDRAW;
	winclass.lpfnWndProc = WindowProc;
	winclass.cbClsExtra = 0;
	winclass.cbWndExtra = 0;
	winclass.hInstance = hinstance;
	winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	winclass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
	winclass.lpszMenuName = NULL;
	winclass.lpszClassName = WINDOW_CLASS_NAME;
	winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	hinstance_app = hinstance;

	if (!RegisterClassEx(&amp;winclass))
	{
		return(0);
	}

	if (!(hwnd = CreateWindowEx(NULL, WINDOW_CLASS_NAME, L&quot;My Game&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 800, 600, NULL, NULL, hinstance, NULL)))
	{
		return(0);
	}

	main_window_handle = hwnd;

	GameInit();

	while(TRUE)
	{
		if (PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
		{
			if (msg.message == WM_QUIT)
			{
				break;
			}

			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}

		GameMain();
	}

	GameShutdown();

	return(msg.wParam);
}

LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	HDC hdc;
	PAINTSTRUCT paintstruct;

	switch (msg)
	{
		case WM_CREATE:
		{
			return(0);
		}

		case WM_PAINT:
		{
			hdc = BeginPaint(hwnd, &amp;paintstruct);
			EndPaint(hwnd, &amp;paintstruct);

			return(0);
		}

		case WM_DESTROY:
		{
			PostQuitMessage(0);

			return (0);
		}
	}

	return (DefWindowProc(hwnd, msg, wparam, lparam));
}

// ---------------
// --- Methods ---
// ---------------

void GameInit()
{

}

void GameMain()
{
	if (KEYDOWN(VK_ESCAPE))
	{
		SendMessage(main_window_handle, WM_CLOSE, 0, 0);
	}
}

void GameShutdown()
{

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2185835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2185835</guid><dc:creator><![CDATA[Vyax]]></dc:creator><pubDate>Sat, 25 Feb 2012 22:34:02 GMT</pubDate></item><item><title><![CDATA[Reply to WindowProc trotz Definition nicht gefunden on Sat, 25 Feb 2012 22:40:30 GMT]]></title><description><![CDATA[<p>Vyax schrieb:</p>
<blockquote>
<p>der Compiler sagt mir: error C2065: 'WindowProc': nichtdeklarierter Bezeichner<br />
Aber ich habe die Funktion definiert.</p>
</blockquote>
<p>Du hast sie aber erst später definiert. Der Compiler liest streng von oben nach unten. Also entweder Reihenfolge vertauschen oder vorher deklarieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2185837</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2185837</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sat, 25 Feb 2012 22:40:30 GMT</pubDate></item></channel></rss>