SetProcessDPIAware function
[
SetProcessDPIAware is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use SetProcessDpiAwareness.
]Sets the current process as dots per inch (dpi) aware.
Syntax
BOOL WINAPI SetProcessDPIAware(void);
Parameters
This function has no parameters.
Return value
Type: Type: BOOL
If the function succeeds, the return value is nonzero. Otherwise, the return value is zero.
Remarks
SetProcessDPIAware is available for use only in the operating systems specified in the Requirements section. This method may have unexpected behavior in subsequent versions of the operating system. Use SetProcessDpiAwareness instead.
DLLs should accept the dpi setting of the host process rather than call SetProcessDPIAware themselves. To be set properly, dpiAware should be specified as part of the application (.exe) manifest. (dpiAware defined in an embedded DLL manifest has no affect.) The following markup shows how to set dpiAware as part of an application (.exe) manifest.
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" > ... <asmv3:application> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> <dpiAware>true</dpiAware> </asmv3:windowsSettings> </asmv3:application> ... </assembly>
For more information about application manifests, see Manifests (Side-by-Side Assemblies).
Requirements
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|