1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
use crate::;
/// Icon types for system tray balloon notifications.
///
/// These correspond to the `dwInfoFlags` parameter in `NOTIFYICONDATAW`.
/// Currently, only `Info` is used; `Warning` and `Error` are reserved for
/// future use.
/// Displays a balloon tip notification on an existing system tray icon.
///
/// This function uses `Shell_NotifyIconW` with `NIM_MODIFY` to show a balloon
/// notification on a tray icon that has already been added to the system tray.
/// The notification title is set to the crate name (`CARGO_PKG_NAME`).
///
/// # Parameters
///
/// - `hwnd`: Handle to the window that owns the tray icon.
/// - `msg`: The notification message text. Maximum 255 characters; longer text
/// will be silently truncated.
/// - `icon_id`: The unique identifier (`uID`) of the existing tray icon on which
/// to display the balloon notification.
///
/// # Returns
///
/// - Non-zero value on success.
/// - `0` on failure (e.g., if the tray icon with the specified `icon_id` does
/// not exist or the notification could not be displayed).
///
/// # Prerequisites
///
/// The tray icon identified by `icon_id` must have been previously added using
/// `Shell_NotifyIconW` with `NIM_ADD`. If the icon does not exist, this function
/// will fail silently.
///
/// # Limitations
///
/// - The notification title is limited to 63 characters (truncated if longer).
/// - The notification body is limited to 255 characters (truncated if longer).
/// - Balloon tips may not be displayed on newer Windows versions (8+) if the
/// tray icon was not configured with `NIF_INFO` during creation.
///
/// # Example
///
/// ```ignore
/// // Assuming a tray icon with ID 1 has been added to the system tray
/// let result = notify_msgbox(hwnd, "Operation completed successfully", 1);
/// if result == 0 {
/// eprintln!("Failed to show notification");
/// }
/// ```