/// <summary> /// Sets the current process to a specified dots per inch (dpi) awareness level. /// </summary> /// <param name="value">The DPI awareness value to set.</param> /// <returns></returns> public static bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value) { if (IsPlatformSupported) { return(NativeMethods.SetProcessDpiAwareness(value).Succeeded); } return(false); }
/// <summary> /// Retrieves the dots per inch (dpi) awareness of the specified process. /// </summary> /// <param name="hprocess">Handle of the process that is being queried. If this parameter is NULL, the current process is queried.</param> /// <returns>The DPI awareness of the specified process.</returns> public static PROCESS_DPI_AWARENESS GetProcessDpiAwareness(IntPtr hprocess) { if (IsPlatformSupported) { PROCESS_DPI_AWARENESS value = PROCESS_DPI_AWARENESS.PROCESS_DPI_UNAWARE; if (NativeMethods.GetProcessDpiAwareness(hprocess, ref value).Succeeded) { return(value); } } return(PROCESS_DPI_AWARENESS.PROCESS_DPI_UNAWARE); }
public static PROCESS_DPI_AWARENESS GetProcessDpiAwareness(IntPtr hprocess) { PROCESS_DPI_AWARENESS pda = PROCESS_DPI_AWARENESS.PROCESS_DPI_UNAWARE; if (GetProcessDpiAwareness(hprocess, out pda) != 0) { int error = Marshal.GetLastWin32Error(); var exception = new System.ComponentModel.Win32Exception(error); Debug.WriteLine("ERROR: " + error + ": " + exception.Message); return(PROCESS_DPI_AWARENESS.PROCESS_DPI_ERROR); } return(pda); }
public static extern HResult GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS value);
public static extern uint SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
public static extern void SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
private static extern int GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);
internal static extern int SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
private static extern int SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
public static extern HRESULT GetProcessDpiAwareness(IntPtr hprocess, ref PROCESS_DPI_AWARENESS value);
private static extern void GetProcessDpiAwarenessNative(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);
/// <summary> /// Sets the current process to a specified dots per inch (dpi) awareness level. /// </summary> /// <param name="value">The DPI awareness value to set.</param> /// <returns></returns> public static bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value) { if (IsPlatformSupported) { return NativeMethods.SetProcessDpiAwareness(value).Succeeded; } return false; }
public static void GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness) { GetProcessDpiAwarenessNative(hprocess, out awareness); }
private static extern bool SetProcessDpiAwarenessNative(PROCESS_DPI_AWARENESS awareness);
#pragma warning restore CA1707 // Identifiers should not contain underscores public static bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness) { return(SetProcessDpiAwarenessNative(awareness)); }
public static extern IntPtr SetProcessDpiAwareness(PROCESS_DPI_AWARENESS dpiAwareness);
internal static extern int GetProcessDpiAwareness(IntPtr hWnd, out PROCESS_DPI_AWARENESS value);
private static extern int GetProcessDpiAwareness(SafeProcessHandle hprocess, out PROCESS_DPI_AWARENESS awareness);
public static extern void GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);
public static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
public static extern int GetProcessDpiAwareness(IntPtr processHandle, out PROCESS_DPI_AWARENESS awareness);
[DllImport("user32.dll", PreserveSig = false, ExactSpelling = true, EntryPoint = "SetProcessDpiAwarenessInternal")] //This is a #define in Windows.h public static extern void SetProcessDPIAwareness(PROCESS_DPI_AWARENESS awareness);
internal static extern uint SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
public static extern HRESULT GetProcessDpiAwareness([In, Optional] HPROCESS hprocess, out PROCESS_DPI_AWARENESS value);
[DllImport("SHCore.dll", SetLastError = true)] public static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
public static extern bool SetProcessDpiAwarenessContext(PROCESS_DPI_AWARENESS value);
public static extern int GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS value);
public static extern uint GetProcessDpiAwareness(IntPtr handle, out PROCESS_DPI_AWARENESS awareness);