Exemple #1
0
	//--------------------------------------------------------------------------------------
	// Función por defecto para manejar los mensajes de Windows.
	//--------------------------------------------------------------------------------------
	LRESULT CALLBACK WndMsgHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		Application * App = Application::GetInstance();

		if(App->CallWndProc(hWnd, uMsg, wParam, lParam))
		{
			return 0;
		}
		else
		{
			switch(uMsg)
			{
			case WM_CREATE:
				return 0;

			case WM_CLOSE:
				PostMessage(hWnd, WM_QUIT, 0L, 0L);
				return 0;
				
			case WM_SIZE:
				App->SetWidth(LOWORD(lParam));
				App->SetHeight(HIWORD(lParam));
				return 0;

			default:
				return DefWindowProc(hWnd, uMsg, wParam, lParam);
			}
		}
	}