Additional.NET-Windows.API
1.0.0
dotnet add package Additional.NET-Windows.API --version 1.0.0
NuGet\Install-Package Additional.NET-Windows.API -Version 1.0.0
<PackageReference Include="Additional.NET-Windows.API" Version="1.0.0" />
<PackageVersion Include="Additional.NET-Windows.API" Version="1.0.0" />
<PackageReference Include="Additional.NET-Windows.API" />
paket add Additional.NET-Windows.API --version 1.0.0
#r "nuget: Additional.NET-Windows.API, 1.0.0"
#:package Additional.NET-Windows.API@1.0.0
#addin nuget:?package=Additional.NET-Windows.API&version=1.0.0
#tool nuget:?package=Additional.NET-Windows.API&version=1.0.0
Why is there Windows.API as Nuget package?
Windows.API was originally part of another framework, but after making minor adjustments, I was able to remove all dependencies. And that's when I had the idea to make it available as a Nuget package.
What is Windows.API
Windows.API is a C# .NET wrapper for native Windows API functions.
Namespace overview
Windows.API
The root namespace (Windows.API) contains static classes with the respective functions for the respective Windows DLLs. In individual cases, a function may have overloads if, for example, it can be called with different parameter types.
Windows.API.Constants
The Windows.API.Constants namespace defines a manageable set of constants in a single class that are required for some of the functions, mainly those used to control Windows services.
Windows.API.Enumerations
The Windows.API.Enumerations namespace contains individual files for each enumeration group. The best known of these is probably WindowsMessage, which contains the values for the individual Windows messages.
Windows.API.Structures
The Windows.API.Structures namespace contains class and structure definitions that are required for exchanging more complex data structures via Windows functions.
Windows.API.Helper
The Windows.API.Helper namespace contains classes that are used to control more complex processes via the Windows API, such as system-wide mouse or keyboard hooks, (un)installation of Windows services, or monitoring for new or changed windows.
Windows.API.Exceptions
The Windows.API.Exceptions namespace contains the extended exception classes for the above-mentioned helper classes.
Examples of use
Keyboard
Check, if control key is pressed
Windows.Api.Helper.Keyboard.Instance.IsKeyPressed(Windows.Api.Enumerations.VirtualKeyStates.Control)
Mouse
Get mouse button states
Windows.Api.Helper.Mouse.Instance.GetMouseButtonState()
NotifyIcon
Comming soon
Windows
Inform on new or changed windows
var listener = new WindowsEventListener(); listener.WindowChanged += WindowChangedHandler;
private void WindowChangedHandler(object sender, WindowsEventArgs e) { if (e is WindowsExEventArgs exEventArgs) Console.WriteLine("New active window has title " + exEventArgs.Title); else Console.WriteLine("New active window has id " + e.HWnd); }
More coming soon
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 200 | 9/25/2025 |