Microsoft.Windows.CsWin32 0.3.275
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
- Microsoft.Windows.SDK.Win32Metadata (>= 70.0.11-preview)
- Microsoft.Windows.SDK.Win32Docs (>= 0.1.42-alpha)
- Microsoft.Windows.WDK.Win32Metadata (>= 0.13.25-experimental)
.NET Standard 2.0
- Microsoft.Windows.SDK.Win32Docs (>= 0.1.42-alpha)
- Microsoft.Windows.WDK.Win32Metadata (>= 0.13.25-experimental)
- Microsoft.Windows.SDK.Win32Metadata (>= 70.0.11-preview)
.NET Standard 1.1
- Microsoft.Windows.SDK.Win32Docs (>= 0.1.42-alpha)
- Microsoft.Windows.WDK.Win32Metadata (>= 0.13.25-experimental)
- Microsoft.Windows.SDK.Win32Metadata (>= 70.0.11-preview)
.NET Framework 4.6.1
- Microsoft.Windows.SDK.Win32Docs (>= 0.1.42-alpha)
- Microsoft.Windows.SDK.Win32Metadata (>= 70.0.11-preview)
- Microsoft.Windows.WDK.Win32Metadata (>= 0.13.25-experimental)
.NET Framework 4.5
- Microsoft.Windows.SDK.Win32Docs (>= 0.1.42-alpha)
- Microsoft.Windows.WDK.Win32Metadata (>= 0.13.25-experimental)
- Microsoft.Windows.SDK.Win32Metadata (>= 70.0.11-preview)
| Version | Downloads | Last updated |
|---|---|---|
| 0.3.275 | 4 | 04/28/2026 |
| 0.3.269 | 1 | 01/30/2026 |
| 0.3.264 | 1 | 01/30/2026 |
| 0.3.259 | 1 | 05/23/2026 |
| 0.3.257 | 0 | 11/25/2025 |
| 0.3.253 | 2 | 05/27/2026 |
| 0.3.252 | 1 | 01/30/2026 |
| 0.3.250 | 0 | 11/20/2025 |
| 0.3.248 | 1 | 12/10/2025 |
| 0.3.242 | 1 | 01/31/2026 |
| 0.3.238 | 1 | 01/31/2026 |
| 0.3.236 | 0 | 10/30/2025 |
| 0.3.235 | 1 | 01/31/2026 |
| 0.3.228 | 1 | 01/04/2026 |
| 0.3.217 | 1 | 01/30/2026 |
| 0.3.213 | 2 | 04/24/2026 |
| 0.3.205 | 1 | 05/23/2026 |
| 0.3.183 | 0 | 02/08/2025 |
| 0.3.162 | 2 | 05/27/2026 |
| 0.3.106 | 1 | 12/10/2025 |
| 0.3.49-beta | 2 | 05/18/2026 |
| 0.3.46-beta | 2 | 05/12/2026 |
| 0.3.18-beta | 0 | 06/28/2023 |
| 0.3.2-beta | 1 | 01/30/2026 |
| 0.2.252-beta | 1 | 01/05/2026 |
| 0.2.229-beta | 1 | 01/05/2026 |
| 0.2.206-beta | 1 | 01/05/2026 |
| 0.2.188-beta | 0 | 01/23/2023 |
| 0.2.164-beta | 0 | 12/09/2022 |
| 0.2.162-beta | 3 | 05/19/2026 |
| 0.2.158-beta | 2 | 04/30/2026 |
| 0.2.138-beta | 1 | 01/31/2026 |
| 0.2.104-beta | 1 | 01/31/2026 |
| 0.2.63-beta | 1 | 01/30/2026 |
| 0.2.46-beta | 1 | 01/31/2026 |
| 0.2.10-beta | 0 | 07/12/2022 |
| 0.2.1-beta | 2 | 05/12/2026 |
| 0.1.691-beta | 1 | 05/23/2026 |
| 0.1.689-beta | 0 | 05/19/2022 |
| 0.1.647-beta | 1 | 01/30/2026 |
| 0.1.646-beta | 0 | 04/25/2022 |
| 0.1.635-beta | 0 | 01/27/2022 |
| 0.1.619-beta | 1 | 01/30/2026 |
| 0.1.588-beta | 0 | 09/20/2021 |
| 0.1.584-beta | 3 | 01/30/2026 |
| 0.1.560-beta | 0 | 09/08/2021 |
| 0.1.506-beta | 0 | 06/28/2021 |
| 0.1.422-beta | 3 | 01/31/2026 |
| 0.1.378-beta | 0 | 02/24/2021 |
| 0.1.319-beta | 2 | 05/23/2026 |