https://git.reactos.org/?p=reactos.git;a=commitdiff;h=be970d8d313e9af71990c…
commit be970d8d313e9af71990c8b6025e8fcfa2f0c1b6
Author: Tuur Martens <tuurmartens4(a)gmail.com>
AuthorDate: Thu Nov 3 13:48:18 2022 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Nov 3 15:48:18 2022 +0300
[EXPLORER] Implement "Undo Cascade/Tile" menu items (#4817)
Implement taskbar context menu items "Undo Cascade" and "Undo
Tile".
Based on patch by KRosUser.
CORE-18383
---
base/shell/explorer/lang/bg-BG.rc | 2 ++
base/shell/explorer/lang/cs-CZ.rc | 2 ++
base/shell/explorer/lang/de-DE.rc | 2 ++
base/shell/explorer/lang/en-US.rc | 2 ++
base/shell/explorer/lang/es-ES.rc | 2 ++
base/shell/explorer/lang/et-EE.rc | 2 ++
base/shell/explorer/lang/eu-ES.rc | 2 ++
base/shell/explorer/lang/fi-FI.rc | 2 ++
base/shell/explorer/lang/fr-FR.rc | 2 ++
base/shell/explorer/lang/he-IL.rc | 2 ++
base/shell/explorer/lang/hi-IN.rc | 2 ++
base/shell/explorer/lang/hu-HU.rc | 2 ++
base/shell/explorer/lang/id-ID.rc | 2 ++
base/shell/explorer/lang/it-IT.rc | 2 ++
base/shell/explorer/lang/ja-JP.rc | 2 ++
base/shell/explorer/lang/ko-KR.rc | 2 ++
base/shell/explorer/lang/lt-LT.rc | 2 ++
base/shell/explorer/lang/ms-MY.rc | 2 ++
base/shell/explorer/lang/nl-NL.rc | 2 ++
base/shell/explorer/lang/no-NO.rc | 2 ++
base/shell/explorer/lang/pl-PL.rc | 2 ++
base/shell/explorer/lang/pt-BR.rc | 2 ++
base/shell/explorer/lang/pt-PT.rc | 2 ++
base/shell/explorer/lang/ro-RO.rc | 2 ++
base/shell/explorer/lang/ru-RU.rc | 2 ++
base/shell/explorer/lang/sk-SK.rc | 2 ++
base/shell/explorer/lang/sq-AL.rc | 2 ++
base/shell/explorer/lang/tr-TR.rc | 2 ++
base/shell/explorer/lang/uk-UA.rc | 2 ++
base/shell/explorer/lang/zh-CN.rc | 2 ++
base/shell/explorer/lang/zh-HK.rc | 2 ++
base/shell/explorer/lang/zh-TW.rc | 2 ++
base/shell/explorer/resource.h | 2 ++
base/shell/explorer/traywnd.cpp | 75 +++++++++++++++++++++++++++++++++++++++
34 files changed, 141 insertions(+)
diff --git a/base/shell/explorer/lang/bg-BG.rc b/base/shell/explorer/lang/bg-BG.rc
index da3edd651d9..d9d1ff619c9 100644
--- a/base/shell/explorer/lang/bg-BG.rc
+++ b/base/shell/explorer/lang/bg-BG.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Лента със задачи и Старт меню"
IDS_RESTORE_ALL "&Покажи отворените прозорци"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/cs-CZ.rc b/base/shell/explorer/lang/cs-CZ.rc
index 27260f5a654..5890a4583de 100644
--- a/base/shell/explorer/lang/cs-CZ.rc
+++ b/base/shell/explorer/lang/cs-CZ.rc
@@ -201,4 +201,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Vlastnosti hlavního panelu a Start
menu"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/de-DE.rc b/base/shell/explorer/lang/de-DE.rc
index e24726f74d7..55a62189cd1 100644
--- a/base/shell/explorer/lang/de-DE.rc
+++ b/base/shell/explorer/lang/de-DE.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Taskleisten- und
Startmenüeinstellungen"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/en-US.rc b/base/shell/explorer/lang/en-US.rc
index 7bb22c452c1..2fd043fd994 100644
--- a/base/shell/explorer/lang/en-US.rc
+++ b/base/shell/explorer/lang/en-US.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Taskbar and Start Menu"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/es-ES.rc b/base/shell/explorer/lang/es-ES.rc
index e10343ebd6b..1626c620650 100644
--- a/base/shell/explorer/lang/es-ES.rc
+++ b/base/shell/explorer/lang/es-ES.rc
@@ -207,4 +207,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Propiedades de la Barra de tareas y del Menú
Inicio"
IDS_RESTORE_ALL "&Mostrar ventanas abiertas"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/et-EE.rc b/base/shell/explorer/lang/et-EE.rc
index e4e894120fe..4769d34e826 100644
--- a/base/shell/explorer/lang/et-EE.rc
+++ b/base/shell/explorer/lang/et-EE.rc
@@ -202,4 +202,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Tegumiriba ja Menüü Start"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/eu-ES.rc b/base/shell/explorer/lang/eu-ES.rc
index 5658396e712..6a29c041c51 100644
--- a/base/shell/explorer/lang/eu-ES.rc
+++ b/base/shell/explorer/lang/eu-ES.rc
@@ -202,4 +202,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Ataza-barra eta Hasi menuaren
propietateak"
IDS_RESTORE_ALL "E&rakutsi irekitako leihoak"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/fi-FI.rc b/base/shell/explorer/lang/fi-FI.rc
index b564f3a6b2e..ce29db6b61b 100644
--- a/base/shell/explorer/lang/fi-FI.rc
+++ b/base/shell/explorer/lang/fi-FI.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Tehtäväpalkki ja Käynnistä Valikko"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/fr-FR.rc b/base/shell/explorer/lang/fr-FR.rc
index b667d86a89e..5323bf42d94 100644
--- a/base/shell/explorer/lang/fr-FR.rc
+++ b/base/shell/explorer/lang/fr-FR.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Barre des tâches et Menu Démarrer"
IDS_RESTORE_ALL "&Afficher les fenêtres ouvertes"
+ IDS_TRAYWND_UNDO_CASCADE "Ann&uler cascade"
+ IDS_TRAYWND_UNDO_TILE "Ann&uler mosaïque"
END
diff --git a/base/shell/explorer/lang/he-IL.rc b/base/shell/explorer/lang/he-IL.rc
index dbe1a5d6c27..a3765b9ed9c 100644
--- a/base/shell/explorer/lang/he-IL.rc
+++ b/base/shell/explorer/lang/he-IL.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "שורת המשימות ושולחן העבודה"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/hi-IN.rc b/base/shell/explorer/lang/hi-IN.rc
index d503dcac0cd..7238f7c0793 100644
--- a/base/shell/explorer/lang/hi-IN.rc
+++ b/base/shell/explorer/lang/hi-IN.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "टास्कबार और स्टार्ट मेनू"
IDS_RESTORE_ALL "खुले हुऐ विंडोज &दिखाएं"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/hu-HU.rc b/base/shell/explorer/lang/hu-HU.rc
index 4ed7ff57c4a..8f236550e4a 100644
--- a/base/shell/explorer/lang/hu-HU.rc
+++ b/base/shell/explorer/lang/hu-HU.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Tálca és Start menü"
IDS_RESTORE_ALL "&Megnyitott ablakok megjelenítése"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/id-ID.rc b/base/shell/explorer/lang/id-ID.rc
index 835f8b34823..154cdbd6b1d 100644
--- a/base/shell/explorer/lang/id-ID.rc
+++ b/base/shell/explorer/lang/id-ID.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Bilah Tugas dan Menu Mulai"
IDS_RESTORE_ALL "&Tampilkan Semua Jendela"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/it-IT.rc b/base/shell/explorer/lang/it-IT.rc
index f58f97c5401..7df443353af 100644
--- a/base/shell/explorer/lang/it-IT.rc
+++ b/base/shell/explorer/lang/it-IT.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Proprietà della Barra delle applicazioni e
del Menú di avvio"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/ja-JP.rc b/base/shell/explorer/lang/ja-JP.rc
index 8a6d03e7b5e..8bb0f845ea7 100644
--- a/base/shell/explorer/lang/ja-JP.rc
+++ b/base/shell/explorer/lang/ja-JP.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "タスクバーとスタートメニュー"
IDS_RESTORE_ALL "開いているウィンドウを表示(&S)"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/ko-KR.rc b/base/shell/explorer/lang/ko-KR.rc
index a54b4939977..a6e88008126 100644
--- a/base/shell/explorer/lang/ko-KR.rc
+++ b/base/shell/explorer/lang/ko-KR.rc
@@ -203,4 +203,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "작업 표시줄 및 시작 메뉴"
IDS_RESTORE_ALL "열린 창 보기(&S)"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/lt-LT.rc b/base/shell/explorer/lang/lt-LT.rc
index 49ff5d70832..05645847a0e 100644
--- a/base/shell/explorer/lang/lt-LT.rc
+++ b/base/shell/explorer/lang/lt-LT.rc
@@ -198,4 +198,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Taskbar and Start Menu"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/ms-MY.rc b/base/shell/explorer/lang/ms-MY.rc
index 40d5a92bc1c..40cd9d8440c 100644
--- a/base/shell/explorer/lang/ms-MY.rc
+++ b/base/shell/explorer/lang/ms-MY.rc
@@ -197,4 +197,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Bar Tugas dan Menu Mula"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/nl-NL.rc b/base/shell/explorer/lang/nl-NL.rc
index d9c52184c71..7434245e6c2 100644
--- a/base/shell/explorer/lang/nl-NL.rc
+++ b/base/shell/explorer/lang/nl-NL.rc
@@ -195,4 +195,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Taakbalk en menu Start eigenschappen"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/no-NO.rc b/base/shell/explorer/lang/no-NO.rc
index 7cde4dc6f64..fcdb0042501 100644
--- a/base/shell/explorer/lang/no-NO.rc
+++ b/base/shell/explorer/lang/no-NO.rc
@@ -196,4 +196,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Egenskaper for oppgavelinjen og
startmeny"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/pl-PL.rc b/base/shell/explorer/lang/pl-PL.rc
index a36a7168de1..61ff49d92ee 100644
--- a/base/shell/explorer/lang/pl-PL.rc
+++ b/base/shell/explorer/lang/pl-PL.rc
@@ -206,4 +206,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Paska zadań i menu Start"
IDS_RESTORE_ALL "&Pokaż otwarte okna"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/pt-BR.rc b/base/shell/explorer/lang/pt-BR.rc
index 1ee4135c8cb..f9106431638 100644
--- a/base/shell/explorer/lang/pt-BR.rc
+++ b/base/shell/explorer/lang/pt-BR.rc
@@ -197,4 +197,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Propriedades do Barra de Tarefas e Menu
Iniciar"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/pt-PT.rc b/base/shell/explorer/lang/pt-PT.rc
index 94107915b1a..bbc370a3ca2 100644
--- a/base/shell/explorer/lang/pt-PT.rc
+++ b/base/shell/explorer/lang/pt-PT.rc
@@ -197,4 +197,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Barra de Tarefas e Menu Iniciar"
IDS_RESTORE_ALL "&Mostrar janelas abertas"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/ro-RO.rc b/base/shell/explorer/lang/ro-RO.rc
index a8d609c58f6..3b3ec3c16be 100644
--- a/base/shell/explorer/lang/ro-RO.rc
+++ b/base/shell/explorer/lang/ro-RO.rc
@@ -197,4 +197,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Bara de activități și meniul
„Pornire”"
IDS_RESTORE_ALL "&Afișează ferestrele deschise"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/ru-RU.rc b/base/shell/explorer/lang/ru-RU.rc
index 15ad76a321a..f82251a6ade 100644
--- a/base/shell/explorer/lang/ru-RU.rc
+++ b/base/shell/explorer/lang/ru-RU.rc
@@ -197,4 +197,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Меню ""Пуск"" и панель
задач"
IDS_RESTORE_ALL "&Показать окна"
+ IDS_TRAYWND_UNDO_CASCADE "&Отменить Каскадом"
+ IDS_TRAYWND_UNDO_TILE "&Отменить Окна рядом"
END
diff --git a/base/shell/explorer/lang/sk-SK.rc b/base/shell/explorer/lang/sk-SK.rc
index 90e30583a8e..8e3606ba092 100644
--- a/base/shell/explorer/lang/sk-SK.rc
+++ b/base/shell/explorer/lang/sk-SK.rc
@@ -200,4 +200,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Vlastnosti panela úloh a ponuky Štart"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/sq-AL.rc b/base/shell/explorer/lang/sq-AL.rc
index 9f7d14d2f7f..8941c1ed26e 100644
--- a/base/shell/explorer/lang/sq-AL.rc
+++ b/base/shell/explorer/lang/sq-AL.rc
@@ -199,4 +199,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Taskbar dhe Start Menu"
IDS_RESTORE_ALL "&Show Open Windows"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/tr-TR.rc b/base/shell/explorer/lang/tr-TR.rc
index deec41b8be8..bea911fbb3e 100644
--- a/base/shell/explorer/lang/tr-TR.rc
+++ b/base/shell/explorer/lang/tr-TR.rc
@@ -200,4 +200,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Görev Çubuğu ve Başlat Menüsü"
IDS_RESTORE_ALL "&Açık Pencereleri Göster"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/uk-UA.rc b/base/shell/explorer/lang/uk-UA.rc
index 03fbaa8b7cf..b5327772944 100644
--- a/base/shell/explorer/lang/uk-UA.rc
+++ b/base/shell/explorer/lang/uk-UA.rc
@@ -203,4 +203,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "Властивості меню Пуск та Панелі
завдань"
IDS_RESTORE_ALL "&Показати відкриті вікна"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/zh-CN.rc b/base/shell/explorer/lang/zh-CN.rc
index 942fc5bf07d..d1807953dc0 100644
--- a/base/shell/explorer/lang/zh-CN.rc
+++ b/base/shell/explorer/lang/zh-CN.rc
@@ -204,4 +204,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "任务栏和开始菜单属性"
IDS_RESTORE_ALL "显示打开的窗口(&S)"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/zh-HK.rc b/base/shell/explorer/lang/zh-HK.rc
index bae35d9a71e..03f8db4bb15 100644
--- a/base/shell/explorer/lang/zh-HK.rc
+++ b/base/shell/explorer/lang/zh-HK.rc
@@ -203,4 +203,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "工作列及開始功能表"
IDS_RESTORE_ALL "顯示開啟的視窗(&S)"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/lang/zh-TW.rc b/base/shell/explorer/lang/zh-TW.rc
index 6ab16e00f72..741d85f0ce5 100644
--- a/base/shell/explorer/lang/zh-TW.rc
+++ b/base/shell/explorer/lang/zh-TW.rc
@@ -204,4 +204,6 @@ STRINGTABLE
BEGIN
IDS_TASKBAR_STARTMENU_PROP_CAPTION "工作列及開始功能表"
IDS_RESTORE_ALL "顯示開啟的視窗(&S)"
+ IDS_TRAYWND_UNDO_CASCADE "&Undo Cascade"
+ IDS_TRAYWND_UNDO_TILE "&Undo Tile"
END
diff --git a/base/shell/explorer/resource.h b/base/shell/explorer/resource.h
index 5265eb15618..2ff1e6b4e5f 100644
--- a/base/shell/explorer/resource.h
+++ b/base/shell/explorer/resource.h
@@ -102,6 +102,8 @@
#define IDS_HELP_COMMAND 732
#define IDS_TASKBAR_STARTMENU_PROP_CAPTION 810
#define IDS_RESTORE_ALL 811
+#define IDS_TRAYWND_UNDO_CASCADE 812
+#define IDS_TRAYWND_UNDO_TILE 813
/*******************************************************************************\
|* Control Resources *|
diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp
index 75023294696..ca930e56e55 100644
--- a/base/shell/explorer/traywnd.cpp
+++ b/base/shell/explorer/traywnd.cpp
@@ -58,6 +58,47 @@ void appbar_notify_all(HMONITOR hMon, UINT uMsg, HWND hwndExclude,
LPARAM lParam
static const WCHAR szTrayWndClass[] = L"Shell_TrayWnd";
+enum { NONE, TILED, CASCADED } g_Arrangement = NONE;
+
+struct WINDOWPOSBACKUPDATA
+{
+ HWND hwnd;
+ WINDOWPLACEMENT wplt;
+};
+CSimpleArray<WINDOWPOSBACKUPDATA> g_WindowPosBackup;
+
+static BOOL CALLBACK BackupWindowsPosProc(HWND hwnd, LPARAM lParam)
+{
+ WINDOWPOSBACKUPDATA wposdata;
+ HWND hDesk = GetDesktopWindow();
+ if (IsWindowVisible(hwnd) && !IsIconic(hwnd) && (hwnd != hDesk))
+ {
+ wposdata.hwnd = hwnd;
+ wposdata.wplt.length = sizeof(wposdata.wplt);
+ GetWindowPlacement(hwnd, &(wposdata.wplt));
+ g_WindowPosBackup.Add(wposdata);
+ }
+
+ return TRUE;
+}
+
+VOID BackupWindowPos()
+{
+ EnumWindows(BackupWindowsPosProc, NULL);
+}
+
+VOID RestoreWindowPos()
+{
+ g_Arrangement = NONE;
+
+ for (INT i = g_WindowPosBackup.GetSize() - 1; i >= 0; --i)
+ {
+ SetWindowPlacement(g_WindowPosBackup[i].hwnd, &(g_WindowPosBackup[i].wplt));
+ }
+
+ g_WindowPosBackup.RemoveAll();
+}
+
struct EFFECTIVE_INFO
{
HWND hwndFound;
@@ -805,6 +846,7 @@ public:
break;
case ID_SHELL_CMD_UNDO_ACTION:
+ RestoreWindowPos();
break;
case ID_SHELL_CMD_SHOW_DESKTOP:
@@ -813,20 +855,35 @@ public:
case ID_SHELL_CMD_TILE_WND_H:
appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE);
+ if (g_Arrangement == NONE)
+ {
+ BackupWindowPos();
+ }
TileWindows(NULL, MDITILE_HORIZONTAL, NULL, 0, NULL);
appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE);
+ g_Arrangement = TILED;
break;
case ID_SHELL_CMD_TILE_WND_V:
appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE);
+ if (g_Arrangement == NONE)
+ {
+ BackupWindowPos();
+ }
TileWindows(NULL, MDITILE_VERTICAL, NULL, 0, NULL);
appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE);
+ g_Arrangement = TILED;
break;
case ID_SHELL_CMD_CASCADE_WND:
appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE);
+ if (g_Arrangement == NONE)
+ {
+ BackupWindowPos();
+ }
CascadeWindows(NULL, MDITILE_SKIPDISABLED, NULL, 0, NULL);
appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE);
+ g_Arrangement = CASCADED;
break;
case ID_SHELL_CMD_CUST_NOTIF:
@@ -3281,12 +3338,30 @@ HandleTrayContextMenu:
::EnableMenuItem(hMenu, ID_SHELL_CMD_CASCADE_WND, MF_BYCOMMAND |
MF_ENABLED);
::EnableMenuItem(hMenu, ID_SHELL_CMD_TILE_WND_H, MF_BYCOMMAND | MF_ENABLED);
::EnableMenuItem(hMenu, ID_SHELL_CMD_TILE_WND_V, MF_BYCOMMAND | MF_ENABLED);
+ if (g_Arrangement != NONE)
+ {
+ CStringW strCaption((g_Arrangement == TILED) ?
MAKEINTRESOURCEW(IDS_TRAYWND_UNDO_TILE)
+ :
MAKEINTRESOURCEW(IDS_TRAYWND_UNDO_CASCADE));
+ MENUITEMINFOW mii = { sizeof(mii) };
+ ::GetMenuItemInfoW(hMenu, ID_SHELL_CMD_UNDO_ACTION, FALSE, &mii);
+ mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_STRING;
+ mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
+ ::SetMenuItemInfoW(hMenu, ID_SHELL_CMD_UNDO_ACTION, FALSE, &mii);
+ }
+ else
+ {
+ ::DeleteMenu(hMenu, ID_SHELL_CMD_UNDO_ACTION, MF_BYCOMMAND);
+ }
}
else
{
::EnableMenuItem(hMenu, ID_SHELL_CMD_CASCADE_WND, MF_BYCOMMAND | MF_GRAYED);
::EnableMenuItem(hMenu, ID_SHELL_CMD_TILE_WND_H, MF_BYCOMMAND | MF_GRAYED);
::EnableMenuItem(hMenu, ID_SHELL_CMD_TILE_WND_V, MF_BYCOMMAND | MF_GRAYED);
+ ::DeleteMenu(hMenu, ID_SHELL_CMD_UNDO_ACTION, MF_BYCOMMAND);
+ g_Arrangement = NONE;
+ g_WindowPosBackup.RemoveAll();
}
return 0;
}