example/README.md
The package includes a variety of examples in the examples subdirectory,
showcasing different aspects of invoking Windows APIs.
These examples cover:
- Invoking C-style APIs, including creating structs and managing memory
- Building classic (Win32) desktop UIs
- Using callback functions with Win32 APIs
- Invoking COM classes (both
IUnknown and IDispatch interface types)
- Integrating Windows code with Flutter
For practical examples of using package:win32 in real-world applications,
visit pub.dev to explore packages that depend on it.
| Example |
Description |
| manifest |
Demonstrates the use of app manifests for compiled apps |
| service_manager_cli |
Demonstrates managing Windows services |
| credentials.dart |
Adds a credential to the store and retrieves it |
| dump.dart |
Use debugger libraries to print DLL exported functions |
| dynamic_load.dart |
Demonstrate loading a DLL and calling it at runtime |
| fileinfo.dart |
Shows how to get file information using GetFileAttributesEx |
| filever.dart |
Getting file version information from the file resource |
| modules.dart |
Enumerates all loaded modules on the current system |
| pipe.dart |
Shows use of named pipes for interprocess communication |
| registry.dart |
Demonstrates querying the registry for values |
| vt.dart |
Shows virtual terminal sequences |
| wsl.dart |
Retrieve information from a WSL instance through APIs |
Accessing local hardware and devices #
| Example |
Description |
| notepad |
Lightweight replica of the Windows notepad applet |
| tetris |
Port of an open-source Tetris game to Dart |
| hello.dart |
Basic Petzoldian "hello world" Win32 app |
| msgbox.dart |
Demonstrates a MessageBox from the console |
| commdlg.dart |
Demonstrates using the color chooser common dialog box |
| customtitlebar.dart |
Demonstrates creation of owner-draw title bar region |
| customwin.dart |
Displays a non-rectangular window |
| dialogbox.dart |
Create a custom dialog box in code |
| dialogshow.dart |
Creates a common item dialog (file picker) using COM |
| paint.dart |
Demonstrates simple GDI drawing and min/max window sizing |
| scroll.dart |
Example of horizontal and vertical scrolling text window |
| sendinput.dart |
Sends keyboard and mouse input to another window |
| snake.dart |
Snake game using various GDI features |
| taskdialog.dart |
Demonstrates using modern task dialog boxes |
| usb_drive.dart |
Monitors USB drive insertion and removal events |
| window.dart |
Enumerates open windows and basic window manipulation |
| Example |
Description |
| events.dart |
Queries for events from a specific channel |
| Example |
Description |
| com_context.dart |
Shows interaction of Dart isolates and COM apartments |
| com_demo.dart |
Demonstrates COM object creation, casting, and calling methods |
| dispatcher.dart |
Demonstrates calling methods on COM automation objects with Dispatcher |
| com_interop |
Demonstrates accessing .NET components through COM interop |
| guid.dart |
Creates a globally unique identifier (GUID) |
| uiautomation.dart |
Demonstrates calling Windows UI Automation APIs |
| winhttp.dart |
Demonstrates using WinHTTP APIs to make HTTP requests |
| wmi_perf.dart |
Uses WMI to retrieve performance counters |
| wmi_wql.dart |
Uses WMI to retrieve information using WQL |
| Example |
Description |
| explorer |
Demonstrates calling Win32 file picker APIs |
| task_manager |
Demonstrates managing running processes |