Allow disabling SetProcessDPIAware() call

Add Windows-specific wxMSWDisableSettingHighDPIAware() function then can
be called before startup (i.e. wxEntry() call) to disable wxWidgets'
handling of DPI awareness. This is useful for code embedded in non-wx
applications as well as for purely wx application that are not
HiDPI-ready (although the latter has the option of forcing
dpiAware=false in the manifest).

See also https://groups.google.com/d/msg/wx-dev/Z0VpgzCY34U/f1FfPqGDppMJ
and #16116.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2015-01-24 15:00:03 +00:00
parent f4ac4fcab6
commit 14f052a768
4 changed files with 43 additions and 1 deletions

View File

@@ -107,5 +107,22 @@ bool wxInitialize(int argc = 0, wxChar **argv = NULL);
*/
void wxUninitialize();
/**
Prevents wxWidgets from setting HighDPI awareness mode.
wxEntry calls SetDPIProcessAware() early during initialization on Windows.
To prevent this (e.g. because wx is embedded in native code and disabling
DPI awareness in the manifest is not an option), call this function
*before* wxEntry() is called.
@onlyfor{wxmsw}
@header{wx/init.h}
@since 3.0.3, but only available in 3.0.x, not 3.1+ which doesn't make
the SetDPIProcessAware() call anymore.
*/
void wxMSWDisableSettingHighDPIAware();
//@}