-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1045 from microsoft/readme
Add package README specifically for nuget.org
- Loading branch information
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 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 | ||
```cs | ||
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](https://github.com/microsoft/CsWin32#readme). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters