From e145474ee5c400368fab5d48decacde37d03b5c4 Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Mon, 19 Dec 2011 11:37:46 +0000 Subject: [PATCH] [SHELL32] - Move "Open With" context menu handler registration to shell32 - Improve Polish translation svn path=/trunk/; revision=54696 --- reactos/boot/bootdata/hivecls_i386.inf | 6 ---- reactos/dll/win32/shell32/lang/pl-PL.rc | 2 +- reactos/dll/win32/shell32/openwithmenu.cpp | 5 ++- reactos/dll/win32/shell32/openwithmenu.h | 2 +- .../win32/shell32/res/rgs/openwithmenu.rgs | 34 +++++++++++++++++++ reactos/dll/win32/shell32/rgs_res.rc | 1 + reactos/dll/win32/shell32/shresdef.h | 1 + 7 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs diff --git a/reactos/boot/bootdata/hivecls_i386.inf b/reactos/boot/bootdata/hivecls_i386.inf index 60fc8d218eb..46a77d2c17e 100644 --- a/reactos/boot/bootdata/hivecls_i386.inf +++ b/reactos/boot/bootdata/hivecls_i386.inf @@ -4,10 +4,8 @@ Signature="$ReactOS$ [AddReg] HKLM,"SOFTWARE\Classes",,0x00000010 - ; Default key HKCR,"*","",0x00000000,"" -HKCR,"*\shellex\ContextMenuHandlers\Open With","",0x00000000,"{09799AFB-AD67-11d1-ABCD-00C04FC30936}" ; Folders HKCR,"Folder","",0x00000000,"Folder" @@ -333,10 +331,6 @@ HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\shell\RunAs\command","",0x000 HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\ShellFolder","Attributes",0x00010001,0x00000000 ; Open With shell extension -HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}","",0x00000000,"Open With Context Menu Handler" -HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","",0x00000000,"shell32.dll" -HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","ThreadingModel",0x00000000,"Apartment" -HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\shellex\MayChangeDefaultMenu","",0x00000000,"" HKCR,"SystemFileAssociations","",0x00000000,"" HKCR,"Applications","",0x00000000,"" diff --git a/reactos/dll/win32/shell32/lang/pl-PL.rc b/reactos/dll/win32/shell32/lang/pl-PL.rc index fbb0682d51d..0f6c0af1dbd 100644 --- a/reactos/dll/win32/shell32/lang/pl-PL.rc +++ b/reactos/dll/win32/shell32/lang/pl-PL.rc @@ -721,7 +721,7 @@ BEGIN IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Dysk sieciowy" - IDS_OPEN_WITH "Otwórz z" + IDS_OPEN_WITH "Otwórz za pomocą" IDS_OPEN_WITH_CHOOSE "Wybierz program..." IDS_SHELL_ABOUT_AUTHORS "&Autorzy" diff --git a/reactos/dll/win32/shell32/openwithmenu.cpp b/reactos/dll/win32/shell32/openwithmenu.cpp index f7e0a122ede..1055826cb0c 100644 --- a/reactos/dll/win32/shell32/openwithmenu.cpp +++ b/reactos/dll/win32/shell32/openwithmenu.cpp @@ -1049,7 +1049,7 @@ COpenWithMenu::LoadOpenWithItems(IDataObject *pdtobj) return E_OUTOFMEMORY; } if (_ILIsDesktop(pidl) || _ILIsMyDocuments(pidl) || _ILIsControlPanel(pidl) || _ILIsNetHood(pidl) || - _ILIsBitBucket(pidl) || _ILIsDrive(pidl) || _ILIsCPanelStruct(pidl) || _ILIsFolder(pidl)) + _ILIsBitBucket(pidl) || _ILIsDrive(pidl) || _ILIsCPanelStruct(pidl) || _ILIsFolder(pidl)) { TRACE("pidl is a folder\n"); SHFree((void*)pidl); @@ -1076,7 +1076,7 @@ COpenWithMenu::LoadOpenWithItems(IDataObject *pdtobj) pszExt = wcsrchr(szPath, L'.'); if (pszExt && !_wcsicmp(pszExt, szShortCut)) { - FIXME("pidl is a shortcut\n"); + TRACE("pidl is a shortcut\n"); return E_FAIL; } @@ -1106,7 +1106,6 @@ SHOpenWithDialog(HWND hwndParent, if (poainfo->pcszClass == NULL && poainfo->pcszFile == NULL) return E_FAIL; - hwnd = CreateDialogParam(shell32_hInstance, MAKEINTRESOURCE(OPEN_WITH_PROGRAMM_DLG), hwndParent, OpenWithProgrammDlg, (LPARAM)poainfo); if (hwnd == NULL) { diff --git a/reactos/dll/win32/shell32/openwithmenu.h b/reactos/dll/win32/shell32/openwithmenu.h index cf966235a4a..1f2abd90dee 100644 --- a/reactos/dll/win32/shell32/openwithmenu.h +++ b/reactos/dll/win32/shell32/openwithmenu.h @@ -51,7 +51,7 @@ class COpenWithMenu : // IShellExtInit virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID); - DECLARE_NO_REGISTRY() + DECLARE_REGISTRY_RESOURCEID(IDR_OPENWITHMENU) DECLARE_NOT_AGGREGATABLE(COpenWithMenu) DECLARE_PROTECT_FINAL_CONSTRUCT() diff --git a/reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs b/reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs new file mode 100644 index 00000000000..da3babdce47 --- /dev/null +++ b/reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs @@ -0,0 +1,34 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {09799AFB-AD67-11d1-ABCD-00C04FC30936} = s 'Open With Context Menu Handler' + { + val InfoTip = e '@%%SystemRoot%%\system32\SHELL32.dll,-22924' + val LocalizedString = e '@%%SystemRoot%%\system32\SHELL32.dll,-22985' + DefaultIcon = e '%%SystemRoot%%\system32\SHELL32.dll,-210' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + shellex + { + MayChangeDefaultMenu + { + } + } + } + } + NoRemove * + { + NoRemove shellex + { + NoRemove ContextMenuHandlers + { + ForceRemove Open With = s '{09799AFB-AD67-11d1-ABCD-00C04FC30936}' + { + } + } + } + } +} diff --git a/reactos/dll/win32/shell32/rgs_res.rc b/reactos/dll/win32/shell32/rgs_res.rc index 6a37542b463..7cd29792e88 100644 --- a/reactos/dll/win32/shell32/rgs_res.rc +++ b/reactos/dll/win32/shell32/rgs_res.rc @@ -20,3 +20,4 @@ IDR_SHELLDESKTOP REGISTRY "res\\rgs\\shelldesktop.rgs" IDR_SHELLFSFOLDER REGISTRY "res\\rgs\\shellfsfolder.rgs" IDR_SHELLLINK REGISTRY "res\\rgs\\shelllink.rgs" IDR_STARTMENU REGISTRY "res\\rgs\\startmenu.rgs" +IDR_OPENWITHMENU REGISTRY "res\\rgs\\openwithmenu.rgs" diff --git a/reactos/dll/win32/shell32/shresdef.h b/reactos/dll/win32/shell32/shresdef.h index 788274226d8..634c4de48aa 100644 --- a/reactos/dll/win32/shell32/shresdef.h +++ b/reactos/dll/win32/shell32/shresdef.h @@ -471,5 +471,6 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi #define IDR_SHELLFSFOLDER 143 #define IDR_SHELLLINK 144 #define IDR_STARTMENU 145 +#define IDR_OPENWITHMENU 146 #endif