XamlBridge2.h
 1  #pragma once
 2  
 3  // This class is used for handling XAML operations
 4  class XamlBridge2
 5  {
 6  public:
 7      // Function to run the message loop for the xaml window
 8      void MessageLoop();
 9  
10      // Constructor
11      XamlBridge2(HWND parent) : parentWindow(parent) {}
12  
13      // Function to initialize the xaml bridge
14      HWND InitBridge();
15  
16      // Message Handler function for Xaml windows
17      LRESULT MessageHandler(UINT const message, WPARAM const wParam, LPARAM const lParam) noexcept;
18  
19  private:
20      // Defines the window types for core windows
21      enum WINDOW_TYPE
22      {
23          IMMERSIVE_BODY = 0x0,
24          IMMERSIVE_DOCK = 0x1,
25          IMMERSIVE_HOSTED = 0x2,
26          IMMERSIVE_TEST = 0x3,
27          IMMERSIVE_BODY_ACTIVE = 0x4,
28          IMMERSIVE_DOCK_ACTIVE = 0x5,
29          NOT_IMMERSIVE = 0x6,
30      };
31  
32      // Function signature for PrivateCreateCoreWindow
33      typedef HRESULT(CDECL* fnPrivateCreateCoreWindow)(WINDOW_TYPE WindowType, LPCWSTR pWindowTitle, INT X, INT Y, UINT uWidth, UINT uHeight, DWORD dwAttributes, HWND hOwnerWindow, REFIID riid, void** ppv);
34  
35      // Stores the handle of the parent native window
36      HWND parentWindow = nullptr;
37  
38      // Stores the core window for the UI thread
39      Core::CoreWindow coreWindow = nullptr;
40  
41      // Stores the handle of the core window
42      HWND coreWindowHwnd = nullptr;
43  
44      // Stores the xaml framework view for the UI thread
45      FrameworkView frameworkView;
46  };