https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f01e6ed6c5fc7cfcf4801…
commit f01e6ed6c5fc7cfcf4801818431b43f4f3adbf1a
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Mon Nov 6 19:50:49 2017 +0300
[BROWSEUI] CBandSiteMenu: Show Toolbar error on failure
---
dll/win32/browseui/lang/bg-BG.rc | 2 ++
dll/win32/browseui/lang/de-DE.rc | 2 ++
dll/win32/browseui/lang/en-US.rc | 2 ++
dll/win32/browseui/lang/es-ES.rc | 2 ++
dll/win32/browseui/lang/fr-FR.rc | 2 ++
dll/win32/browseui/lang/he-IL.rc | 2 ++
dll/win32/browseui/lang/it-IT.rc | 2 ++
dll/win32/browseui/lang/ja-JP.rc | 2 ++
dll/win32/browseui/lang/pl-PL.rc | 2 ++
dll/win32/browseui/lang/pt-BR.rc | 2 ++
dll/win32/browseui/lang/ro-RO.rc | 2 ++
dll/win32/browseui/lang/ru-RU.rc | 2 ++
dll/win32/browseui/lang/sq-AL.rc | 2 ++
dll/win32/browseui/lang/tr-TR.rc | 2 ++
dll/win32/browseui/lang/uk-UA.rc | 2 ++
dll/win32/browseui/lang/zh-CN.rc | 2 ++
dll/win32/browseui/lang/zh-TW.rc | 2 ++
dll/win32/browseui/resource.h | 2 ++
dll/win32/browseui/shellbars/CBandSiteMenu.cpp | 19 +++++++++++++++++--
dll/win32/browseui/shellbars/CBandSiteMenu.h | 1 +
20 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/dll/win32/browseui/lang/bg-BG.rc b/dll/win32/browseui/lang/bg-BG.rc
index c76e5d3282..3c926e1d70 100644
--- a/dll/win32/browseui/lang/bg-BG.rc
+++ b/dll/win32/browseui/lang/bg-BG.rc
@@ -295,4 +295,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/de-DE.rc b/dll/win32/browseui/lang/de-DE.rc
index d54f315047..ae7f85d518 100644
--- a/dll/win32/browseui/lang/de-DE.rc
+++ b/dll/win32/browseui/lang/de-DE.rc
@@ -314,4 +314,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/en-US.rc b/dll/win32/browseui/lang/en-US.rc
index 98d6277a43..be6f51ae8c 100644
--- a/dll/win32/browseui/lang/en-US.rc
+++ b/dll/win32/browseui/lang/en-US.rc
@@ -313,4 +313,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/es-ES.rc b/dll/win32/browseui/lang/es-ES.rc
index 3506c67d5f..7003b588e6 100644
--- a/dll/win32/browseui/lang/es-ES.rc
+++ b/dll/win32/browseui/lang/es-ES.rc
@@ -297,4 +297,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/fr-FR.rc b/dll/win32/browseui/lang/fr-FR.rc
index 8ceaf484eb..da07016e3f 100644
--- a/dll/win32/browseui/lang/fr-FR.rc
+++ b/dll/win32/browseui/lang/fr-FR.rc
@@ -313,4 +313,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/he-IL.rc b/dll/win32/browseui/lang/he-IL.rc
index d324f74b16..dfb3dd7100 100644
--- a/dll/win32/browseui/lang/he-IL.rc
+++ b/dll/win32/browseui/lang/he-IL.rc
@@ -297,4 +297,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/it-IT.rc b/dll/win32/browseui/lang/it-IT.rc
index f780f846fd..7fa4e6f7a0 100644
--- a/dll/win32/browseui/lang/it-IT.rc
+++ b/dll/win32/browseui/lang/it-IT.rc
@@ -295,4 +295,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/ja-JP.rc b/dll/win32/browseui/lang/ja-JP.rc
index 65e9003564..def88114c6 100644
--- a/dll/win32/browseui/lang/ja-JP.rc
+++ b/dll/win32/browseui/lang/ja-JP.rc
@@ -313,4 +313,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/pl-PL.rc b/dll/win32/browseui/lang/pl-PL.rc
index 3e5f74be0d..8d5f6a6f5d 100644
--- a/dll/win32/browseui/lang/pl-PL.rc
+++ b/dll/win32/browseui/lang/pl-PL.rc
@@ -303,4 +303,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/pt-BR.rc b/dll/win32/browseui/lang/pt-BR.rc
index 7fcd59962e..2915c1e8cf 100644
--- a/dll/win32/browseui/lang/pt-BR.rc
+++ b/dll/win32/browseui/lang/pt-BR.rc
@@ -297,4 +297,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/ro-RO.rc b/dll/win32/browseui/lang/ro-RO.rc
index b763155b41..bbe6b76943 100644
--- a/dll/win32/browseui/lang/ro-RO.rc
+++ b/dll/win32/browseui/lang/ro-RO.rc
@@ -297,4 +297,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/ru-RU.rc b/dll/win32/browseui/lang/ru-RU.rc
index 568cad6e01..593d685b83 100644
--- a/dll/win32/browseui/lang/ru-RU.rc
+++ b/dll/win32/browseui/lang/ru-RU.rc
@@ -297,4 +297,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/sq-AL.rc b/dll/win32/browseui/lang/sq-AL.rc
index 9296f7ee92..31d615019a 100644
--- a/dll/win32/browseui/lang/sq-AL.rc
+++ b/dll/win32/browseui/lang/sq-AL.rc
@@ -314,4 +314,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/tr-TR.rc b/dll/win32/browseui/lang/tr-TR.rc
index f04cba1ddd..86e6ed6d6a 100644
--- a/dll/win32/browseui/lang/tr-TR.rc
+++ b/dll/win32/browseui/lang/tr-TR.rc
@@ -297,4 +297,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/uk-UA.rc b/dll/win32/browseui/lang/uk-UA.rc
index 80e832bf82..0cebd38376 100644
--- a/dll/win32/browseui/lang/uk-UA.rc
+++ b/dll/win32/browseui/lang/uk-UA.rc
@@ -297,4 +297,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/zh-CN.rc b/dll/win32/browseui/lang/zh-CN.rc
index 5e7e970990..ca887e9670 100644
--- a/dll/win32/browseui/lang/zh-CN.rc
+++ b/dll/win32/browseui/lang/zh-CN.rc
@@ -315,4 +315,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/lang/zh-TW.rc b/dll/win32/browseui/lang/zh-TW.rc
index c53ee3c1dd..3889152c0c 100644
--- a/dll/win32/browseui/lang/zh-TW.rc
+++ b/dll/win32/browseui/lang/zh-TW.rc
@@ -315,4 +315,6 @@ END
STRINGTABLE
BEGIN
IDS_BROWSEFORNEWTOOLAR "Choose a folder"
+ IDS_TOOLBAR_ERR_TITLE "Toolbar"
+ IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar."
END
diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h
index 0d376dac9d..fbad0083f7 100644
--- a/dll/win32/browseui/resource.h
+++ b/dll/win32/browseui/resource.h
@@ -109,6 +109,8 @@
#define IDS_NOTEXTLABELS 12304
#define IDS_SELECTIVETEXTONRIGHT 12305
#define IDS_BROWSEFORNEWTOOLAR 12387
+#define IDS_TOOLBAR_ERR_TITLE 12388
+#define IDS_TOOLBAR_ERR_TEXT 12389
#define IDS_GOBUTTONLABEL 12656
#define IDS_GOBUTTONTIPTEMPLATE 12657
#define IDS_SEARCHLABEL 12897
diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
index 0c56af463c..d94038987f 100644
--- a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
+++ b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
@@ -386,6 +386,21 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu(
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(idMax - idCmdFirst +1));
}
+HRESULT CBandSiteMenu::_ShowToolbarError(HRESULT hRet)
+{
+ WCHAR szText[260];
+ WCHAR szTitle[256];
+
+ if (!LoadStringW(GetModuleHandleW(L"browseui.dll"), IDS_TOOLBAR_ERR_TEXT,
szText, _countof(szText)))
+ StringCchCopyW(szText, _countof(szText), L"Cannot create toolbar.");
+
+ if (!LoadStringW(GetModuleHandleW(L"browseui.dll"), IDS_TOOLBAR_ERR_TITLE,
szTitle, _countof(szTitle)))
+ StringCchCopyW(szTitle, _countof(szTitle), L"Toolbar");
+
+ MessageBoxW(NULL, szText, szTitle, MB_OK | MB_ICONSTOP | MB_SETFOREGROUND);
+ return hRet;
+}
+
HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
{
HRESULT hRet;
@@ -429,11 +444,11 @@ HRESULT STDMETHODCALLTYPE
CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpi
CComPtr<IDeskBand> pDeskBand;
hRet = _CreateBuiltInISFBand(uID, IID_PPV_ARG(IDeskBand, &pDeskBand));
if (FAILED_UNEXPECTEDLY(hRet))
- return hRet;
+ return _ShowToolbarError(hRet);
hRet = m_BandSite->AddBand(pDeskBand);
if (FAILED_UNEXPECTEDLY(hRet))
- return hRet;
+ return _ShowToolbarError(hRet);
}
return S_OK;
}
diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.h
b/dll/win32/browseui/shellbars/CBandSiteMenu.h
index 4e56fa998f..89d4e537fd 100644
--- a/dll/win32/browseui/shellbars/CBandSiteMenu.h
+++ b/dll/win32/browseui/shellbars/CBandSiteMenu.h
@@ -43,6 +43,7 @@ class CBandSiteMenu :
UINT _GetMenuIdFromBand(CLSID *BandCLSID);
UINT _GetBandIdFromClsid(CLSID* pclsid);
UINT _GetBandIdForBuiltinISFBand(UINT uID);
+ HRESULT _ShowToolbarError(HRESULT hRet);
public:
CBandSiteMenu();