Merge pull request #10517 from yuya-oc/win7-notification-duration

Set duration for Windows 7 notifications based on Control Panel
This commit is contained in:
Aleš Pergl 2017-09-25 17:04:08 +02:00 committed by GitHub
commit 2abde14a7c

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() {