🚀 WinDll 0.1.0
🔥 What is WinDll?
WinDll is a lightweight Python wrapper around Windows' native user32.dll and kernel32.dll APIs designed to simplify common Windows system tasks such as window management, keyboard/mouse input simulation, process management, and system control.
This library allows Python developers to automate and control Windows OS functions easily without external dependencies, using only ctypes.
🛠 Features
- 🖥️ Window management (find, move, resize, show/hide, set foreground)
- ⌨️ Keyboard input simulation (
SendInputwrapper) - 🖱️ Mouse input simulation (move cursor, click)
- 🔒 Block and unblock user input (
BlockInput) - 🧑💼 Check if script runs with admin privileges
- ❌ Kill processes by executable name (pure ctypes implementation)
- 🚪 Lock workstation or reboot system
📚 Installation
pip install windll-python
💡 Usage Examples
Initialization
from WinDll import User32DLL, Kernel32DLL
winapi = User32DLL()
#or
winapi = Kernel32DLL
Window Operations - USER32
# Close a window by title
result = winapi.DestroyWindow("Untitled - Notepad")
print("Closed successfully" if result else "Window not found")
# Show or hide a window
winapi.WindowsCall(WindowName="Untitled - Notepad", SetShow=True, SHOW=True) # Show window
winapi.WindowsCall(WindowName="Untitled - Notepad", SetShow=True, SHOW=False) # Hide window
# Set window to foreground
winapi.WindowsCall(WindowName="Untitled - Notepad", SetForeGround=True)
# Move and resize window
winapi.WindowsCall(WindowName="Untitled - Notepad", SetRes=True, ResX=800, ResY=600)
winapi.WindowsCall(WindowName="Untitled - Notepad", SetPlace=True, MoveX=100, MoveY=100)
# Rename Window
winapi.WindowsCall(WindowName="Untitled - Notepad", SetName = True, NewName = "Test - Notepad")
Keyboard Simulation - USER32
# Press and release 'A' key quickly
winapi.KeyboardCall(SetPress=True, SetPressKey=winapi.VK_A)
# Press 'A' key for 2 seconds
winapi.KeyboardCall(SetPress=True, SetPressTime=2.0, SetPressKey=winapi.VK_A)
Mouse Simulation - USER32
# Move cursor to (500, 500)
winapi.CursorCall(SetPos=True, SetPosX=500, SetPosY=500)
# Get current cursor position
pos = winapi.CursorCall(GetPos=True)
print(pos) # Output: X:xxx Y:yyy
# Left click
winapi.CursorCall(ClickEvent=winapi.LEFT)
# Right click
winapi.CursorCall(ClickEvent=winapi.RIGHT)
Blocking User Input - USER32
# Block mouse and keyboard input for 5 seconds
winapi.WindowCall(SetBlock=True, SetBlockTime=5)
# Unblock input manually
winapi.WindowCall(BrokeSetBlock=True)
Process Management - KERNEL32
# Kill all notepad.exe processes
winapi.KernelCall(process=wina.kernel_PROCESSEXECUTE, ProcessPath="notepad.exe")
# Start Process
winapi.KernelCall(process=wina.kernel_PROCESSCREATE, ProcessPath="path")
Check Admin Rights - USER32
if winapi.WindowsKernelAdminIS():
print("Running as administrator")
else:
print("Not running as administrator")
📝 License
This project is licensed under the MIT License.
🙋 Author
CSDC-K VV
⭐ Contributions Welcome!
Feel free to open issues or submit pull requests.
📌 Disclaimer
Use with caution. Some functions (e.g., TerminateProcess, BlockInput) affect system stability or user control.
Enjoy coding with WinDll! 🚀
Metadata
Release files for windll-python 0.1.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| windll_python-0.1.0.post1.tar.gz | 8.6 kB | Without provenance | Details for windll_python-0.1.0.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| windll_python-0.1.0.post1-py3-none-any.whl | Python 3 | none | any | Details for windll_python-0.1.0.post1-py3-none-any.whl |
Total release size: 16.1 kB
Release files / windll_python-0.1.0.post1.tar.gz
| Download URL | windll_python-0.1.0.post1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3908faa02bae67fbbdb321eb796d9705a25c4911962903fde804049a2c416b72
|
|
BLAKE2b-256 checksum How to use checksums |
51fed03e7e6c84af1c779dc4bbbd739ad9a3f684bfa2b8e83f966e86435600d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / windll_python-0.1.0.post1-py3-none-any.whl
| Download URL | windll_python-0.1.0.post1-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
586b106787bd1b4e228241dc44a8cfd1751408a55e6ccf9386abf06a06917a0f
|
|
BLAKE2b-256 checksum How to use checksums |
685820d8de79ce519832d5d12a670b9abe7f1ce70d96dfdbbd734421a4c00223
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for windll-python 0.1.0.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.