[ros-diffs] [cwittich] 22154: -don't update the time in the DTP control when the user is about to change it

cwittich at svn.reactos.org cwittich at svn.reactos.org
Thu Jun 1 20:06:26 CEST 2006


Author: cwittich
Date: Thu Jun  1 22:06:25 2006
New Revision: 22154

URL: http://svn.reactos.ru/svn/reactos?rev=22154&view=rev
Log:
-don't update the time in the DTP control when the user is about to change it

Modified:
    trunk/reactos/dll/cpl/timedate/timedate.c

Modified: trunk/reactos/dll/cpl/timedate/timedate.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/timedate.c?rev=22154&r1=22153&r2=22154&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/timedate/timedate.c (original)
+++ trunk/reactos/dll/cpl/timedate/timedate.c Thu Jun  1 22:06:25 2006
@@ -52,6 +52,7 @@
 
 static HBITMAP hBitmap = NULL;
 static int cxSource, cySource;
+static WNDPROC pOldWndProc = NULL;
 
 /* Applets */
 APPLET Applets[NUM_APPLETS] =
@@ -289,6 +290,25 @@
 }
 
 
+INT_PTR CALLBACK
+DTPProc(HWND hwnd,
+         UINT uMsg,
+         WPARAM wParam,
+         LPARAM lParam)
+{
+  switch (uMsg)
+  {
+    case WM_KEYDOWN:
+      /* stop the timer when the user is about to change the time */
+      if ((wParam != VK_LEFT) & (wParam != VK_RIGHT))
+        KillTimer(GetParent(hwnd), ID_TIMER);
+      return CallWindowProc(pOldWndProc, hwnd, uMsg, wParam, lParam);
+      break;
+    default:
+      return CallWindowProc(pOldWndProc, hwnd, uMsg, wParam, lParam);
+  }
+}
+
 /* Property page dialog callback */
 INT_PTR CALLBACK
 DateTimePageProc(HWND hwndDlg,
@@ -321,6 +341,8 @@
                        NULL,
                        hApplet,
                        NULL);
+
+		pOldWndProc = (WNDPROC) SetWindowLong(GetDlgItem(hwndDlg, IDC_TIMEPICKER), GWL_WNDPROC, (INT_PTR) DTPProc);
     break;
 
     case WM_TIMER:




More information about the Ros-diffs mailing list