https://github.com/crossbowerbt/newlispwin32api
Direct use of Win32 API from Newlisp (to create native GUIs and more...)
https://github.com/crossbowerbt/newlispwin32api
gdi32 newlisp newlisp-lang newlisp-language newlisp-library user32 user32dll win32 win32api windows
Last synced: 6 months ago
JSON representation
Direct use of Win32 API from Newlisp (to create native GUIs and more...)
- Host: GitHub
- URL: https://github.com/crossbowerbt/newlispwin32api
- Owner: crossbowerbt
- Created: 2025-03-10T18:11:10.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-03-10T18:37:13.000Z (10 months ago)
- Last Synced: 2025-03-10T19:28:53.561Z (10 months ago)
- Topics: gdi32, newlisp, newlisp-lang, newlisp-language, newlisp-library, user32, user32dll, win32, win32api, windows
- Language: C
- Homepage:
- Size: 633 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NewlispWin32Api
Direct use of **Win32 API** from **newlisp** (to create native GUIs and more...)
---
This project imports into the newlisp context `WIN32` the mappings for the Win32 native APIs, i.e. the functions and enumerations contained in the **gdi32.dll**, **user32.dll** and other DLLs of windows. You can find the bindings in the files under are cointained under [Win32HeadersNewlisp](Win32HeadersNewlisp).
To use the library is very simple, here is the example cointained in [MessageBox.nl](MessageBox.nl):
```newlisp
#!/bin/newlisp
(change-dir "Win32HeadersNewlisp")
(load "builtin.nl")
(load "main.nl")
(context 'WIN32)
(setq result
(MessageBoxA 0
"This is the text of the message box\non multiple lines."
"Title of Message Box"
(| MB_YESNOCANCEL MB_ICONQUESTION)))
(print "Result: " result)
(exit)
```
You just need to import the main library files, change context and call the native windows APIs.
## Examples
I've included some example inspired from the book **Programming Windows** by **Charles Petzold** (1998) in the main project directory.
The examples can be simple executed with:
```
newlisp.exe Example.nl
```
Simple **CreateWindow** example [CreateWindow.nl](CreateWindow.nl):

A **MessageBox** example [MessageBox.nl](MessageBox.nl):

A window that displays all the **SystemMetrics** [DisplayAllSystemMetrics.nl](DisplayAllSystemMetrics.nl):

## TODO
* Finish to import the multimedia APIs and the 3D ones
* Add more examples
* Test more