https://github.com/mjblack/win32cr
Crystal library for Win32 API
https://github.com/mjblack/win32cr
crystal crystal-lang crystal-language crystal-shard win32 win32api windows
Last synced: 5 months ago
JSON representation
Crystal library for Win32 API
- Host: GitHub
- URL: https://github.com/mjblack/win32cr
- Owner: mjblack
- License: mit
- Created: 2023-05-22T03:32:20.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-11T13:54:18.000Z (about 1 year ago)
- Last Synced: 2025-03-31T00:03:53.277Z (12 months ago)
- Topics: crystal, crystal-lang, crystal-language, crystal-shard, win32, win32api, windows
- Language: Crystal
- Homepage:
- Size: 20.2 MB
- Stars: 17
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - win32cr - Bindings for Win32 API (C bindings)
README
# win32cr
[](https://github.com/mjblack/win32cr/actions/workflows/crystal.yml) [](https://github.com/mjblack/win32cr/actions/workflows/crystal_latest.yml)
Win32 library bindings generated by [mjblack/winmd](https://github.com/mjblack/winmd) using [marlersoft/win32json](https://github.com/marlersoft/win32json).
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
win32cr:
github: mjblack/win32cr
```
Build WinMD by executing the script `build.ps1` in the location where the shard `win32cr` is installed.
```
C:\Projects\SomeCrystalApp\lib\win32cr> & .\build.ps1
```
## Usage
For more examples, please see the [examples](https://github.com/mjblack/win32cr/tree/master/examples) directory.
```crystal
require "win32cr"
require "win32cr/ui/windows_and_messaging"
alias WM = Win32cr::UI::WindowsAndMessaging # Simplifies code
WM.messageBoxW(Pointer(Void).null, pwstr("Message Box Body"), pwstr("Title"), WM::MESSAGEBOX_STYLE::MB_OK)
```
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Matthew J. Black](https://github.com/mjblack) - creator and maintainer