2 * Date and time picker control
4 * Copyright 1998, 1999 Eric Kohl
7 * This is just a dummy control. An author is needed! Any volunteers?
8 * I will only improve this control once in a while.
9 * Eric <ekohl@abo.rhein-zeitung.de>
13 * - All notifications.
22 DEFAULT_DEBUG_CHANNEL(datetime
)
25 #define DATETIME_GetInfoPtr(hwnd) ((DATETIME_INFO *)GetWindowLongA (hwnd, 0))
33 DATETIME_Create (HWND hwnd
, WPARAM wParam
, LPARAM lParam
)
35 DATETIME_INFO
*infoPtr
;
37 /* allocate memory for info structure */
38 infoPtr
= (DATETIME_INFO
*)COMCTL32_Alloc (sizeof(DATETIME_INFO
));
39 if (infoPtr
== NULL
) {
40 ERR (datetime
, "could not allocate info memory!\n");
44 SetWindowLongA (hwnd
, 0, (DWORD
)infoPtr
);
47 /* initialize info structure */
56 DATETIME_Destroy (HWND hwnd
, WPARAM wParam
, LPARAM lParam
)
58 DATETIME_INFO
*infoPtr
= DATETIME_GetInfoPtr (hwnd
);
60 /* free datetime info data */
61 COMCTL32_Free (infoPtr
);
70 DATETIME_WindowProc (HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
75 case DTM_GETSYSTEMTIME
:
76 FIXME (datetime
, "Unimplemented msg DTM_GETSYSTEMTIME\n");
79 case DTM_SETSYSTEMTIME
:
80 FIXME (datetime
, "Unimplemented msg DTM_SETSYSTEMTIME\n");
84 FIXME (datetime
, "Unimplemented msg DTM_GETRANGE\n");
88 FIXME (datetime
, "Unimplemented msg DTM_SETRANGE\n");
92 FIXME (datetime
, "Unimplemented msg DTM_SETFORMAT32A\n");
96 FIXME (datetime
, "Unimplemented msg DTM_SETFORMAT32W\n");
100 FIXME (datetime
, "Unimplemented msg DTM_SETMCCOLOR\n");
104 FIXME (datetime
, "Unimplemented msg DTM_GETMCCOLOR\n");
107 case DTM_GETMONTHCAL
:
108 FIXME (datetime
, "Unimplemented msg DTM_GETMONTHCAL\n");
112 FIXME (datetime
, "Unimplemented msg DTM_SETMCFONT\n");
116 FIXME (datetime
, "Unimplemented msg DTM_GETMCFONT\n");
120 return DATETIME_Create (hwnd
, wParam
, lParam
);
123 return DATETIME_Destroy (hwnd
, wParam
, lParam
);
127 ERR (datetime
, "unknown msg %04x wp=%08x lp=%08lx\n",
128 uMsg
, wParam
, lParam
);
129 return DefWindowProcA (hwnd
, uMsg
, wParam
, lParam
);
136 DATETIME_Register (void)
140 if (GlobalFindAtomA (DATETIMEPICK_CLASSA
)) return;
142 ZeroMemory (&wndClass
, sizeof(WNDCLASSA
));
143 wndClass
.style
= CS_GLOBALCLASS
;
144 wndClass
.lpfnWndProc
= (WNDPROC
)DATETIME_WindowProc
;
145 wndClass
.cbClsExtra
= 0;
146 wndClass
.cbWndExtra
= sizeof(DATETIME_INFO
*);
147 wndClass
.hCursor
= LoadCursorA (0, IDC_ARROWA
);
148 wndClass
.hbrBackground
= (HBRUSH
)(COLOR_WINDOW
+ 1);
149 wndClass
.lpszClassName
= DATETIMEPICK_CLASSA
;
151 RegisterClassA (&wndClass
);
156 DATETIME_Unregister (void)
158 if (GlobalFindAtomA (DATETIMEPICK_CLASSA
))
159 UnregisterClassA (DATETIMEPICK_CLASSA
, (HINSTANCE
)NULL
);