Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

win-tools

US English | RU Русский

Java 8 Native DLL PolyForm License Sponsor

A collection of Java utilities for interacting with Windows via native DLLs.

✨ Features

  • Native interactions: Direct access to Windows API via Java wrappers
  • Input control: Precise mouse manipulation (clicks, cursor positioning)
  • Keyboard control: Press individual keys and intercept global keyboard events
  • System notifications: Windows toast notifications delivery
  • Console operations: Color-formatted output
  • System operations: Shutdown/reboot + low-level functions
  • Message boxes: Alert, confirm, and prompt dialogs via native Windows dialogs
  • Static API: Utility classes with instantiation prevention
  • Native integration: Optimized pre-built DLL components

📚 Usage

WinMessageBox Class

// Simple alert dialog
WinMessageBox.alert("This is an alert message", "Alert", "OK");

// Confirmation dialog with two buttons
int result = WinMessageBox.confirm("Do you want to continue?", "Confirm", new String[]{"Yes", "No"});
if (result == 0) {
    // First button clicked
} else {
    // Second button clicked or dialog closed
}

// Prompt dialog with input field
String input = WinMessageBox.prompt("Enter your name:", "Prompt", "Default Name", new String[]{"OK", "Cancel"});
if (!input.isEmpty()) {
    // First button clicked with input
} else {
    // Second button clicked or dialog closed
}

WinMouse Class

// Left click
WinMouse.leftClick();

// Right click
WinMouse.rightClick();

// Set cursor position (X, Y)
WinMouse.setCursorPosition(100, 200);

// Get current position
Position pos = WinMouse.getCursorPosition();

WinNotifications Class

// Send notification
WinNotifications.send("Message text", "Title");

WinSystem Class

// System shutdown
WinSystem.shutdown();

// System reboot
WinSystem.reboot();

// Trigger BSoD
// Dangerous operation, use with caution!
// Requires enabling via WinTools.setDangerOpsEnabled(true)
try {
    WinSystem.bsod();
} catch (SecurityException e) {
    // Throws if dangerous operations are disabled
}

WinTerminal Class

// Basic output
WinTerminal.write("Text without newline");
WinTerminal.writeLine("Text with newline");

// Colored output
WinTerminal.write("Red text", Colors.RED);
WinTerminal.writeLine("Blue text", Colors.BLUE);

// Reset color
WinTerminal.resetColor();

// Set persistent color
WinTerminal.setColor(Colors.GREEN);

WinTools Class

// OS check
if (WinTools.isWindows()) {
    // Windows-specific logic
}

// Enable/disable dangerous operations
WinTools.setDangerOpsEnabled(false);

// Check dangerous operations status
boolean enabled = WinTools.isDangerOpsEnabled();

WinKeyboard Class

// Add a global keyboard listener
WinKeyboard.addListener(vkCode -> {
    System.out.println("Key Pressed! VK Code: " + vkCode);
    // Example: Check for INSERT key (VK 45)
    if (vkCode == 45) {
        System.out.println("INSERT pressed");
    }
});

// Remove the listener when no longer needed
// WinKeyboard.removeListener(myListener);

// Virtual key code for 'A' = 0x41
// Press 'A'
WinKeyboard.pressKeyDown(0x41);
// Release 'A'
WinKeyboard.pressKeyUp(0x41);
// Press and release 'A'
WinKeyboard.pressKey(0x41);

📥 Installation (Maven)

  1. Add the JitPack repository to your pom.xml
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
  1. Add the dependency
<dependency>
    <groupId>com.github.KvaytG</groupId>
    <artifactId>win-tools</artifactId>
    <version>-SNAPSHOT</version>
</dependency>

Optional: to use a specific version, tag a release and replace -SNAPSHOT with the tag name.

❗ Important Notes

  • Tested only on Windows 10 and Windows 11.
  • Administrator privileges are NOT required.
  • Dangerous operations are disabled by default and require explicit enabling.
  • Functions marked with @Dangerous are intended only for:
    • Security research
    • System stability testing
    • Educational purposes

🙏 Acknowledgements

Special thanks to adasdead for developing the original native DLL, which made the project possible.

📝 License

Licensed under the PolyForm Noncommercial license.

This project uses open-source components. For license details see pom.xml and dependencies' official websites.

About

A collection of Java utilities for interacting with Windows via native DLLs.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages