Skip to content

Commit d0cd399

Browse files
committed
fix: add delay to allow Windows toast notifications to display
- Add Sleep(100) after notifier.Show() to give Windows enough time to process and render the toast notification - Fixes issue where toasty.exe would exit too quickly before the notification could be displayed
1 parent 2292b8c commit d0cd399

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,10 @@ int wmain(int argc, wchar_t* argv[]) {
16021602
auto notifier = ToastNotificationManager::CreateToastNotifier(APP_ID);
16031603
notifier.Show(toast);
16041604

1605+
// Give the notification time to be processed and displayed by Windows
1606+
// Without this delay, the process exits too quickly and the toast may not appear
1607+
Sleep(100);
1608+
16051609
return 0;
16061610
}
16071611
catch (const hresult_error& ex) {

0 commit comments

Comments
 (0)