Index: base/shell/explorer/precomp.h =================================================================== --- base/shell/explorer/precomp.h (revision 74680) +++ base/shell/explorer/precomp.h (working copy) @@ -58,6 +58,9 @@ 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 */ Index: base/shell/explorer/taskswnd.cpp =================================================================== --- base/shell/explorer/taskswnd.cpp (revision 74680) +++ base/shell/explorer/taskswnd.cpp (working copy) @@ -21,9 +21,6 @@ #include "precomp.h" #include -#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 Index: base/shell/explorer/trayntfy.cpp =================================================================== --- base/shell/explorer/trayntfy.cpp (revision 74680) +++ base/shell/explorer/trayntfy.cpp (working copy) @@ -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 */ Index: base/shell/explorer/traywnd.cpp =================================================================== --- base/shell/explorer/traywnd.cpp (revision 74680) +++ base/shell/explorer/traywnd.cpp (working copy) @@ -2446,6 +2446,57 @@ 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); + + 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; + break; + } + case ABE_BOTTOM: + { + if (pt.x > rcStartBtn.right || pt.y < rcStartBtn.top) + { + return 0; + } + + GetWindowInfo(m_hWnd, &wi); + if ((int)(rcStartBtn.bottom + 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 +2849,7 @@ 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)