From 803b06b7de60261df72233b130bb9ef4cfa875eb Mon Sep 17 00:00:00 2001 From: leethomas Date: Sun, 10 Jan 2016 15:55:26 -0800 Subject: [PATCH] :checkered_flag: support defaultId for dialog boxes on Windows --- atom/browser/ui/message_box_win.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/atom/browser/ui/message_box_win.cc b/atom/browser/ui/message_box_win.cc index 58287dd5b7..253733de59 100644 --- a/atom/browser/ui/message_box_win.cc +++ b/atom/browser/ui/message_box_win.cc @@ -84,10 +84,11 @@ int ShowMessageBoxUTF16(HWND parent, TDF_ALLOW_DIALOG_CANCELLATION; // Allow canceling the dialog. TASKDIALOGCONFIG config = { 0 }; - config.cbSize = sizeof(config); - config.hwndParent = parent; - config.hInstance = GetModuleHandle(NULL); - config.dwFlags = flags; + config.cbSize = sizeof(config); + config.hwndParent = parent; + config.hInstance = GetModuleHandle(NULL); + config.dwFlags = flags; + config.nDefaultButton = default_id ? (kIDStart + default_id) : 0; // TaskDialogIndirect doesn't allow empty name, if we set empty title it // will show "electron.exe" in title.