mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-16 00:37:11 -06:00
Merge pull request #267 from native-window-decorations
Native window decorations for Windows 10 (using JNI)
This commit is contained in:
10
flatlaf-natives/flatlaf-natives-jna/README.md
Normal file
10
flatlaf-natives/flatlaf-natives-jna/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
FlatLaf Natives using JNA
|
||||
=========================
|
||||
|
||||
This sub-project contains source code that uses
|
||||
[JNA](https://github.com/java-native-access/jna) to access native operating
|
||||
system API.
|
||||
|
||||
**Note:** Code in this sub-project is **not used** in FlatLaf libraries. It was
|
||||
used to develop/test usage of some native operating system API in Java (with the
|
||||
help of JNA) and was then converted to C++.
|
||||
@@ -207,20 +207,20 @@ public class FlatWindowsNativeWindowBorder
|
||||
|
||||
String subKey = "SOFTWARE\\Microsoft\\Windows\\DWM";
|
||||
|
||||
int value = RegGetDword( HKEY_CURRENT_USER, subKey, "ColorPrevalence" );
|
||||
int value = registryGetIntValue( subKey, "ColorPrevalence", -1 );
|
||||
colorizationColorAffectsBorders = (value > 0);
|
||||
|
||||
value = RegGetDword( HKEY_CURRENT_USER, subKey, "ColorizationColor" );
|
||||
value = registryGetIntValue( subKey, "ColorizationColor", -1 );
|
||||
colorizationColor = (value != -1) ? new Color( value ) : null;
|
||||
|
||||
colorizationColorBalance = RegGetDword( HKEY_CURRENT_USER, subKey, "ColorizationColorBalance" );
|
||||
colorizationColorBalance = registryGetIntValue( subKey, "ColorizationColorBalance", -1 );
|
||||
}
|
||||
|
||||
private static int RegGetDword( HKEY hkey, String lpSubKey, String lpValue ) {
|
||||
private static int registryGetIntValue( String key, String valueName, int defaultValue ) {
|
||||
try {
|
||||
return Advapi32Util.registryGetIntValue( hkey, lpSubKey, lpValue );
|
||||
return Advapi32Util.registryGetIntValue( HKEY_CURRENT_USER, key, valueName );
|
||||
} catch( RuntimeException ex ) {
|
||||
return -1;
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user