Ejemplo n.º 1
0
int WINAPI wWinMain(_In_ HINSTANCE hInstance,
	_In_opt_ HINSTANCE hPrevInstance,
	_In_ PWSTR lpCmdLine,
	_In_ int nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);
	muiController->Init();
	_Module.Init(nullptr, hInstance);
	MSG msg;
	::InitCommonControls();
	Metro::MetroWindow iMetroWindow;
	
	RECT rect = { (::GetSystemMetrics(SM_CXSCREEN) - 720) / 2, (::GetSystemMetrics(SM_CYSCREEN) - 450) / 2, (::GetSystemMetrics(SM_CXSCREEN) + 720) / 2, (::GetSystemMetrics(SM_CYSCREEN) + 450) / 2 };
	if (iMetroWindow.Create(nullptr, rect, METRO_INTERNAL_WINDOWLNAME, WS_OVERLAPPED  | WS_CLIPSIBLINGS | WS_MINIMIZEBOX | WS_POPUP | WS_SYSMENU, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE|WS_EX_ACCEPTFILES) == nullptr)
	{
		return -1;
	}
	DWORD dwExit = 0;
	iMetroWindow.ShowWindow(nCmdShow);
	iMetroWindow.UpdateWindow();

	while (GetMessage(&msg, nullptr, 0, 0)>0)
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	dwExit = iMetroWindow.GetExitCode();
	::CoUninitialize();
	_Module.Term();
	return dwExit;
}
Ejemplo n.º 2
0
int WINAPI wWinMain(_In_ HINSTANCE hInstance,
	_In_opt_ HINSTANCE hPrevInstance,
	_In_ PWSTR lpCmdLine,
	_In_ int nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);
	if (!CoInitializeSingle::Initialize()){

	}
	HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
	Metro::MUI::muiController.Init();
	_Module.Init(nullptr, hInstance);
	MSG msg;
	::InitCommonControls();
	Metro::MetroWindow iMetroWindow;
	
	RECT rect = { (::GetSystemMetrics(SM_CXSCREEN) - 720) / 2, (::GetSystemMetrics(SM_CYSCREEN) - 450) / 2, (::GetSystemMetrics(SM_CXSCREEN) + 720) / 2, (::GetSystemMetrics(SM_CYSCREEN) + 450) / 2 };
	if (iMetroWindow.Create(nullptr, rect, METRO_INTERNAL_WINDOWLNAME, WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_ACCEPTFILES) == nullptr)
	{
		return -1;
	}
	DWORD dwExit = 0;
	iMetroWindow.ShowWindow(nCmdShow);
	iMetroWindow.UpdateWindow();

	while (GetMessage(&msg, nullptr, 0, 0)>0)
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	dwExit = iMetroWindow.GetExitCode();
	_Module.Term();
	return dwExit;
}