Expand description
Windows message box and notification module.
This crate provides utility functions for displaying native Windows message boxes and system notifications with support for auto-close timeout, multiple icon styles, and various button combinations.
§Features
- Message boxes: Native Win32 message boxes with icon and button presets, plus optional auto-close timeout.
- Standalone popup notification: A custom popup window in the bottom-right corner with live countdown display.
- Tray balloon helper: Display balloon notifications on existing system tray icons.
- C/C++ FFI: Expose
custom_msgbox_wfor direct calling from C/C++ code (requirescdylibcrate type).
§Quick Start
use win_msgbox_timeout::{
MsgBoxType, MsgBtnType, custom_msgbox, error_msgbox, info_msgbox,
quest_msgbox_yesno, warn_msgbox,
};
// Simple info dialog
info_msgbox("Hello from Rust", "Info", 0);
// Warning with 3-second auto-close
warn_msgbox("Careful!", "Warning", 3000);
// Yes/No question
let result = quest_msgbox_yesno("Do you want to continue?", "Question", 0);
if result == 6 {
info_msgbox("You clicked Yes", "Result", 0);
}§C/C++ Interop
When built with crate-type = ["cdylib"], the crate exports custom_msgbox_w
as a C-compatible function. See the custom_msgbox_w documentation for details.
Enums§
- MsgBox
Type - Icon styles for Windows message boxes.
- MsgBtn
Type - Button combinations for Windows message boxes.
- Notify
Icon Type - Icon types for system tray balloon notifications.
Functions§
- custom_
msgbox - Displays a custom Windows message box.
- custom_
msgbox_ w - Displays a custom Windows message box from C or C++ code.
- error_
msgbox - Displays an error message box.
- info_
msgbox - Displays an information message box.
- notify_
msgbox - Displays a balloon tip notification on an existing system tray icon.
- notify_
msgbox_ standalone - Displays a standalone notification window in the bottom-right corner of the screen.
- quest_
msgbox_ okcancel - Displays an OK/Cancel question dialog.
- quest_
msgbox_ yesno - Displays a Yes/No question dialog.
- wait_
notifications - Waits for all notification windows to close and cleans up their threads.
- warn_
msgbox - Displays a warning message box.
Type Aliases§
- HWND
- Window handle (
HWND). A value of0represents no window (null).