1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-30 18:24:36 +01:00

Right click on Win+X moves mouse to "Desktop" entry

This commit is contained in:
Valentin Radu 2021-10-02 04:33:43 +03:00
parent 1b1bc67c56
commit d2956abda2
3 changed files with 58 additions and 4 deletions

View File

@ -2,6 +2,12 @@
This document includes the same release notes as in the [Releases](https://github.com/valinet/ExplorerPatcher/releases) section on GitHub.
## 22000.194.0.22
Tested on build: 22000.194.
* When the taskbar is located at the bottom of the screen, opening the power user menu (`Win`+`X`) now automatically highlights the "Desktop" entry in the list. Also, the menu items can be activated either with left click, either with right click. Thus, this enables a behavior where you can double click the Start button with the right mouse button in order to quickly show the desktop (thanks to @Gaurav-Original-ClassicShellTester for the suggestion)
## 22000.194.0.21
Tested on build: 22000.194.

View File

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 22000,194,0,21
PRODUCTVERSION 22000,194,0,21
FILEVERSION 22000,194,0,22
PRODUCTVERSION 22000,194,0,22
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "VALINET Solutions SRL"
VALUE "FileDescription", "ExplorerPatcher"
VALUE "FileVersion", "22000.194.0.21"
VALUE "FileVersion", "22000.194.0.22"
VALUE "InternalName", "ExplorerPatcher.dll"
VALUE "LegalCopyright", "Copyright (C) 2006-2021 VALINET Solutions SRL. All rights reserved."
VALUE "OriginalFilename", "ExplorerPatcher.dll"
VALUE "ProductName", "ExplorerPatcher"
VALUE "ProductVersion", "22000.194.0.21"
VALUE "ProductVersion", "22000.194.0.22"
END
END
BLOCK "VarFileInfo"

View File

@ -29,6 +29,9 @@
#include "StartMenu.h"
#include "GUI.h"
#define WINX_ADJUST_X 5
#define WINX_ADJUST_Y 5
#define SB_MICA_EFFECT_SUBCLASS_OFFSET 0x5C70
#define SB_INIT1 0x26070
#define SB_INIT2 0x252C0
@ -356,6 +359,51 @@ INT64 CLauncherTipContextMenu_ShowLauncherTipContextMenuHook(
if (pt)
{
point = *pt;
BOOL bBottom, bRight;
POINT dPt = GetDefaultWinXPosition(FALSE, &bBottom, &bRight);
if (bBottom)
{
HMONITOR hMonitor = MonitorFromPoint(point, MONITOR_DEFAULTTOPRIMARY);
MONITORINFO mi;
mi.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(hMonitor, &mi);
UINT dpiX, dpiY;
HRESULT hr = GetDpiForMonitor(
hMonitor,
MDT_DEFAULT,
&dpiX,
&dpiY
);
double dx = dpiX / 96.0, dy = dpiY / 96.0;
BOOL xo = FALSE, yo = FALSE;
if (point.x - WINX_ADJUST_X * dx < mi.rcMonitor.left)
{
xo = TRUE;
}
if (point.y + WINX_ADJUST_Y * dy > mi.rcMonitor.bottom)
{
yo = TRUE;
}
POINT ptCursor;
GetCursorPos(&ptCursor);
if (xo)
{
ptCursor.x += (WINX_ADJUST_X * 2) * dx;
}
else
{
point.x -= WINX_ADJUST_X * dx;
}
if (yo)
{
ptCursor.y -= (WINX_ADJUST_Y * 2) * dy;
}
else
{
point.y += WINX_ADJUST_Y * dy;
}
SetCursorPos(ptCursor.x, ptCursor.y);
}
}
else
{