mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 06:20:53 +03:00
Windows: fixed detection of Windows 11 if custom exe launcher does not specify Windows 10+ compatibility in application manifest (issue #916)
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (23, ) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
Native Libraries / Natives (macos) (push) Has been cancelled
Native Libraries / Natives (ubuntu) (push) Has been cancelled
Native Libraries / Natives (windows) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (23, ) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
Native Libraries / Natives (macos) (push) Has been cancelled
Native Libraries / Natives (ubuntu) (push) Has been cancelled
Native Libraries / Natives (windows) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
Windows binaries built and signed locally in clean workspace
This commit is contained in:
@@ -18,7 +18,8 @@ FlatLaf Change Log
|
|||||||
regression in 3.5)
|
regression in 3.5)
|
||||||
- Popup: Fixed NPE if `GraphicsConfiguration` is `null` on Windows. (issue #921)
|
- Popup: Fixed NPE if `GraphicsConfiguration` is `null` on Windows. (issue #921)
|
||||||
- Theme Editor: Fixed using color picker on secondary screen.
|
- Theme Editor: Fixed using color picker on secondary screen.
|
||||||
|
- Fixed detection of Windows 11 if custom exe launcher does not specify Windows
|
||||||
|
10+ compatibility in application manifest. (issue #916)
|
||||||
|
|
||||||
## 3.5.2
|
## 3.5.2
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -30,12 +30,26 @@ HWND getWindowHandle( JNIEnv* env, jobject window );
|
|||||||
|
|
||||||
//---- Utility ----------------------------------------------------------------
|
//---- Utility ----------------------------------------------------------------
|
||||||
|
|
||||||
|
typedef LONG (WINAPI *RtlGetVersion_Type)( OSVERSIONINFO* );
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jlong JNICALL Java_com_formdev_flatlaf_ui_FlatNativeWindowsLibrary_getOSBuildNumberImpl
|
JNIEXPORT jlong JNICALL Java_com_formdev_flatlaf_ui_FlatNativeWindowsLibrary_getOSBuildNumberImpl
|
||||||
( JNIEnv* env, jclass cls )
|
( JNIEnv* env, jclass cls )
|
||||||
{
|
{
|
||||||
OSVERSIONINFO info;
|
OSVERSIONINFO info;
|
||||||
info.dwOSVersionInfoSize = sizeof( info );
|
info.dwOSVersionInfoSize = sizeof( info );
|
||||||
|
info.dwBuildNumber = 0;
|
||||||
|
|
||||||
|
// use RtlGetVersion for the case that app manifest does not specify Windows 10+ compatibility
|
||||||
|
// https://www.codeproject.com/Articles/5336372/Windows-Version-Detection
|
||||||
|
HMODULE ntdllModule = ::GetModuleHandleA( "ntdll.dll" );
|
||||||
|
if( ntdllModule != NULL ) {
|
||||||
|
RtlGetVersion_Type pRtlGetVersion = (RtlGetVersion_Type) ::GetProcAddress( ntdllModule, "RtlGetVersion" );
|
||||||
|
if( pRtlGetVersion != NULL && pRtlGetVersion( &info ) == 0 )
|
||||||
|
return info.dwBuildNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
// fallback
|
||||||
if( !::GetVersionEx( &info ) )
|
if( !::GetVersionEx( &info ) )
|
||||||
return 0;
|
return 0;
|
||||||
return info.dwBuildNumber;
|
return info.dwBuildNumber;
|
||||||
|
|||||||
Reference in New Issue
Block a user