Example #1
0
 /// <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);
 }
Example #2
0
 /// <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);
 }
Example #3
0
        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);
        }
Example #4
0
 public static extern HResult GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS value);
Example #5
0
		public static extern uint SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
Example #6
0
 public static extern void SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
Example #7
0
 private static extern int GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);
Example #8
0
 internal static extern int SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
 private static extern int SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
Example #10
0
 public static extern HRESULT GetProcessDpiAwareness(IntPtr hprocess, ref PROCESS_DPI_AWARENESS value);
Example #11
0
 private static extern void GetProcessDpiAwarenessNative(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);
Example #12
0
 /// <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;
 }
Example #13
0
 public static void GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness)
 {
     GetProcessDpiAwarenessNative(hprocess, out awareness);
 }
Example #14
0
 private static extern bool SetProcessDpiAwarenessNative(PROCESS_DPI_AWARENESS awareness);
Example #15
0
#pragma warning restore CA1707 // Identifiers should not contain underscores


        public static bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness)
        {
            return(SetProcessDpiAwarenessNative(awareness));
        }
Example #16
0
 public static extern IntPtr SetProcessDpiAwareness(PROCESS_DPI_AWARENESS dpiAwareness);
Example #17
0
 internal static extern int GetProcessDpiAwareness(IntPtr hWnd, out PROCESS_DPI_AWARENESS value);
Example #18
0
 private static extern int GetProcessDpiAwareness(SafeProcessHandle hprocess, out PROCESS_DPI_AWARENESS awareness);
Example #19
0
 public static extern void GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);
 private static extern int GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);
Example #21
0
 public static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
Example #22
0
 public static extern int GetProcessDpiAwareness(IntPtr processHandle, out PROCESS_DPI_AWARENESS awareness);
Example #23
0
 [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);
Example #24
0
 internal static extern uint SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
Example #25
0
 public static extern void SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
Example #26
0
 private static extern int SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
Example #27
0
 public static extern HRESULT GetProcessDpiAwareness([In, Optional] HPROCESS hprocess, out PROCESS_DPI_AWARENESS value);
Example #28
0
 [DllImport("SHCore.dll", SetLastError = true)] public static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
Example #29
0
 public static extern bool SetProcessDpiAwarenessContext(PROCESS_DPI_AWARENESS value);
Example #30
0
 public static extern int GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS value);
Example #31
0
 public static extern HRESULT GetProcessDpiAwareness(IntPtr hprocess, ref PROCESS_DPI_AWARENESS value);
Example #32
0
		public static extern uint GetProcessDpiAwareness(IntPtr handle, out PROCESS_DPI_AWARENESS awareness);
Example #33
0
 public static extern void GetProcessDpiAwareness(IntPtr hprocess, out PROCESS_DPI_AWARENESS awareness);