java.lang.Object
net.yetihafen.javafx.customcaption.internal.NativeUtilities

public class NativeUtilities extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    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
    static 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 22000
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 for
      enabled - 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 Color
      color - 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 modify
      color - 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)