Microsoft.Windows.CsWin32 0.3.367

Automated generation of C# bindings for the Win32 API

Get immediate access to the full Win32 API from C#, just by naming the APIs you require. Generated APIs will be accurate for your CPU architecture and target Windows version. All APIs are generated directly into your project, allowing you to ship without any additional runtime dependencies.

Reach functionality that .NET doesn't expose via the Base Class Library (BCL) to give your library or application that feature that really sets it apart.

Install this package, then create a NativeMethods.txt file with a list of any APIs you need for example:

NativeMethods.txt:

CreateFile
IUIRibbon
S_OK
NTSTATUS
IsPwrHibernateAllowed
ISpellChecker

Any supporting APIs (e.g. enums, structs) are automatically generated when they are required by what you've directly asked for.

Call extern methods through the PInvoke class

using SafeHandle f = PInvoke.CreateFile(
    "some.txt",
    (uint)GENERIC_ACCESS_RIGHTS.GENERIC_READ,
    FILE_SHARE_MODE.FILE_SHARE_READ,
    lpSecurityAttributes: null,
    FILE_CREATION_DISPOSITION.CREATE_ALWAYS,
    FILE_FLAGS_AND_ATTRIBUTES.FILE_ATTRIBUTE_NORMAL,
    hTemplateFile: null);

Learn more from our README on GitHub.

No packages depend on Microsoft.Windows.CsWin32.

.NET Framework 2.0

.NET Framework 4.5

.NET Framework 4.6.1

.NET Standard 1.1

.NET Standard 2.0

Version Downloads Last updated
0.3.367 9 10/22/2026
0.3.366 17 10/20/2026
0.3.363 12 10/14/2026
0.3.360 12 10/09/2026
0.3.358 9 10/08/2026
0.3.355 24 10/07/2026
0.3.347 12 10/06/2026
0.3.346 15 10/05/2026
0.3.335 14 10/02/2026
0.3.333 16 10/02/2026
0.3.330 12 10/02/2026
0.3.321 16 10/02/2026
0.3.298 13 10/02/2026
0.3.296 16 10/02/2026
0.3.287 26 10/02/2026
0.3.275 13 10/02/2026
0.3.269 12 10/02/2026
0.3.264 13 10/02/2026
0.3.259 12 10/04/2026
0.3.257 13 10/02/2026
0.3.253 12 10/02/2026
0.3.252 26 10/02/2026
0.3.250 15 10/02/2026
0.3.248 25 10/02/2026
0.3.242 14 10/02/2026
0.3.238 19 10/02/2026
0.3.236 12 10/02/2026
0.3.235 20 10/02/2026
0.3.228 27 10/02/2026
0.3.217 15 10/02/2026
0.3.213 15 10/02/2026
0.3.205 16 10/02/2026
0.3.183 14 10/01/2026
0.3.162 11 10/02/2026
0.3.106 12 10/02/2026
0.3.49-beta 13 10/02/2026
0.3.46-beta 14 10/02/2026
0.3.18-beta 10 10/02/2026
0.3.2-beta 15 10/02/2026
0.2.252-beta 12 10/02/2026
0.2.229-beta 11 10/02/2026
0.2.206-beta 13 10/02/2026
0.2.188-beta 16 10/02/2026
0.2.164-beta 17 10/02/2026
0.2.162-beta 14 10/02/2026
0.2.158-beta 13 10/02/2026
0.2.138-beta 14 10/02/2026
0.2.104-beta 14 10/02/2026
0.2.63-beta 13 10/02/2026
0.2.46-beta 11 10/02/2026
0.2.10-beta 12 10/02/2026
0.2.1-beta 13 10/02/2026
0.1.691-beta 12 10/02/2026
0.1.689-beta 10 10/02/2026
0.1.647-beta 11 10/02/2026
0.1.646-beta 14 10/02/2026
0.1.635-beta 12 10/02/2026
0.1.619-beta 12 10/02/2026
0.1.588-beta 16 10/02/2026
0.1.584-beta 11 10/02/2026
0.1.560-beta 12 10/02/2026
0.1.506-beta 13 10/02/2026
0.1.422-beta 27 10/02/2026
0.1.378-beta 14 10/02/2026
0.1.319-beta 11 10/06/2026