Browse Source

GUI: Support switching more pages using the number row on the keyboard

pull/1138/head
Valentin Radu 4 years ago
parent
commit
b809e9e8ed
  1. 40
      ExplorerPatcher/GUI.c
  2. 10
      ExplorerPatcher/dllmain.c
  3. 4
      ExplorerPatcher/settings.reg

40
ExplorerPatcher/GUI.c

@ -3663,12 +3663,31 @@ static LRESULT CALLBACK GUI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
return 0; return 0;
} }
// this should be determined from the file, but for now it works // this should be determined from the file, but for now it works
else if (wParam >= '1' && wParam <= '9' || wParam == '0') else if (wParam >= '1' && wParam <= '9' || wParam == '0' || wParam == MapVirtualKeyW(0x0C, MAPVK_VSC_TO_VK_EX) || wParam == MapVirtualKeyW(0x0D, MAPVK_VSC_TO_VK_EX))
{ {
_this->tabOrder = 0; int min_section = 0;
GUI_SetSection(_this, TRUE, wParam == '0' ? 9 : wParam - '1'); int max_section = 100;
_this->bShouldAnnounceSelected = TRUE; for (unsigned int i = 0; i < 100; ++i)
InvalidateRect(hWnd, NULL, FALSE); {
if (_this->sectionNames[i][0] == 0)
{
max_section = i - 1;
break;
}
}
int new_section = 0;
if (wParam == MapVirtualKeyW(0x0C, MAPVK_VSC_TO_VK_EX)) new_section = 10;
else if (wParam == MapVirtualKeyW(0x0D, MAPVK_VSC_TO_VK_EX)) new_section = 11;
else new_section = (wParam == '0' ? 9 : wParam - '1');
if (new_section < min_section) return 0;
if (new_section > max_section) return 0;
if (_this->section != new_section)
{
_this->tabOrder = 0;
GUI_SetSection(_this, TRUE, new_section);
_this->bShouldAnnounceSelected = TRUE;
InvalidateRect(hWnd, NULL, FALSE);
}
return 0; return 0;
} }
else if (wParam == VK_LEFT || wParam == VK_RIGHT) else if (wParam == VK_LEFT || wParam == VK_RIGHT)
@ -3700,10 +3719,13 @@ static LRESULT CALLBACK GUI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
{ {
new_section = min_section; new_section = min_section;
} }
_this->tabOrder = 0; if (_this->section != new_section)
GUI_SetSection(_this, TRUE, new_section); {
_this->bShouldAnnounceSelected = TRUE; _this->tabOrder = 0;
InvalidateRect(hWnd, NULL, FALSE); GUI_SetSection(_this, TRUE, new_section);
_this->bShouldAnnounceSelected = TRUE;
InvalidateRect(hWnd, NULL, FALSE);
}
return 0; return 0;
} }
else if (wParam == 'H' || wParam == VK_F1) else if (wParam == 'H' || wParam == VK_F1)

10
ExplorerPatcher/dllmain.c

@ -6343,7 +6343,9 @@ void WINAPI LoadSettings(LPARAM lParam)
if (dwTemp != bDisableSpotlightIcon) if (dwTemp != bDisableSpotlightIcon)
{ {
bDisableSpotlightIcon = dwTemp; bDisableSpotlightIcon = dwTemp;
#ifdef _WIN64
if (IsSpotlightEnabled()) dwRefreshUIMask |= REFRESHUI_SPOTLIGHT; if (IsSpotlightEnabled()) dwRefreshUIMask |= REFRESHUI_SPOTLIGHT;
#endif
} }
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
RegQueryValueExW( RegQueryValueExW(
@ -6367,6 +6369,7 @@ void WINAPI LoadSettings(LPARAM lParam)
if (dwTemp != dwSpotlightUpdateSchedule) if (dwTemp != dwSpotlightUpdateSchedule)
{ {
dwSpotlightUpdateSchedule = dwTemp; dwSpotlightUpdateSchedule = dwTemp;
#ifdef _WIN64
if (IsSpotlightEnabled() && hWndServiceWindow) if (IsSpotlightEnabled() && hWndServiceWindow)
{ {
if (dwSpotlightUpdateSchedule) if (dwSpotlightUpdateSchedule)
@ -6378,6 +6381,7 @@ void WINAPI LoadSettings(LPARAM lParam)
KillTimer(hWndServiceWindow, 100); KillTimer(hWndServiceWindow, 100);
} }
} }
#endif
} }
dwTemp = FALSE; dwTemp = FALSE;
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
@ -9175,6 +9179,7 @@ BOOL SHELL32_CanDisplayWin8CopyDialogHook()
#pragma region "Windows Spotlight customization" #pragma region "Windows Spotlight customization"
#ifdef _WIN64
HKEY hKeySpotlight1 = NULL; HKEY hKeySpotlight1 = NULL;
HKEY hKeySpotlight2 = NULL; HKEY hKeySpotlight2 = NULL;
@ -9233,6 +9238,7 @@ BOOL shell32_TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, int nReserve
} }
return bRet; return bRet;
} }
#endif
#pragma endregion #pragma endregion
@ -9259,14 +9265,18 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
{ {
if (bInstall) if (bInstall)
{ {
#ifdef _WIN64
if (DoesOSBuildSupportSpotlight()) if (DoesOSBuildSupportSpotlight())
{ {
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", shell32_TrackPopupMenu); VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", shell32_TrackPopupMenu);
} }
else else
{ {
#endif
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", TrackPopupMenuHook); VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", TrackPopupMenuHook);
#ifdef _WIN64
} }
#endif
VnPatchIAT(hShell32, "user32.dll", "SystemParametersInfoW", DisableImmersiveMenus_SystemParametersInfoW); VnPatchIAT(hShell32, "user32.dll", "SystemParametersInfoW", DisableImmersiveMenus_SystemParametersInfoW);
if (!bIsExplorer) if (!bIsExplorer)
{ {

4
ExplorerPatcher/settings.reg

@ -83,7 +83,6 @@
;x 0 Large (default) ;x 0 Large (default)
"TaskbarSmallIcons"=dword:00000000 "TaskbarSmallIcons"=dword:00000000
;e ;e
;e
;g Taskbar_Windows10Section ;g Taskbar_Windows10Section
@ -530,9 +529,9 @@
;s Spotlight_SpotlightOSCheck DoesOSBuildSupportSpotlight ;s Spotlight_SpotlightOSCheck DoesOSBuildSupportSpotlight
;s Spotlight_SpotlightEnabledCheck IsSpotlightEnabled
;T Spotlight ;T Spotlight
[HKEY_CURRENT_USER\Software\ExplorerPatcher] [HKEY_CURRENT_USER\Software\ExplorerPatcher]
;t When using Windows spotlight as desktop background:
;b Hide the "Learn about this picture" icon ;b Hide the "Learn about this picture" icon
"SpotlightDisableIcon"=dword:00000000 "SpotlightDisableIcon"=dword:00000000
;c 8 Desktop context menu items ;c 8 Desktop context menu items
@ -558,7 +557,6 @@
;x 43200 Every 12 hours ;x 43200 Every 12 hours
;x 86400 Once a day ;x 86400 Once a day
"SpotlightUpdateSchedule"=dword:00000000 "SpotlightUpdateSchedule"=dword:00000000
;s Spotlight_SpotlightEnabledCheck IsSpotlightEnabled
;u %SPOTLIGHTCLICK% ;u %SPOTLIGHTCLICK%
;spotlight_click ;spotlight_click
;t %SPOTLIGHTINFOTIP1% ;t %SPOTLIGHTINFOTIP1%

Loading…
Cancel
Save