This repository has been archived by the owner on Jul 26, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Also fix capitalization of `GetDpiForShellUIComponent`. * Add `GetScaleFactorForMonitor` * Add `RegisterScaleChangeEvent` * Add `UnregisterScaleChangeEvent` * Remove `SetLastError` from SHCore functions
- Loading branch information
Showing
5 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
static extern PInvoke.SHCore.GetDpiForShellUIComponent(PInvoke.SHELL_UI_COMPONENT component) -> int | ||
static extern PInvoke.SHCore.GetScaleFactorForMonitor(System.IntPtr hMon, out PInvoke.DEVICE_SCALE_FACTOR pScale) -> PInvoke.HResult | ||
static extern PInvoke.SHCore.RegisterScaleChangeEvent(System.IntPtr hEvent, out System.IntPtr pdwCookie) -> PInvoke.HResult | ||
static extern PInvoke.SHCore.UnregisterScaleChangeEvent(System.IntPtr dwCookie) -> PInvoke.HResult |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.DEVICE_SCALE_FACTOR_INVALID = 0 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_100_PERCENT = 100 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_120_PERCENT = 120 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_125_PERCENT = 125 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_140_PERCENT = 140 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_150_PERCENT = 150 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_160_PERCENT = 160 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_175_PERCENT = 175 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_180_PERCENT = 180 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_200_PERCENT = 200 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_225_PERCENT = 225 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_250_PERCENT = 250 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_300_PERCENT = 300 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_350_PERCENT = 350 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_400_PERCENT = 400 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_450_PERCENT = 450 -> PInvoke.DEVICE_SCALE_FACTOR | ||
PInvoke.DEVICE_SCALE_FACTOR.SCALE_500_PERCENT = 500 -> PInvoke.DEVICE_SCALE_FACTOR |
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
40 changes: 40 additions & 0 deletions
40
src/Windows.ShellScalingApi/ShellScallingApi+DEVICE_SCALE_FACTOR.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright © .NET Foundation and Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace PInvoke | ||
{ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
/// <summary> | ||
/// Indicates a spoofed device scale factor, as a percent. | ||
/// </summary> | ||
public enum DEVICE_SCALE_FACTOR | ||
{ | ||
DEVICE_SCALE_FACTOR_INVALID = 0, | ||
|
||
/// <summary> | ||
/// 100%. The scale factor for the device is 1x. | ||
/// </summary> | ||
SCALE_100_PERCENT = 100, | ||
|
||
/// <summary> | ||
/// 120%. The scale factor for the device is 1.2x. | ||
/// </summary> | ||
SCALE_120_PERCENT = 120, | ||
SCALE_125_PERCENT = 125, | ||
SCALE_140_PERCENT = 140, | ||
SCALE_150_PERCENT = 150, | ||
SCALE_160_PERCENT = 160, | ||
SCALE_175_PERCENT = 175, | ||
SCALE_180_PERCENT = 180, | ||
SCALE_200_PERCENT = 200, | ||
SCALE_225_PERCENT = 225, | ||
SCALE_250_PERCENT = 250, | ||
SCALE_300_PERCENT = 300, | ||
SCALE_350_PERCENT = 350, | ||
SCALE_400_PERCENT = 400, | ||
SCALE_450_PERCENT = 450, | ||
SCALE_500_PERCENT = 500, | ||
} | ||
} |