diff --git a/libtinyfiledialogs/tinyfiledialogs.c b/libtinyfiledialogs/tinyfiledialogs.c index 30865fe..b7662fd 100644 --- a/libtinyfiledialogs/tinyfiledialogs.c +++ b/libtinyfiledialogs/tinyfiledialogs.c @@ -182,6 +182,14 @@ char tinyfd_needs[] = "\ #pragma warning(disable:4706) /* allows usage of strncpy, strcpy, strcat, sprintf, fopen */ #endif +#if defined(USE_WINDOWS_HIDPI) && defined(_WIN64) +#include + +#pragma comment(linker,"\"/manifestdependency:type='win32' \ +name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ +processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif // USE_WINDOWS_HIDPI + static int getenvDISPLAY(void) { return tinyfd_assumeGraphicDisplay || getenv("DISPLAY"); @@ -1060,6 +1068,9 @@ int tinyfd_messageBoxW( wchar_t const * aIconType, /* "info" "warning" "error" "question" */ int aDefaultButton) /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ { +#if defined(USE_WINDOWS_HIDPI) && defined(_WIN64) + SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); +#endif int lBoxReturnValue; UINT aCode; @@ -1130,6 +1141,9 @@ int tinyfd_notifyPopupW( wchar_t const * aMessage, /* NULL or L"" may contain \n \t */ wchar_t const * aIconType) /* L"info" L"warning" L"error" */ { +#if defined(USE_WINDOWS_HIDPI) && defined(_WIN64) + SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); +#endif wchar_t * lDialogString; size_t lTitleLen; size_t lMessageLen; @@ -1202,6 +1216,9 @@ wchar_t * tinyfd_inputBoxW( wchar_t const * aMessage, /* NULL or L"" (\n and \t have no effect) */ wchar_t const * aDefaultInput) /* L"" , if NULL it's a passwordBox */ { +#if defined(USE_WINDOWS_HIDPI) && defined(_WIN64) + SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); +#endif static wchar_t lBuff[MAX_PATH_OR_CMD]; wchar_t * lDialogString; FILE * lIn; @@ -1273,6 +1290,7 @@ wchar_t * tinyfd_inputBoxW( wcscat(lDialogString, L"tinyfiledialogsTopWindow"); wcscat(lDialogString, L"\n\ +\n\