add last corrections for MinGW bugs

This commit is contained in:
Alexander Frick
2025-12-05 19:54:58 -06:00
parent 36fe56e5ad
commit 3c9ecb462e
5 changed files with 41 additions and 30 deletions
+27 -21
View File
@@ -9,31 +9,37 @@
#pragma code_page(65001) // UTF-8
#endif // __clang__
#define IDD_MAINFRAME 100 // Main dialog
#define IDD_MAINFRAME 100 // Main dialog
#define IDI_MAINFRAME 106 // Main .exe/window icon
#define IDI_SMALL 107 // Main dialog icon
#define IDC_MAINFRAME 108 // Main window
#define IDI_MAINFRAME 106 // Main .exe/window icon
#define IDI_SMALL 107 // Main dialog icon
#define IDC_MAINFRAME 108 // Main window
#define IDS_SUCC_ACTIVATION 0
#define IDS_WAITING_INPUT 1
#define IDS_ID_TOO_LARGE 2
#define IDS_INVALID_CHAR 3
#define IDS_INVALID_CHECK 4
#define IDS_UNKNOWN_ID 5
#define IDS_UNLUCKY_ID 6
#define IDS_TALKING_TO_SYS 7
#define IDS_ERROR 8
#define IDS_INFORMATION 9
#define IDS_FAILED_INITIALIZE 10
#define IDS_FAILED_CHECK 11
#define IDS_ALREADY_ACTIVATED 12
#define IDS_LIC_MAN_FAILED 13
#define IDS_GETVER_ERR 14
#define IDS_ABOUT_TITLE 15
#define IDS_SUCC_ACTIVATION 0
#define IDS_WAITING_INPUT 1
#define IDS_ID_TOO_LARGE 2
#define IDS_INVALID_CHAR 3
#define IDS_INVALID_CHECK 4
#define IDS_UNKNOWN_ID 5
#define IDS_UNLUCKY_ID 6
#define IDS_TALKING_TO_SYS 7
#define IDS_ERROR 8
#define IDS_INFORMATION 9
#define IDS_FAILED_INITIALIZE 10
#define IDS_FAILED_CHECK 11
#define IDS_ALREADY_ACTIVATED 12
#define IDS_LIC_MAN_FAILED 13
#define IDS_GETVER_ERR 14
#define IDS_ABOUT_TITLE 15
#ifdef APP_MANIFEST
#warning "APP_MANIFEST" should not already be defined
#else
#define APP_MANIFEST 1
#endif // APP_MANIFEST
#ifndef IDC_STATIC
#define IDC_STATIC -1
#define IDC_STATIC -1
#endif // IDC_STATIC
// Next default values for new objects
+4 -4
View File
@@ -13,11 +13,11 @@
#include "version.h"
#endif
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#include <windows.h>
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "winres.h"
#include <winres.h>
#ifdef __MINGW32__
#include "winuser.h"
#include <winuser.h>
#endif
/////////////////////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@
#ifdef __MINGW32__
// Embed manifest for common controls and DPI support
1 RT_MANIFEST "xp_activate32.manifest"
APP_MANIFEST RT_MANIFEST "xp_activate32.manifest"
#endif
#ifdef APSTUDIO_INVOKED
+1 -1
View File
@@ -96,7 +96,7 @@ float concatToFloat(int major, int minor) {
int digits = (minor == 0) ? 1 : std::to_string(minor).size();
// Build the float: whole + fractional / (10^digits)
const float retval = major + minor / std::pow(10.0f, digits);
const float retval = static_cast<float>(major + minor / std::pow(10.0f, digits));
return retval;
}
+2 -2
View File
@@ -28,8 +28,8 @@
#ifndef VERSION_STRING
#define VERSION_STRING _VERSION(MAJOR_VERSION, MINOR_VERSION, BUILD_VERSION)
#define ABOUT_TITLE L"About XP_Activate32"
#define ABOUT_COPYRIGHT L"Copyright © 2025 Alex313031"
#define LEGAL_COPYRIGHT L"© 2025"
#define ABOUT_COPYRIGHT L"Copyright \251 2025 Alex313031"
#define LEGAL_COPYRIGHT L"\251 2025 Alex313031"
#endif // VERSION_STRING
#endif // XP_ACTIVATE32_VERSION_H_
+7 -2
View File
@@ -1061,7 +1061,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
freopen_s(&fNonExistFile, "CONOUT$", "w", stdout); // Standard error
freopen_s(&fNonExistFile, "CONOUT$", "w", stderr); // Standard out
#else
// freopen_s doesn't exist in MinGW...
// freopen_s equivalent doesn't exist in MinGW32...
fNonExistFile = freopen("CONOUT$", "w", stdout); // Standard error
fNonExistFile = freopen("CONOUT$", "w", stderr); // Standard out
#endif // __MINGW32__
@@ -1092,7 +1092,12 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
std::wstring welcome_str = L"Welcome to XP_Activate32 ver. " + getVersionW();
std::wcout << welcome_str << std::endl;
wchar_t buffer[64];
swprintf_s(buffer, 64, L" (%s) ", GetOSNameW().c_str());
#ifndef __MINGW32__
swprintf_s(buffer, 64, L" (%ls) ", GetOSNameW().c_str());
#else
// snwprintf is MinGW32 equivalent.
snwprintf(buffer, 64, L" (%ls) ", GetOSNameW().c_str());
#endif // __MINGW32__
std::wcout << L"Windows Version: " << GetWinVersionW() << buffer << std::endl;
if (WinVer == WIN_XP || WinVer == WIN_2003) {