Created
          May 28, 2019 09:46 
        
      - 
      
- 
        Save rdeioris/7ff557b5be6a6454360099ea61e5e926 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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 "winrt/Windows.ApplicationModel.Core.h" | |
| #include "winrt/Windows.UI.Core.h" | |
| #include "winrt/Windows.UI.ViewManagement.h" | |
| #include <dxgi1_6.h> | |
| #include <d3d11_4.h> | |
| #include <Xinput.h> | |
| #include <vector> | |
| #include <string> | |
| #include <exception> | |
| #include <memory> | |
| #include <fstream> | |
| using namespace winrt::Windows::ApplicationModel::Core; | |
| using namespace winrt::Windows::UI::Core; | |
| using namespace winrt::Windows::UI::ViewManagement; | |
| class ViewProvider : public winrt::implements<ViewProvider, IFrameworkView> | |
| { | |
| public: | |
| // IFrameworkView methods | |
| void Initialize(CoreApplicationView const & applicationView) | |
| { | |
| } | |
| void Uninitialize() | |
| { | |
| } | |
| void SetWindow(CoreWindow const & window) | |
| { | |
| window.Activate(); | |
| auto windowPtr = static_cast<::IUnknown*>(winrt::get_abi(window)); | |
| // fix b button | |
| auto navigation = SystemNavigationManager::GetForCurrentView(); | |
| navigation.BackRequested([](auto, auto args) | |
| { | |
| args.Handled(true); | |
| }); | |
| } | |
| void Load(winrt::hstring const &) | |
| { | |
| } | |
| void Run() | |
| { | |
| for (;;) | |
| { | |
| CoreWindow::GetForCurrentThread().Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); | |
| } | |
| } | |
| }; | |
| class ViewProviderFactory : public winrt::implements<ViewProviderFactory, IFrameworkViewSource> | |
| { | |
| public: | |
| IFrameworkView CreateView() | |
| { | |
| return winrt::make<ViewProvider>(); | |
| } | |
| }; | |
| // Entry point | |
| int WINAPI wWinMain( | |
| _In_ HINSTANCE hInstance, | |
| _In_ HINSTANCE hPrevInstance, | |
| _In_ LPWSTR lpCmdLine, | |
| _In_ int nCmdShow | |
| ) | |
| { | |
| auto viewProviderFactory = winrt::make<ViewProviderFactory>(); | |
| CoreApplication::Run(viewProviderFactory); | |
| return 0; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment