Last active
August 29, 2015 14:17
-
-
Save kennykerr/389dd22b86b68c9416b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pch.h" | |
using namespace Modern; | |
using namespace Windows::ApplicationModel::Core; | |
using namespace Windows::UI::Core; | |
using namespace Windows::UI::Popups; | |
struct View : IFrameworkViewT<View> | |
{ | |
void SetWindow(CoreWindow const & window) | |
{ | |
window.KeyUp([](CoreWindow const &, KeyEventArgs const & args) | |
{ | |
MODERN_TRACE(L"key: %c\n", args.VirtualKey()); | |
}); | |
MessageDialog dialog(L"Modern C++ for the Windows Runtime", L"Hello World!"); | |
dialog.ShowAsync().Completed([](auto const &, AsyncStatus) | |
{ | |
CoreApplication::Exit(); | |
}); | |
} | |
}; | |
struct ViewSource : IFrameworkViewSourceT<ViewSource> | |
{ | |
IFrameworkView CreateView() | |
{ | |
return make<View>(); | |
} | |
}; | |
int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int) | |
{ | |
CoreApplication::Run(make<ViewSource>()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment