mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user