Author: rnaumann
Date: Wed Mar 29 18:37:06 2017
New Revision: 74243

URL: http://svn.reactos.org/svn/reactos?rev=74243&view=rev
Log:
[EXPLORER] -implement showing the start menu preview

Modified:
    trunk/reactos/base/shell/explorer/explorer.rc
    trunk/reactos/base/shell/explorer/trayprop.cpp

Modified: trunk/reactos/base/shell/explorer/explorer.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explorer.rc?rev=74243&r1=74242&r2=74243&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/explorer.rc       [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/explorer.rc       [iso-8859-1] Wed Mar 29 
18:37:06 2017
@@ -51,6 +51,7 @@
 IDB_SYSTRAYPROP_SHOW_SECONDS        BITMAP "res/bmp/154.bmp"
 IDB_SYSTRAYPROP_HIDE_SECONDS        BITMAP "res/bmp/155.bmp"
 IDB_STARTMENU                       BITMAP "res/bmp/158.bmp"
+IDB_STARTPREVIEW                    BITMAP "res/bmp/171.bmp" // We don't have 
a proper preview image for the modern start menu yet. Use the classic one so 
far.
 IDB_STARTPREVIEW_CLASSIC            BITMAP "res/bmp/171.bmp"
 IDB_SYSTRAYPROP_HIDE_CLOCK          BITMAP "res/bmp/180.bmp"
 IDB_SYSTRAYPROP_HIDE_NOCLOCK        BITMAP "res/bmp/181.bmp"

Modified: trunk/reactos/base/shell/explorer/trayprop.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/trayprop.cpp?rev=74243&r1=74242&r2=74243&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer/trayprop.cpp      [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/trayprop.cpp      [iso-8859-1] Wed Mar 29 
18:37:06 2017
@@ -28,17 +28,18 @@
 
     HBITMAP hTaskbarBitmap;
     HBITMAP hTrayBitmap;
+    HBITMAP hStartBitmap;
 } PROPSHEET_INFO, *PPROPSHEET_INFO;
 
 
 static BOOL
-UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo)
-{
-    HWND hwndLock, hwndHide, hwndGroup, hwndShowQL, hwndClock, hwndSeconds, 
hwndHideInactive;
-    HWND hwndTaskbarBitmap, hwndTrayBitmap;
-    HWND hwndAdvancedButton;
+UpdateBitmaps(PPROPSHEET_INFO pPropInfo)
+{
+    HWND hwndLock, hwndHide, hwndGroup, hwndShowQL, hwndClock, hwndSeconds, 
hwndHideInactive, hwndModernStart, hwndClassicStart;
+    HWND hwndTaskbarBitmap, hwndTrayBitmap, hwndStartBitmap;
+    HWND hwndCustomizeNotifyButton, hwndCustomizeClassicStartButton, 
hwndCustomizeModernStartButton;
     BOOL bLock, bHide, bGroup, bShowQL, bShowClock, bShowSeconds, 
bHideInactive;
-    LPTSTR lpTaskBarImageName = NULL, lpTrayImageName = NULL;
+    LPTSTR lpTaskBarImageName = NULL, lpTrayImageName = NULL, lpStartImageName 
= NULL;
     BOOL bRet = FALSE;
 
     hwndLock = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_LOCK);
@@ -50,7 +51,15 @@
     hwndSeconds = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_SECONDS);
     hwndHideInactive = GetDlgItem(pPropInfo->hTaskbarWnd, 
IDC_TASKBARPROP_HIDEICONS);
     
-    hwndAdvancedButton = GetDlgItem(pPropInfo->hTaskbarWnd, 
IDC_TASKBARPROP_ICONCUST);
+    hwndCustomizeNotifyButton = GetDlgItem(pPropInfo->hTaskbarWnd, 
IDC_TASKBARPROP_ICONCUST);
+    
+    hwndModernStart = GetDlgItem(pPropInfo->hStartWnd, 
IDC_TASKBARPROP_STARTMENU);
+    hwndClassicStart = GetDlgItem(pPropInfo->hStartWnd, 
IDC_TASKBARPROP_STARTMENUCLASSIC);
+    
+    hwndCustomizeClassicStartButton = GetDlgItem(pPropInfo->hTaskbarWnd, 
IDC_TASKBARPROP_STARTMENUCLASSICCUST);
+    hwndCustomizeModernStartButton = GetDlgItem(pPropInfo->hTaskbarWnd, 
IDC_TASKBARPROP_STARTMENUCUST);
+    
+    
 
     if (hwndLock && hwndHide && hwndGroup && hwndShowQL && hwndClock && 
hwndSeconds && hwndHideInactive)
     {
@@ -112,7 +121,7 @@
         
         if (bHideInactive)
         {
-            EnableWindow(hwndAdvancedButton, TRUE);
+            EnableWindow(hwndCustomizeNotifyButton, TRUE);
             if (bShowClock)
             {
                 EnableWindow(hwndSeconds, TRUE);
@@ -130,7 +139,7 @@
         }
         else
         {
-            EnableWindow(hwndAdvancedButton, FALSE);
+            EnableWindow(hwndCustomizeNotifyButton, FALSE);
             if (bShowClock)
             {
                 EnableWindow(hwndSeconds, TRUE);
@@ -174,6 +183,49 @@
             }
         }
     }
+    
+    if(hwndClassicStart && hwndModernStart)
+    {
+        if(SendMessage(hwndModernStart, BM_GETCHECK, 0, 0) == BST_CHECKED)
+        {
+            EnableWindow(hwndCustomizeModernStartButton, TRUE);
+            EnableWindow(hwndCustomizeClassicStartButton, FALSE);
+            lpStartImageName = MAKEINTRESOURCEW(IDB_STARTPREVIEW);
+        }
+        else
+        {
+            EnableWindow(hwndCustomizeModernStartButton, FALSE);
+            EnableWindow(hwndCustomizeClassicStartButton, TRUE);
+            lpStartImageName = MAKEINTRESOURCEW(IDB_STARTPREVIEW_CLASSIC);
+        }
+        
+         if (lpStartImageName)
+        {
+            if (pPropInfo->hStartBitmap)
+            {
+                DeleteObject(pPropInfo->hStartBitmap);
+            }
+
+            pPropInfo->hStartBitmap = (HBITMAP)LoadImageW(hExplorerInstance,
+                                                  lpStartImageName,
+                                                  IMAGE_BITMAP,
+                                                  0,
+                                                  0,
+                                                  LR_DEFAULTCOLOR);
+            if (pPropInfo->hStartBitmap)
+            {
+                hwndStartBitmap = GetDlgItem(pPropInfo->hStartWnd,
+                                        IDC_TASKBARPROP_STARTMENU_BITMAP);
+                if (hwndStartBitmap)
+                {
+                    SendMessage(hwndStartBitmap,
+                                STM_SETIMAGE,
+                                IMAGE_BITMAP,
+                                (LPARAM)pPropInfo->hStartBitmap);
+                }
+            }
+        }
+    }
 
     return bRet;
 }
@@ -191,7 +243,18 @@
     // FIXME: check buttons
     CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, 
AdvancedSettings.bShowSeconds ? BST_CHECKED : BST_UNCHECKED);
 
-    UpdateTaskbarBitmap(pPropInfo);
+    UpdateBitmaps(pPropInfo);
+}
+
+static VOID
+OnCreateStartPage(HWND hwnd,
+                    PPROPSHEET_INFO pPropInfo)
+{
+    pPropInfo->hStartWnd = hwnd;
+
+    CheckDlgButton(hwnd, IDC_TASKBARPROP_STARTMENUCLASSIC, 1);    // HACK: 
This has to be read from registry!
+    
+    UpdateBitmaps(pPropInfo);
 }
 
 INT_PTR CALLBACK
@@ -228,7 +291,7 @@
                 case IDC_TASKBARPROP_SECONDS:
                     if (HIWORD(wParam) == BN_CLICKED)
                     {
-                        UpdateTaskbarBitmap(pPropInfo);
+                        UpdateBitmaps(pPropInfo);
 
                         /* Enable the 'Apply' button */
                         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
@@ -286,6 +349,7 @@
     switch (uMsg)
     {
         case WM_INITDIALOG:
+            OnCreateStartPage(hwndDlg, 
(PPROPSHEET_INFO)((LPPROPSHEETPAGE)lParam)->lParam);
             break;
             
         case WM_COMMAND:


Reply via email to