Class NativeUtilities
java.lang.Object
net.yetihafen.javafx.customcaption.internal.NativeUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
customizeCation
(javafx.stage.Stage stage, javafx.scene.paint.Color color) sets the caption to the specified color if supported if not supported uses immersive dark mode if color is mostly darkstatic com.sun.jna.platform.win32.WinDef.HWND
getHwnd
(javafx.stage.Stage stage) *should* return the HWND for the Specified Stage might not, because JavaFX ist stupid and has no way to do thisstatic int
getResizeHandleHeight
(com.sun.jna.platform.win32.WinDef.HWND hWnd) static boolean
isMaximized
(com.sun.jna.platform.win32.WinDef.HWND hWnd) static boolean
setBorderColor
(javafx.stage.Stage stage, javafx.scene.paint.Color color) static boolean
setCaptionColor
(javafx.stage.Stage stage, javafx.scene.paint.Color color) Sets the Caption Color of the specified Stage to the specified Color this does only work since Win 11 Build 22000static boolean
setImmersiveDarkMode
(javafx.stage.Stage stage, boolean enabled) Enables/disables the Immersive Dark Mode for a specified stage officially only supported (documented) since Win 11 Build 22000
-
Constructor Details
-
NativeUtilities
public NativeUtilities()
-
-
Method Details
-
getHwnd
public static com.sun.jna.platform.win32.WinDef.HWND getHwnd(javafx.stage.Stage stage) *should* return the HWND for the Specified Stage might not, because JavaFX ist stupid and has no way to do this- Parameters:
stage
- the Stage- Returns:
- hopefully the HWND for the correct stage
-
setImmersiveDarkMode
public static boolean setImmersiveDarkMode(javafx.stage.Stage stage, boolean enabled) Enables/disables the Immersive Dark Mode for a specified stage officially only supported (documented) since Win 11 Build 22000- Parameters:
stage
- the stage to enable the Dark mode forenabled
- if immersive dark mod should be enabled- Returns:
- if Immersive Dark Mode could be enabled successfully
-
setCaptionColor
public static boolean setCaptionColor(javafx.stage.Stage stage, javafx.scene.paint.Color color) Sets the Caption Color of the specified Stage to the specified Color this does only work since Win 11 Build 22000- Parameters:
stage
- the Stage to change the Caption Colorcolor
- the Color to use- Returns:
- if the change was successful
-
customizeCation
public static boolean customizeCation(javafx.stage.Stage stage, javafx.scene.paint.Color color) sets the caption to the specified color if supported if not supported uses immersive dark mode if color is mostly dark- Parameters:
stage
- the stage to modifycolor
- the color to set the caption- Returns:
- if the stage was modified
-
setBorderColor
public static boolean setBorderColor(javafx.stage.Stage stage, javafx.scene.paint.Color color) -
isMaximized
public static boolean isMaximized(com.sun.jna.platform.win32.WinDef.HWND hWnd) -
getResizeHandleHeight
public static int getResizeHandleHeight(com.sun.jna.platform.win32.WinDef.HWND hWnd)
-