[EXPLORER] -Implement The "Add...", "Advanced" and "Clear" buttons of the Startmenu...
authorRobert Naumann <gonzomdx@gmail.com>
Sun, 22 Nov 2015 09:28:45 +0000 (09:28 +0000)
committerRobert Naumann <gonzomdx@gmail.com>
Sun, 22 Nov 2015 09:28:45 +0000 (09:28 +0000)
-Enable some controls that shouldn't be disabled -> Spotted by Jared
-Yesterday I heard the whispered word "alphabet", correctly order file/fuction names

svn path=/trunk/; revision=70001

reactos/base/shell/explorer/CMakeLists.txt
reactos/base/shell/explorer/lang/en-US.rc
reactos/base/shell/explorer/lang/ms-MY.rc
reactos/base/shell/explorer/precomp.h
reactos/base/shell/explorer/startmnucust.cpp

index d7fead8..6640d9e 100644 (file)
@@ -12,8 +12,8 @@ list(APPEND SOURCE
     shellservice.cpp
     startctxmnu.cpp
     startmnu.cpp
-    startmnusite.cpp
     startmnucust.cpp
+    startmnusite.cpp
     startup.cpp
     taskband.cpp
     taskswnd.cpp
index 4ea1b32..456e0a3 100644 (file)
@@ -92,9 +92,9 @@ BEGIN
     AUTORADIOBUTTON "&Start menu", IDC_TASKBARPROP_STARTMENU, 7, 135, 105, 10, WS_DISABLED
     LTEXT "This menu style gives you easy access to your folders, favorite programs, and search.", IDC_STATIC, 20, 145, 150, 24, WS_DISABLED
     PUSHBUTTON "&Customize...", IDC_TASKBARPROP_STARTMENUCUST, 192, 132, 53, 14, WS_DISABLED
-    AUTORADIOBUTTON "Classic Start &menu", IDC_TASKBARPROP_STARTMENUCLASSIC, 7, 175, 105, 10, WS_DISABLED
-    LTEXT "This menu style gives you the classic look and functionality", IDC_STATIC, 20, 185, 150, 24, WS_DISABLED
-    PUSHBUTTON "&Customize...", IDC_TASKBARPROP_STARTMENUCLASSICCUST, 192, 172, 53, 14, WS_DISABLED    
+    AUTORADIOBUTTON "Classic Start &menu", IDC_TASKBARPROP_STARTMENUCLASSIC, 7, 175, 105, 10
+    LTEXT "This menu style gives you the classic look and functionality", IDC_STATIC, 20, 185, 150, 24
+    PUSHBUTTON "&Customize...", IDC_TASKBARPROP_STARTMENUCLASSICCUST, 192, 172, 53, 14    
 END
 
 IDD_NOTIFICATIONS_CUSTOMIZE DIALOGEX 0, 0, 232, 240
index 6747894..6b5d0f3 100644 (file)
@@ -94,9 +94,9 @@ BEGIN
     AUTORADIOBUTTON "Menu Mula(&S)", IDC_TASKBARPROP_STARTMENU, 7, 135, 105, 10, WS_DISABLED
     LTEXT "Gaya menu ini memberikan anda akses ke folder, programs kegemaran anda, dan cari fail anda.", IDC_STATIC, 20, 145, 150, 24, WS_DISABLED
     PUSHBUTTON "Suaikan...(&C)", IDC_TASKBARPROP_STARTMENUCUST, 192, 132, 53, 14, WS_DISABLED
-    AUTORADIOBUTTON "Klasik &menu mula", IDC_TASKBARPROP_STARTMENUCLASSIC, 7, 175, 105, 10, WS_DISABLED
-    LTEXT "Gaya menu ini memberikan anda lihat klasik dan berfungsi", IDC_STATIC, 20, 185, 150, 24, WS_DISABLED
-    PUSHBUTTON "Suaikan...(&C)", IDC_TASKBARPROP_STARTMENUCLASSICCUST, 192, 172, 53, 14, WS_DISABLED    
+    AUTORADIOBUTTON "Klasik &menu mula", IDC_TASKBARPROP_STARTMENUCLASSIC, 7, 175, 105, 10
+    LTEXT "Gaya menu ini memberikan anda lihat klasik dan berfungsi", IDC_STATIC, 20, 185, 150, 24
+    PUSHBUTTON "Suaikan...(&C)", IDC_TASKBARPROP_STARTMENUCLASSICCUST, 192, 172, 53, 14    
 END
 
 IDD_NOTIFICATIONS_CUSTOMIZE DIALOGEX 0, 0, 232, 240
index c137349..d181a14 100644 (file)
@@ -308,6 +308,12 @@ OUT IMenuBand **ppMenuBand,
 IN HBITMAP hbmBanner  OPTIONAL,
 IN BOOL bSmallIcons);
 
+/*
+ * startmnucust.cpp
+ */
+VOID 
+ShowCustomizeClassic(HINSTANCE, HWND);
+
 /*
 * startmnusite.cpp
 */
@@ -315,12 +321,6 @@ IN BOOL bSmallIcons);
 HRESULT 
 CreateStartMenuSite(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv);
 
-/*
- * startmnucust.cpp
- */
-VOID 
-ShowCustomizeClassic(HINSTANCE, HWND);
-
 /*
  * trayntfy.c
  */
index e1d5e5f..5d542f6 100644 (file)
@@ -2,7 +2,7 @@
  * ReactOS Explorer
  *
  * Copyright 2006 - 2007 Thomas Weidenmueller <w3seek@reactos.org>
- *                  2015 Robert Naumann <gonzomdx@gmail.com|
+ *                  2015 Robert Naumann <gonzomdx@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  
 #include "precomp.h"
 
+VOID OnAddStartmenuItems(HWND hDlg)
+{
+    WCHAR szPath[MAX_PATH];
+
+    if(SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_STARTMENU, NULL, 0, szPath))) 
+    {
+        WCHAR szCommand[MAX_PATH] = L"appwiz.cpl,NewLinkHere ";
+        if(SUCCEEDED(StringCchCatW(szCommand, MAX_PATH, szPath)))
+            ShellExecuteW(hDlg, L"open", L"rundll32.exe", szCommand, NULL, SW_SHOWNORMAL);
+    }
+}
+
+VOID OnAdvancedStartMenuItems()
+{
+    WCHAR szPath[MAX_PATH];
+
+    if(SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_STARTMENU, NULL, 0, szPath))) 
+    {
+        ShellExecuteW(NULL, L"explore", szPath, NULL, NULL, SW_SHOWNORMAL);
+    }
+}
+
+VOID OnClearRecentItems()
+{
+   WCHAR szPath[MAX_PATH], szFile[MAX_PATH];
+   WIN32_FIND_DATA info;
+   HANDLE hPath;
+
+    if(SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_RECENT, NULL, 0, szPath))) 
+    {
+        StringCchPrintf(szFile,MAX_PATH, L"%s\\*.*", szPath);
+        hPath = FindFirstFileW(szFile, &info);
+        do
+        {
+            StringCchPrintf(szFile,MAX_PATH, L"%s\\%s", szPath, info.cFileName);
+            DeleteFileW(szFile);
+        }while(FindNextFileW(hPath, &info)); 
+        FindClose(hPath);
+        /* FIXME: Disable the button*/
+    } 
+}
+
 BOOL CALLBACK CustomizeClassicProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 {
     switch(Message)
     {
         case WM_INITDIALOG:
-
+            /* FIXME: Properly intialize the dialog (check whether 'clear' button must be disabled, for example) */
         return TRUE;
         case WM_COMMAND:
             switch(LOWORD(wParam))
             {
+                case IDC_CLASSICSTART_ADD:
+                    OnAddStartmenuItems(hwnd);
+                break;
+                case IDC_CLASSICSTART_ADVANCED:
+                    OnAdvancedStartMenuItems();
+                break;
+                case IDC_CLASSICSTART_CLEAR:
+                    OnClearRecentItems();
+                break;
                 case IDOK:
                     EndDialog(hwnd, IDOK);
                 break;