From: Cheng Zhao Date: Wed, 8 Jul 2015 06:41:19 +0000 (+0800) Subject: If "detail" is empty then don't make message hilighted X-Git-Tag: v0.30.0~45^2~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f0be4025a5763017924528d3352df3c32cdeae61;p=electron.git If "detail" is empty then don't make message hilighted --- diff --git a/atom/browser/ui/message_box_win.cc b/atom/browser/ui/message_box_win.cc index 046efeb6..f78dc39d 100644 --- a/atom/browser/ui/message_box_win.cc +++ b/atom/browser/ui/message_box_win.cc @@ -31,20 +31,26 @@ int ShowMessageBoxUTF16(HWND parent, for (size_t i = 0; i < buttons.size(); ++i) dialog_buttons.push_back({i + kIDStart, buttons[i].c_str()}); - TASKDIALOG_FLAGS flags = TDF_SIZE_TO_CONTENT; + TASKDIALOG_FLAGS flags = TDF_SIZE_TO_CONTENT; // show all content. if (cancel_id != 0) - flags |= TDF_ALLOW_DIALOG_CANCELLATION; + flags |= TDF_ALLOW_DIALOG_CANCELLATION; // allow dialog to be cancelled. TASKDIALOGCONFIG config = { 0 }; - config.cbSize = sizeof(config); - config.hwndParent = parent; - config.hInstance = GetModuleHandle(NULL); - config.dwFlags = flags; - config.pszWindowTitle = title.c_str(); - config.pszMainInstruction = message.c_str(); - config.pszContent = detail.c_str(); - config.pButtons = &dialog_buttons.front(); - config.cButtons = dialog_buttons.size(); + config.cbSize = sizeof(config); + config.hwndParent = parent; + config.hInstance = GetModuleHandle(NULL); + config.dwFlags = flags; + config.pszWindowTitle = title.c_str(); + config.pButtons = &dialog_buttons.front(); + config.cButtons = dialog_buttons.size(); + + // If "detail" is empty then don't make message hilighted. + if (detail.empty()) { + config.pszContent = message.c_str(); + } else { + config.pszMainInstruction = message.c_str(); + config.pszContent = detail.c_str(); + } int id = 0; TaskDialogIndirect(&config, &id, NULL, NULL);