@@ -62,21 +62,79 @@ typedef enum _WNT_AudioOption {
6262 WNT_AUDIO_LOOP = 2
6363} WNT_AudioOption ;
6464
65+ /**
66+ * Selects which Windows system notification sound to play.
67+ * WNT_AUDIO_FILE_NONE (-1) means no specific sound file override (use AudioOption behaviour).
68+ * Values 0-25 map directly to WinToastTemplate::AudioSystemFile.
69+ */
70+ typedef enum _WNT_AudioFile {
71+ WNT_AUDIO_FILE_NONE = -1 ,
72+ WNT_AUDIO_FILE_DEFAULT = 0 ,
73+ WNT_AUDIO_FILE_IM = 1 ,
74+ WNT_AUDIO_FILE_MAIL = 2 ,
75+ WNT_AUDIO_FILE_REMINDER = 3 ,
76+ WNT_AUDIO_FILE_SMS = 4 ,
77+ WNT_AUDIO_FILE_ALARM = 5 ,
78+ WNT_AUDIO_FILE_ALARM2 = 6 ,
79+ WNT_AUDIO_FILE_ALARM3 = 7 ,
80+ WNT_AUDIO_FILE_ALARM4 = 8 ,
81+ WNT_AUDIO_FILE_ALARM5 = 9 ,
82+ WNT_AUDIO_FILE_ALARM6 = 10 ,
83+ WNT_AUDIO_FILE_ALARM7 = 11 ,
84+ WNT_AUDIO_FILE_ALARM8 = 12 ,
85+ WNT_AUDIO_FILE_ALARM9 = 13 ,
86+ WNT_AUDIO_FILE_ALARM10 = 14 ,
87+ WNT_AUDIO_FILE_CALL = 15 ,
88+ WNT_AUDIO_FILE_CALL1 = 16 ,
89+ WNT_AUDIO_FILE_CALL2 = 17 ,
90+ WNT_AUDIO_FILE_CALL3 = 18 ,
91+ WNT_AUDIO_FILE_CALL4 = 19 ,
92+ WNT_AUDIO_FILE_CALL5 = 20 ,
93+ WNT_AUDIO_FILE_CALL6 = 21 ,
94+ WNT_AUDIO_FILE_CALL7 = 22 ,
95+ WNT_AUDIO_FILE_CALL8 = 23 ,
96+ WNT_AUDIO_FILE_CALL9 = 24 ,
97+ WNT_AUDIO_FILE_CALL10 = 25
98+ } WNT_AudioFile ;
99+
100+ /** Controls how the app-logo image is cropped. */
101+ typedef enum _WNT_CropHint {
102+ WNT_CROP_HINT_SQUARE = 0 ,
103+ WNT_CROP_HINT_CIRCLE = 1
104+ } WNT_CropHint ;
105+
65106/**
66107 * Describes the notification to display.
67108 * All pointer fields may be NULL where noted.
68109 * Callers must keep pointed-to memory valid for the duration of WNT_ShowToast.
110+ *
111+ * Field layout (x64, no explicit packing):
112+ * offsets 0..39 — five pointers (title, body, imagePath, heroImagePath, buttonLabels)
113+ * offset 40 — buttonCount (int, 4 bytes) + 4 bytes natural padding
114+ * offset 48 — expirationMs (long long, 8 bytes)
115+ * offset 56 — scenario (int, 4 bytes)
116+ * offset 60 — audioOption (int, 4 bytes)
117+ * offsets 64..79 — three new pointers (inlineImagePath, attributionText, customAudioPath)
118+ * offset 88 — cropHint (int, 4 bytes)
119+ * offset 92 — audioFile (int, 4 bytes)
120+ * Total: 96 bytes
69121 */
70122typedef struct _WNT_ToastDescriptor {
71- const wchar_t * title ; /* required */
72- const wchar_t * body ; /* nullable */
73- const wchar_t * imagePath ; /* nullable — absolute path; displayed as a square thumbnail */
74- const wchar_t * heroImagePath ; /* nullable — absolute path; displayed full-width, aspect ratio preserved */
75- const wchar_t * * buttonLabels ; /* nullable — array of buttonCount wchar_t* */
123+ const wchar_t * title ; /* required */
124+ const wchar_t * body ; /* nullable */
125+ const wchar_t * imagePath ; /* nullable — absolute path; app logo override in generic templates */
126+ const wchar_t * heroImagePath ; /* nullable — absolute path; full-width banner above the notification */
127+ const wchar_t * * buttonLabels ; /* nullable — array of buttonCount wchar_t* */
76128 int buttonCount ;
77- long long expirationMs ; /* 0 = platform default */
129+ long long expirationMs ; /* 0 = platform default */
78130 WNT_Scenario scenario ;
79131 WNT_AudioOption audioOption ;
132+ /* Extended fields (added in v2): */
133+ const wchar_t * inlineImagePath ; /* nullable — image displayed inline inside the notification body */
134+ const wchar_t * attributionText ; /* nullable — small text shown at the bottom of the notification */
135+ const wchar_t * customAudioPath ; /* nullable — ms-winsoundevent: URI or ms-appx:/// path; overrides audioFile */
136+ int cropHint ; /* WNT_CropHint — how imagePath is cropped (Square or Circle) */
137+ int audioFile ; /* WNT_AudioFile — system sound to play; -1 = not overridden */
80138} WNT_ToastDescriptor ;
81139
82140/**
@@ -102,9 +160,14 @@ typedef struct _WNT_Handler {
102160 * @param appUserModelId AppUserModelId (AUMI). The wrapper creates a Start-Menu
103161 * shortcut carrying this AUMI automatically if one does not
104162 * already exist.
163+ * @param appIconPath Optional absolute path to an .ico (or .exe/.dll) file whose
164+ * first icon is stamped onto the Start-Menu shortcut. This is
165+ * the small icon shown in the top-left corner of every toast
166+ * notification from this app. Pass NULL to use the default
167+ * (the host executable's icon).
105168 * @return TRUE on success.
106169 */
107- NOTIFYAPI BOOL WNT_Initialize (const wchar_t * appName , const wchar_t * appUserModelId );
170+ NOTIFYAPI BOOL WNT_Initialize (const wchar_t * appName , const wchar_t * appUserModelId , const wchar_t * appIconPath );
108171
109172/**
110173 * Releases all WinToastLib resources. Call from the same STA thread as WNT_Initialize.
0 commit comments