From 52bc5f7c5df5eaf48b22f6089f7415bc8857543d Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sat, 22 Jul 2023 19:28:37 +0900 Subject: [PATCH] [IEXPLORE][IEFRAME][SHELL32] Add Internet icon on Desktop (#5451) - Add Internet icon on Desktop. You can hide/show the icon from Desktop's customization. - Modify "HKCR\CLSID\%CLSID_Internet%" registry key. - Add IDS_INTERNET and IDS_INTERNET_DESCRITION into ieframe.dll. - Modify folders/CDesktopFolder.cpp and folders/CRegFolder.cpp to add the icon. CORE-18625 Co-authored-by: Stanislav Motylkov Co-authored-by: Joachim Henze --- base/applications/iexplore/CMakeLists.txt | 4 +++- base/applications/iexplore/iexplore.inf | 14 ++++++++++---- dll/win32/ieframe/CMakeLists.txt | 2 ++ dll/win32/ieframe/ieframe_v1.rgs | 14 +++++++++++++- dll/win32/ieframe/lang/cs-CZ.rc | 3 +++ dll/win32/ieframe/lang/de-DE.rc | 3 +++ dll/win32/ieframe/lang/en-US.rc | 3 +++ dll/win32/ieframe/lang/es-ES.rc | 3 +++ dll/win32/ieframe/lang/fr-FR.rc | 3 +++ dll/win32/ieframe/lang/hu-HU.rc | 3 +++ dll/win32/ieframe/lang/id-ID.rc | 3 +++ dll/win32/ieframe/lang/it-IT.rc | 3 +++ dll/win32/ieframe/lang/ja-JP.rc | 3 +++ dll/win32/ieframe/lang/pl-PL.rc | 3 +++ dll/win32/ieframe/lang/pt-PT.rc | 3 +++ dll/win32/ieframe/lang/ro-RO.rc | 3 +++ dll/win32/ieframe/lang/ru-RU.rc | 3 +++ dll/win32/ieframe/lang/tr-TR.rc | 3 +++ dll/win32/ieframe/lang/zh-CN.rc | 3 +++ dll/win32/ieframe/lang/zh-TW.rc | 3 +++ dll/win32/ieframe/resource.h | 3 +++ dll/win32/shell32/folders/CDesktopFolder.cpp | 3 +++ dll/win32/shell32/folders/CRegFolder.cpp | 3 +++ 23 files changed, 85 insertions(+), 6 deletions(-) diff --git a/base/applications/iexplore/CMakeLists.txt b/base/applications/iexplore/CMakeLists.txt index b25b1d9b48d..9a17e61c6c4 100644 --- a/base/applications/iexplore/CMakeLists.txt +++ b/base/applications/iexplore/CMakeLists.txt @@ -1,5 +1,7 @@ -add_rc_deps(iexplore.rc ${CMAKE_CURRENT_SOURCE_DIR}/iexplore.ico) +add_rc_deps(iexplore.rc + ${CMAKE_CURRENT_SOURCE_DIR}/iexplore.ico + ${CMAKE_CURRENT_SOURCE_DIR}/iexplore.inf) add_executable(iexplore main.c iexplore.rc) target_link_libraries(iexplore wine) set_module_type(iexplore win32gui UNICODE) diff --git a/base/applications/iexplore/iexplore.inf b/base/applications/iexplore/iexplore.inf index e88cead039d..ee7d404e792 100644 --- a/base/applications/iexplore/iexplore.inf +++ b/base/applications/iexplore/iexplore.inf @@ -16,10 +16,16 @@ HKCR,"CLSID\%CLSID_InternetExplorer%\LocalServer32",,,"""%16422%\Internet Explor HKCR,"CLSID\%CLSID_InternetExplorer%\ProgID",,,"InternetExplorer.Application.1" HKCR,"CLSID\%CLSID_InternetExplorer%\VersionIndependentProgID",,,"InternetExplorer.Application" -HKCR,"CLSID\%CLSID_Internet%\DefaultIcon",,,"shdoclc.dll,-190" -HKCR,"CLSID\%CLSID_Internet%\Shell",,,"OpenHomePage" -HKCR,"CLSID\%CLSID_Internet%\Shell\OpenHomePage",,,"Open &Home Page" -HKCR,"CLSID\%CLSID_Internet%\Shell\OpenHomePage\Command",,,"""%16422%\Internet Explorer\iexplore.exe""" +; FIXME: Implement CLSID_Internet in ieframe.dll (see CORE-18625) +; https://git.reactos.org/?p=reactos.git;a=blob;f=modules/rostests/apitests/com/ieframe.c;hb=bf2cec186cc7655e062ec0e53ccfac860bcae70d#l35 +HKCR,"CLSID\%CLSID_Internet%",,,"Internet Browser" +HKCR,"CLSID\%CLSID_Internet%","InfoTip",0x00020000,"@%SystemRoot%\system32\ieframe.dll,-881" +HKCR,"CLSID\%CLSID_Internet%","LocalizedString",0x00020000,"@%SystemRoot%\system32\ieframe.dll,-880" +HKCR,"CLSID\%CLSID_Internet%\DefaultIcon",,0x00020000,"%SystemRoot%\system32\shell32.dll,-512" +; FIXME: should be "OpenHomePage" action +HKCR,"CLSID\%CLSID_Internet%\Shell",,,"open" +HKCR,"CLSID\%CLSID_Internet%\Shell\open",,,"" +HKCR,"CLSID\%CLSID_Internet%\Shell\open\Command",,,"rundll32.exe url,OpenURL https://google.com" HKCR,"CLSID\%CLSID_Internet%\ShellFolder",,2,"0x24" HKCR,"CLSID\%CLSID_InternetExplorerManager%\LocalServer32",,,"""%16422%\Internet Explorer\iexplore.exe"" -startmanager" diff --git a/dll/win32/ieframe/CMakeLists.txt b/dll/win32/ieframe/CMakeLists.txt index cdd58efb6e7..830a3f5b9c3 100644 --- a/dll/win32/ieframe/CMakeLists.txt +++ b/dll/win32/ieframe/CMakeLists.txt @@ -35,6 +35,8 @@ add_typelib(ieframe_v1.idl) list(APPEND ieframe_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/ieframe.rgs ${CMAKE_CURRENT_SOURCE_DIR}/ieframe_v1.rgs + ${CMAKE_CURRENT_SOURCE_DIR}/resources/ietoolbar.bmp + ${CMAKE_CURRENT_SOURCE_DIR}/resources/pages.ico ${CMAKE_CURRENT_BINARY_DIR}/ieframe_v1.tlb) set_source_files_properties(ieframe.rc PROPERTIES OBJECT_DEPENDS "${ieframe_rc_deps}") diff --git a/dll/win32/ieframe/ieframe_v1.rgs b/dll/win32/ieframe/ieframe_v1.rgs index 8e124912c56..388f1fe0427 100644 --- a/dll/win32/ieframe/ieframe_v1.rgs +++ b/dll/win32/ieframe/ieframe_v1.rgs @@ -5,9 +5,21 @@ HKCR } NoRemove CLSID { - '{871C5380-42A0-1069-A2EA-08002B30309D}' = s 'Internet' + '{871C5380-42A0-1069-A2EA-08002B30309D}' = s 'Internet Browser' { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' } + Shellex = s '' + { + ContextMenuHandlers = s '' + { + ieframe = s '{871C5380-42A0-1069-A2EA-08002B30309D}' + { + } + } + MayChangeDefaultMenu = s '' + { + } + } } '{3C374A40-BAE4-11CF-BF7D-00AA006946EE}' = s 'Microsoft Url History Service' { diff --git a/dll/win32/ieframe/lang/cs-CZ.rc b/dll/win32/ieframe/lang/cs-CZ.rc index 30b5ee547af..c46500c0423 100644 --- a/dll/win32/ieframe/lang/cs-CZ.rc +++ b/dll/win32/ieframe/lang/cs-CZ.rc @@ -45,6 +45,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Zpět" IDS_TB_FORWARD "Vpřed" IDS_TB_STOP "Stop" diff --git a/dll/win32/ieframe/lang/de-DE.rc b/dll/win32/ieframe/lang/de-DE.rc index 823aad7de9e..bda8f635b2d 100644 --- a/dll/win32/ieframe/lang/de-DE.rc +++ b/dll/win32/ieframe/lang/de-DE.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Zurück" IDS_TB_FORWARD "Vorwärts" IDS_TB_STOP "Stop" diff --git a/dll/win32/ieframe/lang/en-US.rc b/dll/win32/ieframe/lang/en-US.rc index 088458dc344..7df6eda4745 100644 --- a/dll/win32/ieframe/lang/en-US.rc +++ b/dll/win32/ieframe/lang/en-US.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Back" IDS_TB_FORWARD "Forward" IDS_TB_STOP "Stop" diff --git a/dll/win32/ieframe/lang/es-ES.rc b/dll/win32/ieframe/lang/es-ES.rc index 66c8ea67e5d..dd7ff32ce4f 100644 --- a/dll/win32/ieframe/lang/es-ES.rc +++ b/dll/win32/ieframe/lang/es-ES.rc @@ -42,6 +42,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Atrás" IDS_TB_FORWARD "Adelante" IDS_TB_STOP "Detener" diff --git a/dll/win32/ieframe/lang/fr-FR.rc b/dll/win32/ieframe/lang/fr-FR.rc index 42465f831e6..6fd596aaacb 100644 --- a/dll/win32/ieframe/lang/fr-FR.rc +++ b/dll/win32/ieframe/lang/fr-FR.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Précédent" IDS_TB_FORWARD "Suivant" IDS_TB_STOP "Arrêter" diff --git a/dll/win32/ieframe/lang/hu-HU.rc b/dll/win32/ieframe/lang/hu-HU.rc index 000857b8428..e7224c60927 100644 --- a/dll/win32/ieframe/lang/hu-HU.rc +++ b/dll/win32/ieframe/lang/hu-HU.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Vissza" IDS_TB_FORWARD "Előre" IDS_TB_STOP "Leállítás" diff --git a/dll/win32/ieframe/lang/id-ID.rc b/dll/win32/ieframe/lang/id-ID.rc index 6eb1d09f9c7..3806fae54e6 100644 --- a/dll/win32/ieframe/lang/id-ID.rc +++ b/dll/win32/ieframe/lang/id-ID.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Kembali" IDS_TB_FORWARD "Maju" IDS_TB_STOP "Berhenti" diff --git a/dll/win32/ieframe/lang/it-IT.rc b/dll/win32/ieframe/lang/it-IT.rc index 97da1705e02..4d53a09ad1e 100644 --- a/dll/win32/ieframe/lang/it-IT.rc +++ b/dll/win32/ieframe/lang/it-IT.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Indietro" IDS_TB_FORWARD "Avanti" IDS_TB_STOP "Interrompi" diff --git a/dll/win32/ieframe/lang/ja-JP.rc b/dll/win32/ieframe/lang/ja-JP.rc index a9cc0035a7a..1501e00aa46 100644 --- a/dll/win32/ieframe/lang/ja-JP.rc +++ b/dll/win32/ieframe/lang/ja-JP.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "戻る" IDS_TB_FORWARD "進む" IDS_TB_STOP "停止" diff --git a/dll/win32/ieframe/lang/pl-PL.rc b/dll/win32/ieframe/lang/pl-PL.rc index d94e2de120f..6f9432f0ad8 100644 --- a/dll/win32/ieframe/lang/pl-PL.rc +++ b/dll/win32/ieframe/lang/pl-PL.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Wstecz" IDS_TB_FORWARD "Dalej" IDS_TB_STOP "Zatrzymaj" diff --git a/dll/win32/ieframe/lang/pt-PT.rc b/dll/win32/ieframe/lang/pt-PT.rc index 65c7e3de8b5..33df448de07 100644 --- a/dll/win32/ieframe/lang/pt-PT.rc +++ b/dll/win32/ieframe/lang/pt-PT.rc @@ -40,6 +40,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Retroceder" IDS_TB_FORWARD "Avançar" IDS_TB_STOP "Parar" diff --git a/dll/win32/ieframe/lang/ro-RO.rc b/dll/win32/ieframe/lang/ro-RO.rc index 14e3cc83c00..6b12740d444 100644 --- a/dll/win32/ieframe/lang/ro-RO.rc +++ b/dll/win32/ieframe/lang/ro-RO.rc @@ -42,6 +42,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Înapoi" IDS_TB_FORWARD "Înainte" IDS_TB_STOP "Oprește" diff --git a/dll/win32/ieframe/lang/ru-RU.rc b/dll/win32/ieframe/lang/ru-RU.rc index 26c297792d6..07f2e1c0b1e 100644 --- a/dll/win32/ieframe/lang/ru-RU.rc +++ b/dll/win32/ieframe/lang/ru-RU.rc @@ -42,6 +42,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Назад" IDS_TB_FORWARD "Вперед" IDS_TB_STOP "Остановить" diff --git a/dll/win32/ieframe/lang/tr-TR.rc b/dll/win32/ieframe/lang/tr-TR.rc index 1dfc7aeaca1..d3e9544cc46 100644 --- a/dll/win32/ieframe/lang/tr-TR.rc +++ b/dll/win32/ieframe/lang/tr-TR.rc @@ -42,6 +42,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "Geri" IDS_TB_FORWARD "İleri" IDS_TB_STOP "Dur" diff --git a/dll/win32/ieframe/lang/zh-CN.rc b/dll/win32/ieframe/lang/zh-CN.rc index 516a436231c..430d0648fec 100644 --- a/dll/win32/ieframe/lang/zh-CN.rc +++ b/dll/win32/ieframe/lang/zh-CN.rc @@ -43,6 +43,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "后退" IDS_TB_FORWARD "前进" IDS_TB_STOP "停止" diff --git a/dll/win32/ieframe/lang/zh-TW.rc b/dll/win32/ieframe/lang/zh-TW.rc index 904ce82b982..732aee20447 100644 --- a/dll/win32/ieframe/lang/zh-TW.rc +++ b/dll/win32/ieframe/lang/zh-TW.rc @@ -49,6 +49,9 @@ IDR_BROWSE_MAIN_MENU MENU STRINGTABLE { + IDS_INTERNET "Internet Browser" + IDS_INTERNET_DESCRIPTION "Opens a Web browser and displays information on the Internet." + IDS_TB_BACK "上一頁" IDS_TB_FORWARD "下一頁" IDS_TB_STOP "停止" diff --git a/dll/win32/ieframe/resource.h b/dll/win32/ieframe/resource.h index 00c79beee72..1e51753f864 100644 --- a/dll/win32/ieframe/resource.h +++ b/dll/win32/ieframe/resource.h @@ -55,6 +55,9 @@ #define ID_BROWSE_GOTOFAV_FIRST 2000 #define ID_BROWSE_GOTOFAV_MAX 65000 +#define IDS_INTERNET 880 +#define IDS_INTERNET_DESCRIPTION 881 + #define IDS_TB_BACK 1100 #define IDS_TB_FORWARD 1101 #define IDS_TB_STOP 1102 diff --git a/dll/win32/shell32/folders/CDesktopFolder.cpp b/dll/win32/shell32/folders/CDesktopFolder.cpp index 8aa1e089fff..d1fafa88b5c 100644 --- a/dll/win32/shell32/folders/CDesktopFolder.cpp +++ b/dll/win32/shell32/folders/CDesktopFolder.cpp @@ -129,6 +129,7 @@ class CDesktopFolderEnum : LPITEMIDLIST pidl; static const WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}"; + static const WCHAR InternetClassString[] = L"{871C5380-42A0-1069-A2EA-08002B30309D}"; TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags); @@ -138,6 +139,8 @@ class CDesktopFolderEnum : AddToEnumList(_ILCreateMyComputer()); if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1) AddToEnumList(_ILCreateMyDocuments()); + if (IsNamespaceExtensionHidden(InternetClassString) < 1) + AddToEnumList(_ILCreateIExplore()); DWORD dwFetched; while((S_OK == pRegEnumerator->Next(1, &pidl, &dwFetched)) && dwFetched) diff --git a/dll/win32/shell32/folders/CRegFolder.cpp b/dll/win32/shell32/folders/CRegFolder.cpp index eea529de235..16b0b7325e2 100644 --- a/dll/win32/shell32/folders/CRegFolder.cpp +++ b/dll/win32/shell32/folders/CRegFolder.cpp @@ -185,12 +185,15 @@ HRESULT CGuidItemExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID iid, LPVO } else { + // FIXME: Delete these hacks and make HCR_GetIconW and registry working if (IsEqualGUID(*riid, CLSID_MyComputer)) initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_MY_COMPUTER); else if (IsEqualGUID(*riid, CLSID_MyDocuments)) initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_MY_DOCUMENTS); else if (IsEqualGUID(*riid, CLSID_NetworkPlaces)) initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_MY_NETWORK_PLACES); + else if (IsEqualGUID(*riid, CLSID_Internet)) + initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_WEB_BROWSER); else initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_FOLDER); }