Top Inners Constructors Methods
com.pixelduke.window

public Class Win11ThemeWindowManager

extends Object
implements ThemeWindowManager
Class Inheritance
All Implemented Interfaces
com.pixelduke.window.ThemeWindowManager
Imports
com.sun.jna.platform.win32.WinDef, impl.com.pixelduke.window.win32.windows11.*, javafx.scene.paint.Color, javafx.stage.Window

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static enum

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private int
doubleTo8Bit(final double number)

public void
public void
public void
setWindowBorderColor(Window window, Color color)

BELOW STILL NOT WORKING public void setWindowIconVisible(Stage window, boolean isVisible) { NativeLong windowStyle = new NativeLong(0x00000001L); // User32Support.INSTANCE.SetWindowLongPtrA( // WindowUtils.getNativeHandleOfStage(window), // GWL_EXSTYLE, // windowStyle // ); BaseTSD.LONG_PTR style = User32.INSTANCE.GetWindowLongPtr(WindowUtils.getNativeHandleOfStage(window), GWL_EXSTYLE); Pointer pointer = new WinDef.LONGByReference(new WinDef.LONG(0x00000001L)).getPointer(); User32.INSTANCE.SetWindowLongPtr( WindowUtils.getNativeHandleOfStage(window), GWL_EXSTYLE, pointer); User32.INSTANCE.SetWindowPos(WindowUtils.getNativeHandleOfStage(window), null, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER); window.setResizable(true); }

public void
setWindowCornerPreference(Window
the window which you want to change
window
,
Win11ThemeWindowManager.CornerPreference
the corner preference of the window
cornerPreference
)

Sets the "roundness" of the corners of the window according to the passed in CornerPreference.

public void
public void
private int
toRGBInt(final Color color)

BELOW STILL NOT WORKING public void setWindowBackdrop(Dialog dialog, Backdrop backdrop) { Stage dialogStage = (Stage) dialog.getDialogPane().getScene().getWindow(); String tempTitle = "XYUZADCSD"; String dialogTitle = dialogStage.getTitle(); dialogStage.setTitle(tempTitle); WinDef.HWND hWnd = User32.INSTANCE.FindWindow(null, tempTitle); dialogStage.setTitle(dialogTitle); switch (backdrop) { case NONE -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.NONE.getValue())), WinDef.DWORD.SIZE ); case MICA -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.MICA.getValue())), WinDef.DWORD.SIZE ); case MICA_ALT -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.MICA_ALT.getValue())), WinDef.DWORD.SIZE ); case ACRYLIC -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.ACRYLIC.getValue())), WinDef.DWORD.SIZE ); } DWM.setWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE.getValue(), true ); }

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Win11ThemeWindowManagerback to summary
public Win11ThemeWindowManager()

Method Detail

doubleTo8Bitback to summary
private int doubleTo8Bit(final double number)
setDarkModeForWindowFrameback to summary
public void setDarkModeForWindowFrame(Window window, boolean darkMode)

Implements com.pixelduke.window.ThemeWindowManager.setDarkModeForWindowFrame.

setWindowBackdropback to summary
public void setWindowBackdrop(Window window, Win11ThemeWindowManager.Backdrop backdrop)
setWindowBorderColorback to summary
public void setWindowBorderColor(Window window, Color color)

BELOW STILL NOT WORKING public void setWindowIconVisible(Stage window, boolean isVisible) { NativeLong windowStyle = new NativeLong(0x00000001L); // User32Support.INSTANCE.SetWindowLongPtrA( // WindowUtils.getNativeHandleOfStage(window), // GWL_EXSTYLE, // windowStyle // ); BaseTSD.LONG_PTR style = User32.INSTANCE.GetWindowLongPtr(WindowUtils.getNativeHandleOfStage(window), GWL_EXSTYLE); Pointer pointer = new WinDef.LONGByReference(new WinDef.LONG(0x00000001L)).getPointer(); User32.INSTANCE.SetWindowLongPtr( WindowUtils.getNativeHandleOfStage(window), GWL_EXSTYLE, pointer); User32.INSTANCE.SetWindowPos(WindowUtils.getNativeHandleOfStage(window), null, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER); window.setResizable(true); }

setWindowCornerPreferenceback to summary
public void setWindowCornerPreference(Window window, Win11ThemeWindowManager.CornerPreference cornerPreference)

Sets the "roundness" of the corners of the window according to the passed in CornerPreference. Setting the corners of a transparent or undecorated Stage to be round will also make it display native window decorations (drop shadows, etc).

Parameters
window:Window

the window which you want to change

cornerPreference:Win11ThemeWindowManager.CornerPreference

the corner preference of the window

setWindowFrameColorback to summary
public void setWindowFrameColor(Window window, Color color)
setWindowTextColorback to summary
public void setWindowTextColor(Window window, Color color)
toRGBIntback to summary
private int toRGBInt(final Color color)

BELOW STILL NOT WORKING public void setWindowBackdrop(Dialog dialog, Backdrop backdrop) { Stage dialogStage = (Stage) dialog.getDialogPane().getScene().getWindow(); String tempTitle = "XYUZADCSD"; String dialogTitle = dialogStage.getTitle(); dialogStage.setTitle(tempTitle); WinDef.HWND hWnd = User32.INSTANCE.FindWindow(null, tempTitle); dialogStage.setTitle(dialogTitle); switch (backdrop) { case NONE -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.NONE.getValue())), WinDef.DWORD.SIZE ); case MICA -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.MICA.getValue())), WinDef.DWORD.SIZE ); case MICA_ALT -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.MICA_ALT.getValue())), WinDef.DWORD.SIZE ); case ACRYLIC -> DwmSupport.INSTANCE.DwmSetWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE.getValue(), new WinDef.DWORDByReference(new WinDef.DWORD(DWM_SYSTEMBACKDROP_TYPE.ACRYLIC.getValue())), WinDef.DWORD.SIZE ); } DWM.setWindowAttribute( hWnd, DWMA_WINDOW_ATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE.getValue(), true ); }

com.pixelduke.window back to summary

public final Enum Win11ThemeWindowManager.Backdrop

extends Enum<Win11ThemeWindowManager.Backdrop>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Win11ThemeWindowManager.Backdrop
public static final Win11ThemeWindowManager.Backdrop
public static final Win11ThemeWindowManager.Backdrop
public static final Win11ThemeWindowManager.Backdrop

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Win11ThemeWindowManager.Backdrop
public static Win11ThemeWindowManager.Backdrop[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ACRYLICback to summary
public static final Win11ThemeWindowManager.Backdrop ACRYLIC
MICAback to summary
public static final Win11ThemeWindowManager.Backdrop MICA
MICA_ALTback to summary
public static final Win11ThemeWindowManager.Backdrop MICA_ALT
NONEback to summary
public static final Win11ThemeWindowManager.Backdrop NONE

Constructor Detail

Backdropback to summary
private Backdrop()

Method Detail

valueOfback to summary
public static Win11ThemeWindowManager.Backdrop valueOf(String name)
valuesback to summary
public static Win11ThemeWindowManager.Backdrop[] values()
com.pixelduke.window back to summary

public final Enum Win11ThemeWindowManager.CornerPreference

extends Enum<Win11ThemeWindowManager.CornerPreference>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Win11ThemeWindowManager.CornerPreference
public static final Win11ThemeWindowManager.CornerPreference
public static final Win11ThemeWindowManager.CornerPreference

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Win11ThemeWindowManager.CornerPreference
public static Win11ThemeWindowManager.CornerPreference[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

RECTANGULARback to summary
public static final Win11ThemeWindowManager.CornerPreference RECTANGULAR
ROUNDback to summary
public static final Win11ThemeWindowManager.CornerPreference ROUND
ROUND_SMALLback to summary
public static final Win11ThemeWindowManager.CornerPreference ROUND_SMALL

Constructor Detail

CornerPreferenceback to summary
private CornerPreference()

Method Detail

valueOfback to summary
public static Win11ThemeWindowManager.CornerPreference valueOf(String name)
valuesback to summary
public static Win11ThemeWindowManager.CornerPreference[] values()