File: Windows.Win32.PInvoke.api-ms-win-shcore-scaling-l1-1-1.dll.g.cs
Project: src\src\System.Windows.Forms.Primitives\src\System.Windows.Forms.Primitives.csproj (System.Windows.Forms.Primitives)
// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{

	/// <content>
	/// Contains extern methods from "api-ms-win-shcore-scaling-l1-1-1.dll".
	/// </content>
	internal static partial class PInvoke
	{
		/// <inheritdoc cref="GetProcessDpiAwareness(winmdroot.Foundation.HANDLE, winmdroot.UI.HiDpi.PROCESS_DPI_AWARENESS*)"/>
		[SupportedOSPlatform("windows8.1")]
		internal static unsafe winmdroot.Foundation.HRESULT GetProcessDpiAwareness(winmdroot.Foundation.HANDLE hprocess, out winmdroot.UI.HiDpi.PROCESS_DPI_AWARENESS value)
		{
			fixed (winmdroot.UI.HiDpi.PROCESS_DPI_AWARENESS* valueLocal = &value)
			{
				winmdroot.Foundation.HRESULT __result = PInvoke.GetProcessDpiAwareness(hprocess, valueLocal);
				return __result;
			}
		}

		/// <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>
		/// <param name="value">The DPI awareness of the specified process. Possible values are from the <a href="https://docs.microsoft.com/windows/desktop/api/shellscalingapi/ne-shellscalingapi-process_dpi_awareness">PROCESS_DPI_AWARENESS</a> enumeration.</param>
		/// <returns>
		/// <para>This function returns one of the following values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>This function is identical to the following code: <c>GetAwarenessFromDpiAwarenessContext(GetThreadDpiAwarenessContext());</c></para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shellscalingapi/nf-shellscalingapi-getprocessdpiawareness#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("api-ms-win-shcore-scaling-l1-1-1.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows8.1")]
		internal static extern unsafe winmdroot.Foundation.HRESULT GetProcessDpiAwareness(winmdroot.Foundation.HANDLE hprocess, winmdroot.UI.HiDpi.PROCESS_DPI_AWARENESS* value);

		/// <summary>Sets the process-default DPI awareness level. This is equivalent to calling SetProcessDpiAwarenessContext with the corresponding DPI_AWARENESS_CONTEXT value.</summary>
		/// <param name="value">The DPI awareness value to set. Possible values are from the <a href="https://docs.microsoft.com/windows/desktop/api/shellscalingapi/ne-shellscalingapi-process_dpi_awareness">PROCESS_DPI_AWARENESS</a> enumeration.</param>
		/// <returns>
		/// <para>This function returns one of the following values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>It is recommended that you set the process-default DPI awareness via application manifest. See <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/mt846517(v=vs.85)">Setting the default DPI awareness for a process</a> for more information. Setting the process-default DPI awareness via API call can lead to unexpected application behavior. Previous versions of Windows only had one DPI awareness value for the entire application. For those applications, the recommendation was to set the DPI awareness value in the manifest as described in <a href="https://docs.microsoft.com/windows/desktop/api/shellscalingapi/ne-shellscalingapi-process_dpi_awareness">PROCESS_DPI_AWARENESS</a>. Under that recommendation, you were not supposed to use <b>SetProcessDpiAwareness</b> to update the DPI awareness. In fact, future calls  to this API would fail after the DPI awareness was set once. Now that DPI awareness is tied to a thread rather than an application, you can use this method to update the DPI awareness. However, consider using <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-setthreaddpiawarenesscontext">SetThreadDpiAwarenessContext</a> instead. <div class="alert"><b>Important</b>  <p class="note">For older applications, it is strongly recommended to not use <b>SetProcessDpiAwareness</b> to set the DPI awareness for your application. Instead, you should declare the DPI awareness for your application in the application manifest. See <a href="https://docs.microsoft.com/windows/desktop/api/shellscalingapi/ne-shellscalingapi-process_dpi_awareness">PROCESS_DPI_AWARENESS</a> for more information about the DPI awareness values and how to set them in the manifest. </div> <div> </div> You must call this API before you call any APIs that depend on the dpi awareness. This is part of the reason why it is recommended to use the application manifest rather than the <b>SetProcessDpiAwareness</b> API. Once API awareness is set for an app, any future calls to this API will fail. This is true regardless of whether you set the DPI awareness in the manifest or by using this API. If the DPI awareness level is not set, the default value is <b>PROCESS_DPI_UNAWARE</b>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("api-ms-win-shcore-scaling-l1-1-1.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows8.1")]
		internal static extern winmdroot.Foundation.HRESULT SetProcessDpiAwareness(winmdroot.UI.HiDpi.PROCESS_DPI_AWARENESS value);
	}
}