예제 #1
0
long _stdcall event(struct HWND__* hwnd,unsigned int msg,unsigned int wParam,long lParam)
{

	switch(msg)
	{
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	case WM_ACTIVATEAPP:
		mxhwnd.activeapp = wParam;
		break;
	case WM_KEYDOWN:
		{
			switch(wParam)
			{
			case VK_ESCAPE:
				mxhwnd.Kill();
				break;
			}

			switch(mxhwnd.GetScreen())
			{
			case ID_START:
				start.keypress(wParam);
				break;
			case ID_GAMEOVER:
				{
					over.keypress(wParam);
				}
				break;
			case ID_LAUNCH:
				{
					launch.keypress(wParam);
				}
				break;
			}
		
		}
		break;
	case WM_KEYUP:
		{
			game.keyup(wParam);
		}
		break;
	case WM_TIMER:
		{
			mxhwnd.ChangeTime();// you can use whatever type of clock
			// or timer you want to change the time for the sync changes
		}
		break;
	default: return DefWindowProc(hwnd,msg,wParam,lParam);
	}

	return (0);
}