mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-25 01:27:59 +08:00
97a8aeb118
* Fix dark title bar for shortcuts window * Adjust editor sizes * Fetch accent button style from resources instead * Modernize the editor UI Reimplemented the XAML bridge to support Mica * Use fluent icons * Modernize the preview key visuals * Implement teaching tips for key drop-down messages * Fix spelling * Fix delete button alignment in keys editor * Remove trace log from bridge message handler * Add WinUI depends to installer script * Hide icon and caption from editor title bar * Update remap entries to look like cards * Use built-in content dialog buttons * Update add button * Fix spelling * Fix installer script for ARM64 * Fix spelling AGAIN * Update dev documentation * Prevent white flash on dark mode * Revert 3-key layout but make window wider * f: align webview versions * f: add pipeline exceptions for Microsoft DLLs that are not versioned * f: add vcruntime140_1_app.dll to the exception list * f: update webview versions
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
#pragma once
|
|
|
|
// This class is used for handling XAML operations
|
|
class XamlBridge2
|
|
{
|
|
public:
|
|
// Function to run the message loop for the xaml window
|
|
void MessageLoop();
|
|
|
|
// Constructor
|
|
XamlBridge2(HWND parent) : parentWindow(parent) {}
|
|
|
|
// Function to initialize the xaml bridge
|
|
HWND InitBridge();
|
|
|
|
// Message Handler function for Xaml windows
|
|
LRESULT MessageHandler(UINT const message, WPARAM const wParam, LPARAM const lParam) noexcept;
|
|
|
|
private:
|
|
// Defines the window types for core windows
|
|
enum WINDOW_TYPE
|
|
{
|
|
IMMERSIVE_BODY = 0x0,
|
|
IMMERSIVE_DOCK = 0x1,
|
|
IMMERSIVE_HOSTED = 0x2,
|
|
IMMERSIVE_TEST = 0x3,
|
|
IMMERSIVE_BODY_ACTIVE = 0x4,
|
|
IMMERSIVE_DOCK_ACTIVE = 0x5,
|
|
NOT_IMMERSIVE = 0x6,
|
|
};
|
|
|
|
// Function signature for PrivateCreateCoreWindow
|
|
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);
|
|
|
|
// Stores the handle of the parent native window
|
|
HWND parentWindow = nullptr;
|
|
|
|
// Stores the core window for the UI thread
|
|
Core::CoreWindow coreWindow = nullptr;
|
|
|
|
// Stores the handle of the core window
|
|
HWND coreWindowHwnd = nullptr;
|
|
|
|
// Stores the xaml framework view for the UI thread
|
|
FrameworkView frameworkView;
|
|
};
|