add last corrections for MinGW bugs
This commit is contained in:
@@ -32,6 +32,12 @@
|
||||
#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
|
||||
#endif // IDC_STATIC
|
||||
|
||||
+4
-4
@@ -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
@@ -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
@@ -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_
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user