mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] mxe SetProcessDPIAware/ness


From: Nagaev Boris
Subject: Re: [Mingw-cross-env-list] mxe SetProcessDPIAware/ness
Date: Wed, 20 Jul 2016 11:35:50 +0300

On Tue, Jul 19, 2016 at 1:06 AM, Dave Lawrence
<address@hidden> wrote:
> I want to add SetProcessDPIAware[ness] to my cross-compiled application.
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms633543(v=vs.85).aspx
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/dn302122(v=vs.85).aspx
>
> MXE (master) seems to have a header definition for SetProcessDPIAware (only)
>
> #if _WIN32_WINNT >= 0x0600
> #define USER_DEFAULT_SCREEN_DPI 96
>
>   WINUSERAPI WINBOOL WINAPI SetProcessDPIAware (VOID);
>   WINUSERAPI WINBOOL WINAPI IsProcessDPIAware (VOID);
> #endif
> #endif
>
> but there is no symbol in libuser32.a for either
>
> can anyone help?
>
> Thanks,
>
>

Hi,

most packages of MXE are Windows XP compatible. Windows XP doesn't
have these functions.

As a workaround, you can load the function in runtime using
GetModuleHandle and GetProcAddress. If it fails, then the OS does not
have this function and you can handle this situation (e.g., fail or
fall back to some default values).

See (not yet committed) patch for libui which solved similar problem
for function TaskDialog:
https://gist.github.com/71f871ba6d7cd6f53ceb40d6c98f66b7

Is there a better way of using function appeared in post-XP Windows?


-- 


Best regards,
Boris Nagaev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]