Remove WindowNative and use AppWindow.Id
This commit is contained in:
Родитель
6bec342172
Коммит
f74881996f
|
@ -6,7 +6,6 @@
|
||||||
using Microsoft.UI;
|
using Microsoft.UI;
|
||||||
using Microsoft.UI.Windowing;
|
using Microsoft.UI.Windowing;
|
||||||
using static CommunityToolkit.WinUI.Controls.NativeMethods;
|
using static CommunityToolkit.WinUI.Controls.NativeMethods;
|
||||||
using WinRT.Interop;
|
|
||||||
|
|
||||||
namespace CommunityToolkit.WinUI.Controls;
|
namespace CommunityToolkit.WinUI.Controls;
|
||||||
|
|
||||||
|
@ -173,9 +172,7 @@ public partial class TitleBar : Control
|
||||||
|
|
||||||
private double GetScaleAdjustment()
|
private double GetScaleAdjustment()
|
||||||
{
|
{
|
||||||
IntPtr hWnd = WindowNative.GetWindowHandle(this.Window);
|
DisplayArea displayArea = DisplayArea.GetFromWindowId(this.Window.AppWindow.Id, DisplayAreaFallback.Primary);
|
||||||
WindowId wndId = Win32Interop.GetWindowIdFromWindow(hWnd);
|
|
||||||
DisplayArea displayArea = DisplayArea.GetFromWindowId(wndId, DisplayAreaFallback.Primary);
|
|
||||||
IntPtr hMonitor = Win32Interop.GetMonitorFromDisplayId(displayArea.DisplayId);
|
IntPtr hMonitor = Win32Interop.GetMonitorFromDisplayId(displayArea.DisplayId);
|
||||||
|
|
||||||
// Get DPI.
|
// Get DPI.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче