
#include <tchar.h>
#include <Windows.h>

#include "mgoldfish.h"

#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment(lib, "gdiplus.lib")


CAppModule _Module;


int APIENTRY _tWinMain(HINSTANCE hInstance,
					   HINSTANCE hPrevInstance,
					   LPTSTR    lpCmdLine,
					   int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);


	_Module.Init(NULL,hInstance);

	GdiplusStartupInput gdiplusStartupInput;
	ULONG_PTR gdiplusToken;
	GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

	CMGoldFishWnd wndMain;
	MSG msg;

	if ( NULL == wndMain.Create ( NULL, CWindow::rcDefault, _T("My First ATL Window") )){
		return 1;  
	}

	wndMain.ShowWindow(nCmdShow);
	wndMain.UpdateWindow();

	while ( GetMessage(&msg,wndMain.m_hWnd,0,0) )
	{
		//if (!TranslateAccelerator(msg.hwnd,wndMain.m_hAccel,&msg))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}
	GdiplusShutdown(gdiplusToken);
	_Module.Term();
	return (int)msg.wParam;
	return 1;
}



