[EXPLORER] -Implement the trick that makes the start button to get clicked when the user clicks on the corner of the screen.

svn path=/trunk/; revision=74692
This commit is contained in:
Giannis Adamopoulos 2017-05-28 18:31:48 +00:00
parent 440290e1cb
commit 2fa8800e5e
4 changed files with 61 additions and 6 deletions

View file

@ -58,6 +58,9 @@ extern HINSTANCE hExplorerInstance;
extern HANDLE hProcessHeap;
extern HKEY hkExplorer;
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
/*
* explorer.c
*/

View file

@ -21,9 +21,6 @@
#include "precomp.h"
#include <commoncontrols.h>
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
/* Set DUMP_TASKS to 1 to enable a dump of the tasks and task groups every
5 seconds */
#define DUMP_TASKS 0

View file

@ -20,9 +20,6 @@
#include "precomp.h"
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
/*
* SysPagerWnd
*/

View file

@ -2446,6 +2446,63 @@ ChangePos:
return TRUE;
}
LRESULT OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
/* This handler implements the trick that makes the start button to
get pressed when the user clicked left or below the button */
POINT pt = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
WINDOWINFO wi = {sizeof(WINDOWINFO)};
RECT rcStartBtn;
bHandled = FALSE;
m_StartButton.GetWindowRect(&rcStartBtn);
GetWindowInfo(m_hWnd, &wi);
switch (m_Position)
{
case ABE_TOP:
case ABE_LEFT:
{
if (pt.x > rcStartBtn.right || pt.y > rcStartBtn.bottom)
return 0;
break;
}
case ABE_RIGHT:
{
if (pt.x < rcStartBtn.left || pt.y > rcStartBtn.bottom)
return 0;
if (rcStartBtn.right + (int)wi.cxWindowBorders * 2 + 1 < wi.rcWindow.right &&
pt.x > rcStartBtn.right)
{
return 0;
}
break;
}
case ABE_BOTTOM:
{
if (pt.x > rcStartBtn.right || pt.y < rcStartBtn.top)
{
return 0;
}
if (rcStartBtn.bottom + (int)wi.cyWindowBorders * 2 + 1 < wi.rcWindow.bottom &&
pt.y > rcStartBtn.bottom)
{
return 0;
}
break;
}
}
bHandled = TRUE;
PopupStartMenu();
return 0;
}
LRESULT OnNcRButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
/* We want the user to be able to get a context menu even on the nonclient
@ -2798,6 +2855,7 @@ HandleTrayContextMenu:
MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, OnWindowPosChange)
MESSAGE_HANDLER(WM_ENTERSIZEMOVE, OnEnterSizeMove)
MESSAGE_HANDLER(WM_EXITSIZEMOVE, OnExitSizeMove)
MESSAGE_HANDLER(WM_NCLBUTTONDOWN, OnNcLButtonDown)
MESSAGE_HANDLER(WM_SYSCHAR, OnSysChar)
MESSAGE_HANDLER(WM_NCRBUTTONUP, OnNcRButtonUp)
MESSAGE_HANDLER(WM_NCLBUTTONDBLCLK, OnNcLButtonDblClick)