From c727abd6674860026b115f209512b9a37ff5c212 Mon Sep 17 00:00:00 2001 From: Zachary Spriggs Date: Wed, 24 Mar 2021 00:09:33 -0400 Subject: [PATCH] Check for XP using WINVER in func__newimage and sub__consolefont This can re-enable `_ConsoleFont` by checking if the version of Windows is greater than XP. Also, for the DPI awareness. --- internal/c/libqb.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index d3455df52..4f13a60f9 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -18464,7 +18464,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ //Creating/destroying an image surface: int32 func__newimage(int32 x,int32 y,int32 bpp,int32 passed){ - #ifdef QB64_WINDOWS + #ifdef QB64_WINDOWS && WINVER > 0x0501 //this block is not compatible with XP static bool j; if(j != 1){ FARPROC dpiaware; @@ -29847,8 +29847,7 @@ void sub__numlock(int32 options){ } void sub__consolefont(qbs* FontName, int FontSize){ - /* - #ifdef QB64_WINDOWS + #ifdef QB64_WINDOWS && WINVER > 0x0501 //this block is not compatible with XP SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1}; HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0); static int OneTimePause; @@ -29870,7 +29869,6 @@ void sub__consolefont(qbs* FontName, int FontSize){ SetCurrentConsoleFontEx(cl_conout, NULL, &info); #endif - */ }