-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathWinMain.cpp
More file actions
53 lines (41 loc) · 1.23 KB
/
WinMain.cpp
File metadata and controls
53 lines (41 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <Windows.h>
#include "pch.h"
#include "App.h"
#include "MainPage.h"
#include <Mile.Xaml.h>
int WINAPI wWinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nShowCmd)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
winrt::init_apartment(winrt::apartment_type::single_threaded);
winrt::com_ptr<winrt::MileXamlControlsDemo::implementation::App> app =
winrt::make_self<winrt::MileXamlControlsDemo::implementation::App>();
winrt::MileXamlControlsDemo::MainPage XamlWindowContent =
winrt::make<winrt::MileXamlControlsDemo::implementation::MainPage>();
HWND WindowHandle = ::CreateWindowExW(
WS_EX_CLIENTEDGE,
L"Mile.Xaml.ContentWindow",
L"MileXamlControlsDemo",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
0,
CW_USEDEFAULT,
0,
nullptr,
nullptr,
hInstance,
winrt::get_abi(XamlWindowContent));
if (!WindowHandle)
{
return -1;
}
::ShowWindow(WindowHandle, nShowCmd);
::UpdateWindow(WindowHandle);
int Result = ::MileXamlContentWindowDefaultMessageLoop();
app->Close();
return Result;
}