diff --git a/base/shell/explorer/trayprop.cpp b/base/shell/explorer/trayprop.cpp index 00ac0b37677..eaf946b40f1 100644 --- a/base/shell/explorer/trayprop.cpp +++ b/base/shell/explorer/trayprop.cpp @@ -196,29 +196,29 @@ private: HWND hwndCustomizeClassic = GetDlgItem(IDC_TASKBARPROP_STARTMENUCLASSICCUST); HWND hwndCustomizeModern = GetDlgItem(IDC_TASKBARPROP_STARTMENUCUST); HWND hwndStartBitmap = GetDlgItem(IDC_TASKBARPROP_STARTMENU_BITMAP); - HWND hwndModernRadioBtn = GetDlgItem(IDC_TASKBARPROP_STARTMENU); - HWND hwndModernText = GetDlgItem(IDC_TASKBARPROP_STARTMENUMODERNTEXT); - BOOL policyNoSimpleStartMenu = SHRestricted(REST_NOSTARTPANEL) != 0; +/// HWND hwndModernRadioBtn = GetDlgItem(IDC_TASKBARPROP_STARTMENU); +/// HWND hwndModernText = GetDlgItem(IDC_TASKBARPROP_STARTMENUMODERNTEXT); + /// BOOL policyNoSimpleStartMenu = SHRestricted(REST_NOSTARTPANEL) != 0; BOOL bModern = FALSE; /* If NoSimpleStartMenu, disable ability to use Modern Start Menu */ - if (policyNoSimpleStartMenu) - { + /// if (policyNoSimpleStartMenu) + /// { /* Switch to classic */ - CheckDlgButton(IDC_TASKBARPROP_STARTMENUCLASSIC, BST_CHECKED); + /// CheckDlgButton(IDC_TASKBARPROP_STARTMENUCLASSIC, BST_CHECKED); /* Disable radio button */ - ::EnableWindow(hwndModernRadioBtn, FALSE); + /// ::EnableWindow(hwndModernRadioBtn, FALSE); /* Hide controls related to modern menu */ - ::ShowWindow(hwndModernRadioBtn, SW_HIDE); - ::ShowWindow(hwndModernText, SW_HIDE); - ::ShowWindow(hwndCustomizeModern, SW_HIDE); - } + /// ::ShowWindow(hwndModernRadioBtn, SW_HIDE); + /// ::ShowWindow(hwndModernText, SW_HIDE); + /// ::ShowWindow(hwndCustomizeModern, SW_HIDE); + /// } /* If no restrictions, then get bModern from dialog */ - else + /// else { - bModern = IsDlgButtonChecked(IDC_TASKBARPROP_STARTMENU); + bModern = IsDlgButtonChecked(IDC_TASKBARPROP_STARTMENU)==BST_CHECKED; } ::EnableWindow(hwndCustomizeModern, bModern); @@ -234,6 +234,9 @@ public: BEGIN_MSG_MAP(CTaskBarSettingsPage) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_ID_HANDLER(IDC_TASKBARPROP_STARTMENUCLASSICCUST, OnStartMenuCustomize) + COMMAND_ID_HANDLER(IDC_TASKBARPROP_STARTMENUCUST, OnStartMenuCustomize) + COMMAND_ID_HANDLER(IDC_TASKBARPROP_STARTMENU, OnStartMenuButton) + COMMAND_ID_HANDLER(IDC_TASKBARPROP_STARTMENUCLASSIC, OnStartMenuButton) CHAIN_MSG_MAP(CPropertyPageImpl) END_MSG_MAP() @@ -251,15 +254,47 @@ public: LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { // fix me: start menu style (classic/modern) should be read somewhere from the registry. - CheckDlgButton(IDC_TASKBARPROP_STARTMENUCLASSIC, BST_CHECKED); // HACK: This has to be read from registry!!!!!!! + /// CheckDlgButton(IDC_TASKBARPROP_STARTMENUCLASSIC, BST_CHECKED); // HACK: This has to be read from registry!!!!!!! + CheckDlgButton(IDC_TASKBARPROP_STARTMENU, BST_CHECKED); // HACK: This has to be read from registry!!!!!!! UpdateDialog(); return TRUE; } + LRESULT OnStartMenuButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) + { + if(wNotifyCode == BN_CLICKED) + { + HWND hwndStartBitmap = GetDlgItem(IDC_TASKBARPROP_STARTMENU_BITMAP); + HWND hwndCustomizeClassic = GetDlgItem(IDC_TASKBARPROP_STARTMENUCLASSICCUST); + HWND hwndCustomizeModern = GetDlgItem(IDC_TASKBARPROP_STARTMENUCUST); + if(wID == IDC_TASKBARPROP_STARTMENU) + { + CheckDlgButton(IDC_TASKBARPROP_STARTMENU, BST_CHECKED); + CheckDlgButton(IDC_TASKBARPROP_STARTMENUCLASSIC, BST_UNCHECKED); + ::EnableWindow(hwndCustomizeModern, TRUE); + ::EnableWindow(hwndCustomizeClassic, FALSE); + SetBitmap(hwndStartBitmap, &m_hbmpStartBitmap, IDB_STARTPREVIEW); + } + else if(wID == IDC_TASKBARPROP_STARTMENUCLASSIC) + { + CheckDlgButton(IDC_TASKBARPROP_STARTMENU, BST_UNCHECKED); + CheckDlgButton(IDC_TASKBARPROP_STARTMENUCLASSIC, BST_CHECKED); + ::EnableWindow(hwndCustomizeModern, FALSE); + ::EnableWindow(hwndCustomizeClassic,TRUE); + SetBitmap(hwndStartBitmap, &m_hbmpStartBitmap, IDB_STARTPREVIEW_CLASSIC); + } + + } + return FALSE; + } + LRESULT OnStartMenuCustomize(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) { - ShowCustomizeClassic(hExplorerInstance, m_hWnd); + if(IsDlgButtonChecked(IDC_TASKBARPROP_STARTMENU)==BST_CHECKED) + ShowCustomizeModern(hExplorerInstance, m_hWnd); + else + ShowCustomizeClassic(hExplorerInstance, m_hWnd); return 0; }