AfxSetProcessDPIAwarefunction
Sets the current process as dots per inch (dpi) aware.
Syntax
FUNCTION AfxSetProcessDPIAware () AS BOOLEAN
Return value
If the function succeeds, the return value is TRUE. Otherwise, the return value is FALSE.
Description
Sets the current process as dots per inch (dpi) aware.
Note: AfxSetProcessDPIAware is subject to a possible race condition if a DLL caches dpi settings during initialization. For this reason, it is recommended that dpi-aware be set through the application (.exe) manifest rather than by calling AfxSetProcessDPIAware.
Remarks
DLLs should accept the dpi setting of the host process rather than call AfxSetProcessDPIAware 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.
Example
<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>
Reference
- Include file
AfxWin.inc - Defined in AfxNova/AfxWin.inc:1530
- Documented in Windows/Windows Procedures.md
- Topic: Windows Procedures