Author: tfaber
Date: Sat Apr 20 19:34:32 2013
New Revision: 58794
URL:
http://svn.reactos.org/svn/reactos?rev=58794&view=rev
Log:
[EXPLORER_NEW]
- Open Date and Time Properties on double-click on the tray clock. Based on patch by Edijs
Kolesnikovičs and Grégori Macário Harbs.
CORE-6860 #resolve
Modified:
trunk/reactos/base/shell/explorer-new/precomp.h
trunk/reactos/base/shell/explorer-new/trayntfy.c
trunk/reactos/base/shell/explorer-new/traywnd.c
Modified: trunk/reactos/base/shell/explorer-new/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/pr…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] Sat Apr 20 19:34:32 2013
@@ -424,6 +424,10 @@
IN WPARAM wParam,
IN LPARAM lParam);
+BOOL
+TrayNotify_GetClockRect(IN HWND hwnd,
+ OUT PRECT rcClock);
+
/*
* taskswnd.c
*/
Modified: trunk/reactos/base/shell/explorer-new/trayntfy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tr…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/trayntfy.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/trayntfy.c [iso-8859-1] Sat Apr 20 19:34:32
2013
@@ -1683,6 +1683,17 @@
}
}
+BOOL
+TrayNotify_GetClockRect(IN HWND hwnd,
+ OUT PRECT rcClock)
+{
+ PTRAY_NOTIFY_WND_DATA This = (PTRAY_NOTIFY_WND_DATA)GetWindowLongPtr(hwnd, 0);
+ if (!IsWindowVisible(This->hWndTrayClock))
+ return FALSE;
+
+ return GetWindowRect(This->hWndTrayClock, rcClock);
+}
+
static LRESULT CALLBACK
TrayNotifyWndProc(IN HWND hwnd,
IN UINT uMsg,
Modified: trunk/reactos/base/shell/explorer-new/traywnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tr…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] Sat Apr 20 19:34:32 2013
@@ -2494,9 +2494,23 @@
}
case WM_NCLBUTTONDBLCLK:
+ {
/* We "handle" this message so users can't cause a weird
maximize/restore
window animation when double-clicking the tray window! */
+
+ /* We should forward mouse messages to child windows here.
+ Right now, this is only clock double-click */
+ RECT rcClock;
+ if (TrayNotify_GetClockRect(This->hwndTrayNotify, &rcClock))
+ {
+ POINT ptClick;
+ ptClick.x = MAKEPOINTS(lParam).x;
+ ptClick.y = MAKEPOINTS(lParam).y;
+ if (PtInRect(&rcClock, ptClick))
+ LaunchCPanel(NULL, TEXT("timedate.cpl"));
+ }
break;
+ }
case WM_NCCREATE:
{