From f6fa1a26497c66e4970699c09d31569adcb04771 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 3 Apr 2015 14:38:20 +0000 Subject: [PATCH] [SHELL32] make "Manage" translatable by Giannis and me svn path=/trunk/; revision=67021 --- reactos/dll/win32/CMakeLists.txt | 1 + reactos/dll/win32/mycomput/CMakeLists.txt | 6 ++++++ reactos/dll/win32/mycomput/lang/de-DE.rc | 6 ++++++ reactos/dll/win32/mycomput/lang/en-US.rc | 6 ++++++ reactos/dll/win32/mycomput/mycomput.rc | 18 +++++++++++++++++ reactos/dll/win32/mycomput/resource.h | 3 +++ .../dll/win32/shell32/CDefaultContextMenu.cpp | 20 +++++++++++++++++-- .../dll/win32/shell32/res/rgs/mycomputer.rgs | 2 +- 8 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 reactos/dll/win32/mycomput/CMakeLists.txt create mode 100644 reactos/dll/win32/mycomput/lang/de-DE.rc create mode 100644 reactos/dll/win32/mycomput/lang/en-US.rc create mode 100644 reactos/dll/win32/mycomput/mycomput.rc create mode 100644 reactos/dll/win32/mycomput/resource.h diff --git a/reactos/dll/win32/CMakeLists.txt b/reactos/dll/win32/CMakeLists.txt index e2b135b55bc..6513dd8f5cb 100644 --- a/reactos/dll/win32/CMakeLists.txt +++ b/reactos/dll/win32/CMakeLists.txt @@ -126,6 +126,7 @@ add_subdirectory(msxml2) add_subdirectory(msxml3) add_subdirectory(msxml4) add_subdirectory(msxml6) +add_subdirectory(mycomput) add_subdirectory(nddeapi) add_subdirectory(netapi32) add_subdirectory(netcfgx) diff --git a/reactos/dll/win32/mycomput/CMakeLists.txt b/reactos/dll/win32/mycomput/CMakeLists.txt new file mode 100644 index 00000000000..0e30f01027a --- /dev/null +++ b/reactos/dll/win32/mycomput/CMakeLists.txt @@ -0,0 +1,6 @@ + +add_library(mycomput SHARED + mycomput.rc) + +set_module_type(mycomput win32dll UNICODE) +add_cd_file(TARGET mycomput DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/win32/mycomput/lang/de-DE.rc b/reactos/dll/win32/mycomput/lang/de-DE.rc new file mode 100644 index 00000000000..92fcec8b0b0 --- /dev/null +++ b/reactos/dll/win32/mycomput/lang/de-DE.rc @@ -0,0 +1,6 @@ +LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL + +STRINGTABLE +BEGIN + IDS_MANAGE "Verwalten" +END diff --git a/reactos/dll/win32/mycomput/lang/en-US.rc b/reactos/dll/win32/mycomput/lang/en-US.rc new file mode 100644 index 00000000000..f50108628b2 --- /dev/null +++ b/reactos/dll/win32/mycomput/lang/en-US.rc @@ -0,0 +1,6 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +STRINGTABLE +BEGIN + IDS_MANAGE "Manage" +END diff --git a/reactos/dll/win32/mycomput/mycomput.rc b/reactos/dll/win32/mycomput/mycomput.rc new file mode 100644 index 00000000000..80e6a2ade6d --- /dev/null +++ b/reactos/dll/win32/mycomput/mycomput.rc @@ -0,0 +1,18 @@ +#include +#include + +#include "resource.h" + + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +/* UTF-8 */ +#pragma code_page(65001) + +#ifdef LANGUAGE_DE_DE + #include "lang/de-DE.rc" +#endif +#ifdef LANGUAGE_EN_US + #include "lang/en-US.rc" +#endif + diff --git a/reactos/dll/win32/mycomput/resource.h b/reactos/dll/win32/mycomput/resource.h new file mode 100644 index 00000000000..fe62dee0ef5 --- /dev/null +++ b/reactos/dll/win32/mycomput/resource.h @@ -0,0 +1,3 @@ +#pragma once + +#define IDS_MANAGE 400 diff --git a/reactos/dll/win32/shell32/CDefaultContextMenu.cpp b/reactos/dll/win32/shell32/CDefaultContextMenu.cpp index de41ffd3035..7a917ce5dd0 100644 --- a/reactos/dll/win32/shell32/CDefaultContextMenu.cpp +++ b/reactos/dll/win32/shell32/CDefaultContextMenu.cpp @@ -657,10 +657,26 @@ CDefaultContextMenu::AddStaticContextMenusToMenu( if (SUCCEEDED(hr)) { + HKEY hkVerb; DWORD cbVerb = sizeof(wszVerb); + LONG res = RegOpenKeyW(HKEY_CLASSES_ROOT, wszKey, &hkVerb); + if (res == ERROR_SUCCESS) + { + res = RegLoadMUIStringW(hkVerb, + NULL, + wszVerb, + cbVerb, + NULL, + 0, + NULL); + if (res == ERROR_SUCCESS) + { + /* use description for the menu entry */ + mii.dwTypeData = wszVerb; + } - if (RegGetValueW(HKEY_CLASSES_ROOT, wszKey, NULL, RRF_RT_REG_SZ, NULL, wszVerb, &cbVerb) == ERROR_SUCCESS) - mii.dwTypeData = wszVerb; /* use description for the menu entry */ + RegCloseKey(hkVerb); + } } } diff --git a/reactos/dll/win32/shell32/res/rgs/mycomputer.rgs b/reactos/dll/win32/shell32/res/rgs/mycomputer.rgs index 1855c077ccc..3bc729ded83 100644 --- a/reactos/dll/win32/shell32/res/rgs/mycomputer.rgs +++ b/reactos/dll/win32/shell32/res/rgs/mycomputer.rgs @@ -28,7 +28,7 @@ HKCR 'topic' = s 'AppProperties' } } - 'Manage' + 'Manage' = e '@%%SystemRoot%%\system32\mycomput.dll,-400' { 'command' = e 'explorer.exe /n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{D20EA4E1-3957-11d2-A40B-0C5020524153}' val 'SuppressionPolicy' = d '&H4000003c'