[EXPLORER][SHELL32] Expand/unexpand Control Panel menu (#6595)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Mon, 11 Mar 2024 07:19:46 +0000 (16:19 +0900)
committerGitHub <noreply@github.com>
Mon, 11 Mar 2024 07:19:46 +0000 (16:19 +0900)
Follow-up to #6594. Improve Start Menu customization.
JIRA issue: CORE-16956
- Add IDS_ADVANCED_EXPAND_CONTROL_PANEL, IDS_ADVANCED_EXPAND_PRINTERS,
  and IDS_ADVANCED_EXPAND_NET_CONNECTIONS resource strings.
- Check the "CascadeControlPanel", "CascadeNetworkConnections", and "CascadePrinters"
  registry values.
- Modify Start Menu by using AddOrSetMenuItem and AddStartMenuItems helper
  functions in CShellMenuCallback::OnGetSubMenu.

40 files changed:
base/shell/explorer/resource.h
base/shell/explorer/startmnucust.cpp
dll/win32/shell32/lang/bg-BG.rc
dll/win32/shell32/lang/ca-ES.rc
dll/win32/shell32/lang/cs-CZ.rc
dll/win32/shell32/lang/da-DK.rc
dll/win32/shell32/lang/de-DE.rc
dll/win32/shell32/lang/el-GR.rc
dll/win32/shell32/lang/en-GB.rc
dll/win32/shell32/lang/en-US.rc
dll/win32/shell32/lang/es-ES.rc
dll/win32/shell32/lang/et-EE.rc
dll/win32/shell32/lang/eu-ES.rc
dll/win32/shell32/lang/fi-FI.rc
dll/win32/shell32/lang/fr-FR.rc
dll/win32/shell32/lang/he-IL.rc
dll/win32/shell32/lang/hi-IN.rc
dll/win32/shell32/lang/hu-HU.rc
dll/win32/shell32/lang/id-ID.rc
dll/win32/shell32/lang/it-IT.rc
dll/win32/shell32/lang/ja-JP.rc
dll/win32/shell32/lang/ko-KR.rc
dll/win32/shell32/lang/nl-NL.rc
dll/win32/shell32/lang/no-NO.rc
dll/win32/shell32/lang/pl-PL.rc
dll/win32/shell32/lang/pt-BR.rc
dll/win32/shell32/lang/pt-PT.rc
dll/win32/shell32/lang/ro-RO.rc
dll/win32/shell32/lang/ru-RU.rc
dll/win32/shell32/lang/sk-SK.rc
dll/win32/shell32/lang/sl-SI.rc
dll/win32/shell32/lang/sq-AL.rc
dll/win32/shell32/lang/sv-SE.rc
dll/win32/shell32/lang/tr-TR.rc
dll/win32/shell32/lang/uk-UA.rc
dll/win32/shell32/lang/zh-CN.rc
dll/win32/shell32/lang/zh-HK.rc
dll/win32/shell32/lang/zh-TW.rc
dll/win32/shell32/shellmenu/CStartMenu.cpp
dll/win32/shell32/shresdef.h

index 49f7b65..f78d753 100644 (file)
 /* These values must be synchronized with shell32 */
 #define IDS_ADVANCED_DISPLAY_FAVORITES              30466
 #define IDS_ADVANCED_DISPLAY_LOG_OFF                30467
+#define IDS_ADVANCED_EXPAND_CONTROL_PANEL           30468
 #define IDS_ADVANCED_EXPAND_MY_DOCUMENTS            30469
+#define IDS_ADVANCED_EXPAND_PRINTERS                30470
 #define IDS_ADVANCED_EXPAND_MY_PICTURES             30472
+#define IDS_ADVANCED_EXPAND_NET_CONNECTIONS         30473
 #define IDS_ADVANCED_DISPLAY_RUN                    30474
 #define IDS_ADVANCED_DISPLAY_ADMINTOOLS             30476
 
index 4e0bc5f..303787e 100644 (file)
@@ -112,11 +112,14 @@ static const CUSTOMIZE_ENTRY s_CustomizeEntries[] =
     // FIXME: Make "StartMenuAdminTools" effective
     //{ IDS_ADVANCED_DISPLAY_ADMINTOOLS, L"StartMenuAdminTools", CustomizeRead1, CustomizeWrite1 }, // FIXME
 
-    { IDS_ADVANCED_DISPLAY_FAVORITES,   L"StartMenuFavorites",  CustomizeReadAdvanced, CustomizeWriteAdvanced },
-    { IDS_ADVANCED_DISPLAY_LOG_OFF,     L"StartMenuLogoff",     CustomizeReadAdvanced, CustomizeWriteAdvanced },
-    { IDS_ADVANCED_DISPLAY_RUN,         L"NoRun",               CustomizeReadRun,      CustomizeWriteRest     },
-    { IDS_ADVANCED_EXPAND_MY_DOCUMENTS, L"CascadeMyDocuments",  CustomizeReadAdvanced, CustomizeWriteAdvanced },
-    { IDS_ADVANCED_EXPAND_MY_PICTURES,  L"CascadeMyPictures",   CustomizeReadAdvanced, CustomizeWriteAdvanced },
+    { IDS_ADVANCED_DISPLAY_FAVORITES,      L"StartMenuFavorites",  CustomizeReadAdvanced, CustomizeWriteAdvanced },
+    { IDS_ADVANCED_DISPLAY_LOG_OFF,        L"StartMenuLogoff",     CustomizeReadAdvanced, CustomizeWriteAdvanced },
+    { IDS_ADVANCED_DISPLAY_RUN,            L"NoRun",               CustomizeReadRun,      CustomizeWriteRest     },
+    { IDS_ADVANCED_EXPAND_MY_DOCUMENTS,    L"CascadeMyDocuments",  CustomizeReadAdvanced, CustomizeWriteAdvanced },
+    { IDS_ADVANCED_EXPAND_MY_PICTURES,     L"CascadeMyPictures",   CustomizeReadAdvanced, CustomizeWriteAdvanced },
+    { IDS_ADVANCED_EXPAND_CONTROL_PANEL,   L"CascadeControlPanel", CustomizeReadAdvanced, CustomizeWriteAdvanced },
+    { IDS_ADVANCED_EXPAND_PRINTERS,        L"CascadePrinters",     CustomizeReadAdvanced, CustomizeWriteAdvanced },
+    { IDS_ADVANCED_EXPAND_NET_CONNECTIONS, L"CascadeNetworkConnections", CustomizeReadAdvanced, CustomizeWriteAdvanced },
 };
 
 static VOID AddCustomizeItem(HWND hTreeView, const CUSTOMIZE_ENTRY *entry)
index c0d6e35..c64e11f 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 04403bb..948b4cb 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index afcbedc..84a0ea8 100644 (file)
@@ -1022,8 +1022,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 981ff8c..50fb44e 100644 (file)
@@ -1021,8 +1021,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 2213023..48a7798 100644 (file)
@@ -1015,8 +1015,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Popupinformationen für Ordner- und Desktop-Elemente anzeigen"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 55160be..fa9951a 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 329deef..d4a577c 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 6d1776e..5f15dbf 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 3c71053..15ab62a 100644 (file)
@@ -1023,8 +1023,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Mostrar descripción de íconos y carpetas en el escritorio"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index e37ab94..bc0f0a8 100644 (file)
@@ -1021,8 +1021,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Näita kausta- ja töölauaüksuste hüpikkirjeldusi"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 008fa72..8d2330a 100644 (file)
@@ -1019,8 +1019,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Erakutsi ikonoen eta karpeten deskribapena mahaigainean"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 8253c56..af229c1 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index ae34ff4..cc0fe50 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Afficher les info-bulles pour les fichiers et les dossiers"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 304bf87..124e2a7 100644 (file)
@@ -1021,8 +1021,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 2ff2379..397e975 100644 (file)
@@ -1016,8 +1016,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "फ़ोल्डर और डेस्कटॉप आइटम के लिए पॉप-अप विवरण दिखाएं"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 2689ebf..436dfb7 100644 (file)
@@ -1013,8 +1013,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Felugró leírások megjelenítése a mappákhoz és az asztalon lévő elemekhez"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 37750e7..261ce8d 100644 (file)
@@ -1011,8 +1011,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Tampilkan deskrisi popup untuk butir folder dan desktop"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index ec37872..6af11de 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 2aecb43..75537d3 100644 (file)
@@ -1011,8 +1011,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "フォルダとデスクトップの項目にポップアップ式の説明を表示する"
     IDS_ADVANCED_DISPLAY_FAVORITES "「お気に入り」を表示"
     IDS_ADVANCED_DISPLAY_LOG_OFF "「ログオフ」を表示"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "「コントロール パネル」を展開"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "「マイ ドキュメント」を展開"
+    IDS_ADVANCED_EXPAND_PRINTERS "「プリンタ」を展開"
     IDS_ADVANCED_EXPAND_MY_PICTURES "「マイ ピクチャ」を展開"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "「マイ ネットワーク」を展開"
     IDS_ADVANCED_DISPLAY_RUN "「ファイル名を指定して実行」を表示"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "「管理者ツール」を表示"
 
index 9f033c6..81f89b1 100644 (file)
@@ -1021,8 +1021,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 981075f..079fd57 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index bf851d2..ea625e6 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index ce50d46..5da6f59 100644 (file)
@@ -1023,8 +1023,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Pokaż podręczny opis elementów folderów i pulpitu"
     IDS_ADVANCED_DISPLAY_FAVORITES "Wyświetl polecenie Ulubione"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Wyświetl polecenie Wyloguj"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Wyświetl polecenie Uruchom"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Wyświetl polecenie Narzędzia administracyjne"
 
index d1f2bbe..32df4c6 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index b933142..b4370d6 100644 (file)
@@ -1013,8 +1013,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Mostrar descrição pop-up para itens de pastas e área de trabalho"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index b94c39e..c839f9d 100644 (file)
@@ -1022,8 +1022,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Permite descriere prin indicii pentru foldere și elemente de desktop"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index c404689..ed408b6 100644 (file)
@@ -1023,8 +1023,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Отображать описание для папок и элементов рабочего стола"
     IDS_ADVANCED_DISPLAY_FAVORITES "Отображать папку ""Избранное"""
     IDS_ADVANCED_DISPLAY_LOG_OFF "Отображать команду ""Завершение сеанса"""
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Отображать команду ""Выполнить"""
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Отображать меню ""Администрирование"""
 
index 4143a9c..c18a529 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 8620536..8f891e7 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 4ddcd21..fe9f522 100644 (file)
@@ -1021,8 +1021,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 0a61e4f..514ffc6 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Show pop-up description for folder and desktop items"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index a8d5dd6..be6886b 100644 (file)
@@ -1023,8 +1023,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Dizin ve masaüstü ögeleri için açılan tanım göster"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 731e697..83ca187 100644 (file)
@@ -1014,8 +1014,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "Показувати спливаючий опис для елементів папки та робочого столу"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 20a697e..253eb1d 100644 (file)
@@ -1024,8 +1024,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "显示文件夹和桌面项目的弹出描述"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 4c94137..7a3709a 100644 (file)
@@ -1022,8 +1022,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "顯示資料夾和桌面項目的快顯描述"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index 6bd3479..cc14c76 100644 (file)
@@ -1023,8 +1023,11 @@ BEGIN
     IDS_ADVANCED_SHOW_INFO_TIP "顯示資料夾和桌面項目的快顯描述"
     IDS_ADVANCED_DISPLAY_FAVORITES "Display Favorites"
     IDS_ADVANCED_DISPLAY_LOG_OFF "Display Log Off"
+    IDS_ADVANCED_EXPAND_CONTROL_PANEL "Expand Control Panel"
     IDS_ADVANCED_EXPAND_MY_DOCUMENTS "Expand My Documents"
+    IDS_ADVANCED_EXPAND_PRINTERS "Expand Printers"
     IDS_ADVANCED_EXPAND_MY_PICTURES "Expand My Pictures"
+    IDS_ADVANCED_EXPAND_NET_CONNECTIONS "Expand Network Connections"
     IDS_ADVANCED_DISPLAY_RUN "Display Run"
     IDS_ADVANCED_DISPLAY_ADMINTOOLS "Display Administrative Tools"
 
index b6c2fbf..5dd1ed4 100644 (file)
@@ -153,33 +153,41 @@ private:
         return S_OK;
     }
 
-    void InsertRecentItem(HMENU hMenu, UINT nID, INT csidl, BOOL bExpand) const
+    void AddOrSetMenuItem(HMENU hMenu, UINT nID, INT csidl, BOOL bExpand,
+                          BOOL bAdd = TRUE, BOOL bSetText = TRUE) const
     {
-        WCHAR szPath[MAX_PATH];
-        if (!SHGetSpecialFolderPathW(NULL, szPath, csidl, FALSE))
+        MENUITEMINFOW mii = { sizeof(mii), MIIM_ID | MIIM_SUBMENU };
+        mii.wID = nID;
+
+        SHFILEINFOW fileInfo = { 0 };
+        if (bAdd || bSetText)
         {
-            ERR("SHGetSpecialFolderPathW failed\n");
-            return;
+            LPITEMIDLIST pidl;
+            if (SHGetSpecialFolderLocation(NULL, csidl, &pidl) != S_OK)
+            {
+                ERR("SHGetSpecialFolderLocation failed\n");
+                return;
+            }
+
+            SHGetFileInfoW((LPWSTR)pidl, 0, &fileInfo, sizeof(fileInfo),
+                           SHGFI_PIDL | SHGFI_DISPLAYNAME);
+            CoTaskMemFree(pidl);
+
+            mii.fMask |= MIIM_TYPE;
+            mii.fType = MFT_STRING;
+            mii.dwTypeData = fileInfo.szDisplayName;
         }
 
-        LPWSTR pszText = PathFindFileNameW(szPath);
         if (bExpand)
-        {
-            MENUITEMINFOW mii = { sizeof(mii), MIIM_TYPE | MIIM_ID | MIIM_SUBMENU };
-            mii.fType = MFT_STRING;
-            mii.wID = nID;
             mii.hSubMenu = ::CreatePopupMenu();
-            mii.dwTypeData = pszText;
-            mii.cch = lstrlenW(pszText);
+
+        if (bAdd)
             InsertMenuItemW(hMenu, GetMenuItemCount(hMenu), TRUE, &mii);
-        }
         else
-        {
-            AppendMenuW(hMenu, MF_STRING | MF_ENABLED, nID, pszText);
-        }
+            SetMenuItemInfoW(hMenu, nID, FALSE, &mii);
     }
 
-    BOOL GetAdvancedValue(LPCWSTR pszName, BOOL bDefault) const
+    BOOL GetAdvancedValue(LPCWSTR pszName, BOOL bDefault = FALSE) const
     {
         return SHRegGetBoolUSValueW(
             L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
@@ -191,17 +199,56 @@ private:
         BOOL bExpandMyDocuments = GetAdvancedValue(L"CascadeMyDocuments", FALSE);
         BOOL bExpandMyPictures = GetAdvancedValue(L"CascadeMyPictures", FALSE);
         HMENU hMenu = ::CreateMenu();
-        InsertRecentItem(hMenu, IDM_MYDOCUMENTS, CSIDL_MYDOCUMENTS, bExpandMyDocuments);
-        InsertRecentItem(hMenu, IDM_MYPICTURES, CSIDL_MYPICTURES, bExpandMyPictures);
+        AddOrSetMenuItem(hMenu, IDM_MYDOCUMENTS, CSIDL_MYDOCUMENTS, bExpandMyDocuments);
+        AddOrSetMenuItem(hMenu, IDM_MYPICTURES, CSIDL_MYPICTURES, bExpandMyPictures);
         AppendMenuW(hMenu, MF_SEPARATOR, 0, NULL);
         return hMenu;
     }
 
+    void UpdateSettingsMenu(HMENU hMenu)
+    {
+        BOOL bExpand;
+
+        bExpand = GetAdvancedValue(L"CascadeControlPanel");
+        AddOrSetMenuItem(hMenu, IDM_CONTROLPANEL, CSIDL_CONTROLS, bExpand, FALSE, FALSE);
+
+        bExpand = GetAdvancedValue(L"CascadeNetworkConnections");
+        AddOrSetMenuItem(hMenu, IDM_NETWORKCONNECTIONS, CSIDL_NETWORK, bExpand, FALSE, FALSE);
+
+        bExpand = GetAdvancedValue(L"CascadePrinters");
+        AddOrSetMenuItem(hMenu, IDM_PRINTERSANDFAXES, CSIDL_PRINTERS, bExpand, FALSE, FALSE);
+    }
+
+    HRESULT AddStartMenuItems(IShellMenu *pShellMenu, INT csidl, DWORD dwFlags)
+    {
+        LPITEMIDLIST pidlMenu;
+        CComPtr<IShellFolder> psfDesktop;
+        CComPtr<IShellFolder> pShellFolder;
+        HRESULT hr;
+
+        hr = SHGetFolderLocation(NULL, csidl, 0, 0, &pidlMenu);
+        if (FAILED_UNEXPECTEDLY(hr))
+            return hr;
+
+        hr = SHGetDesktopFolder(&psfDesktop);
+        if (FAILED_UNEXPECTEDLY(hr))
+            return hr;
+
+        hr = psfDesktop->BindToObject(pidlMenu, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
+        if (FAILED_UNEXPECTEDLY(hr))
+            return hr;
+
+        hr = pShellMenu->SetShellFolder(pShellFolder, NULL, NULL, dwFlags);
+        if (FAILED_UNEXPECTEDLY(hr))
+            return hr;
+
+        return hr;
+    }
+
     HRESULT OnGetSubMenu(LPSMDATA psmd, REFIID iid, void ** pv)
     {
         HRESULT hr;
-        int csidl = 0;
-        IShellMenu *pShellMenu;
+        CComPtr<IShellMenu> pShellMenu;
 
         hr = CMenuBand_CreateInstance(IID_PPV_ARG(IShellMenu, &pShellMenu));
         if (FAILED_UNEXPECTEDLY(hr))
@@ -211,71 +258,89 @@ private:
         if (FAILED_UNEXPECTEDLY(hr))
             return hr;
 
+        hr = E_FAIL;
         switch (psmd->uId)
         {
-        case IDM_PROGRAMS:  csidl = CSIDL_PROGRAMS; break;
-        case IDM_FAVORITES: csidl = CSIDL_FAVORITES; break;
-        case IDM_DOCUMENTS: csidl = CSIDL_RECENT; break;
-        case IDM_MYDOCUMENTS: csidl = CSIDL_MYDOCUMENTS; break;
-        case IDM_MYPICTURES: csidl = CSIDL_MYPICTURES; break;
-        }
+            case IDM_PROGRAMS:
+            {
+                if (m_psfPrograms)
+                    hr = pShellMenu->SetShellFolder(m_psfPrograms, NULL, NULL, SMSET_TOP);
+                break;
+            }
+            case IDM_FAVORITES:
+            {
+                hr = AddStartMenuItems(pShellMenu, CSIDL_FAVORITES, SMSET_TOP);
+                break;
+            }
+            case IDM_DOCUMENTS:
+            {
+                HMENU hMenu = CreateRecentMenu();
+                if (hMenu == NULL)
+                    ERR("CreateRecentMenu failed\n");
 
-        if (csidl)
-        {
-            IShellFolder *psfStartMenu;
-            DWORD dwFlags = SMSET_TOP;
+                hr = pShellMenu->SetMenu(hMenu, NULL, SMSET_BOTTOM);
+                if (FAILED_UNEXPECTEDLY(hr))
+                    return hr;
 
-            if (csidl == CSIDL_PROGRAMS && m_psfPrograms)
+                hr = AddStartMenuItems(pShellMenu, CSIDL_RECENT, SMSET_BOTTOM);
+                break;
+            }
+            case IDM_MYDOCUMENTS:
             {
-                psfStartMenu = m_psfPrograms;
+                hr = AddStartMenuItems(pShellMenu, CSIDL_MYDOCUMENTS, SMSET_TOP);
+                break;
             }
-            else
+            case IDM_MYPICTURES:
+            {
+                hr = AddStartMenuItems(pShellMenu, CSIDL_MYPICTURES, SMSET_TOP);
+                break;
+            }
+            case IDM_CONTROLPANEL:
+            {
+                hr = AddStartMenuItems(pShellMenu, CSIDL_CONTROLS, SMSET_TOP);
+                break;
+            }
+            case IDM_NETWORKCONNECTIONS:
             {
-                if (csidl == CSIDL_RECENT)
+                hr = AddStartMenuItems(pShellMenu, CSIDL_NETWORK, SMSET_TOP);
+                break;
+            }
+            case IDM_PRINTERSANDFAXES:
+            {
+                hr = AddStartMenuItems(pShellMenu, CSIDL_PRINTERS, SMSET_TOP);
+                break;
+            }
+            case IDM_SETTINGS:
+            {
+                MENUITEMINFOW mii = { sizeof(mii), MIIM_SUBMENU };
+                if (GetMenuItemInfoW(psmd->hmenu, psmd->uId, FALSE, &mii))
                 {
-                    HMENU hMenu = CreateRecentMenu();
-                    if (hMenu == NULL)
-                        ERR("CreateRecentMenu failed\n");
+                    UpdateSettingsMenu(mii.hSubMenu);
 
-                    hr = pShellMenu->SetMenu(hMenu, NULL, SMSET_BOTTOM);
+                    hr = pShellMenu->SetMenu(mii.hSubMenu, NULL, SMSET_BOTTOM);
                     if (FAILED_UNEXPECTEDLY(hr))
                         return hr;
-
-                    dwFlags = SMSET_BOTTOM;
                 }
-
-                LPITEMIDLIST pidlStartMenu;
-                IShellFolder *psfDestop;
-                hr = SHGetFolderLocation(NULL, csidl, 0, 0, &pidlStartMenu);
-                if (FAILED_UNEXPECTEDLY(hr))
-                    return hr;
-
-                hr = SHGetDesktopFolder(&psfDestop);
-                if (FAILED_UNEXPECTEDLY(hr))
-                    return hr;
-
-                hr = psfDestop->BindToObject(pidlStartMenu, NULL, IID_PPV_ARG(IShellFolder, &psfStartMenu));
-                if (FAILED_UNEXPECTEDLY(hr))
-                    return hr;
+                break;
             }
-
-            hr = pShellMenu->SetShellFolder(psfStartMenu, NULL, NULL, dwFlags);
-            if (FAILED_UNEXPECTEDLY(hr))
-                return hr;
-        }
-        else
-        {
-            MENUITEMINFO mii;
-            mii.cbSize = sizeof(mii);
-            mii.fMask = MIIM_SUBMENU;
-            if (GetMenuItemInfoW(psmd->hmenu, psmd->uId, FALSE, &mii))
+            default:
             {
-                hr = pShellMenu->SetMenu(mii.hSubMenu, NULL, SMSET_BOTTOM);
-                if (FAILED_UNEXPECTEDLY(hr))
-                    return hr;
+                MENUITEMINFOW mii = { sizeof(mii), MIIM_SUBMENU };
+                if (GetMenuItemInfoW(psmd->hmenu, psmd->uId, FALSE, &mii))
+                {
+                    hr = pShellMenu->SetMenu(mii.hSubMenu, NULL, SMSET_BOTTOM);
+                    if (FAILED_UNEXPECTEDLY(hr))
+                        return hr;
+                }
             }
         }
-        return pShellMenu->QueryInterface(iid, pv);
+
+        if (FAILED(hr))
+            return hr;
+
+        hr = pShellMenu->QueryInterface(iid, pv);
+        pShellMenu.Detach();
+        return hr;
     }
 
     HRESULT OnGetContextMenu(LPSMDATA psmd, REFIID iid, void ** pv)
index efbd539..0f42042 100644 (file)
 /* These values must be synchronized with explorer */
 #define IDS_ADVANCED_DISPLAY_FAVORITES              30466
 #define IDS_ADVANCED_DISPLAY_LOG_OFF                30467
+#define IDS_ADVANCED_EXPAND_CONTROL_PANEL           30468
 #define IDS_ADVANCED_EXPAND_MY_DOCUMENTS            30469
+#define IDS_ADVANCED_EXPAND_PRINTERS                30470
 #define IDS_ADVANCED_EXPAND_MY_PICTURES             30472
+#define IDS_ADVANCED_EXPAND_NET_CONNECTIONS         30473
 #define IDS_ADVANCED_DISPLAY_RUN                    30474
 #define IDS_ADVANCED_DISPLAY_ADMINTOOLS             30476