🏁 Set duration for Windows 7 notifications based on Control Panel

This commit is contained in:
Yuya Ochiai 2017-09-11 23:24:30 +09:00
parent ec587032b2
commit d621471eb2

View file

@ -641,7 +641,12 @@ void DesktopNotificationController::Toast::CancelDismiss() {
}
void DesktopNotificationController::Toast::ScheduleDismissal() {
SetTimer(hwnd_, TimerID_AutoDismiss, 4000, nullptr);
ULONG duration;
auto result = SystemParametersInfo(SPI_GETMESSAGEDURATION, 0, &duration, 0);
if (result == FALSE) {
duration = 5;
}
SetTimer(hwnd_, TimerID_AutoDismiss, duration * 1000, nullptr);
}
void DesktopNotificationController::Toast::ResetContents() {