Recovery of release 990110 after disk crash.
[wine.git] / dlls / comctl32 / datetime.c
blob79963a8641166c4e183712f05b9e9e9f0eb81bee
1 /*
2 * Date and time picker control
4 * Copyright 1998 Eric Kohl
6 * NOTES
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>
11 * TODO:
12 * - All messages.
13 * - All notifications.
17 #include "windows.h"
18 #include "commctrl.h"
19 #include "datetime.h"
20 #include "win.h"
21 #include "debug.h"
24 #define DATETIME_GetInfoPtr(wndPtr) ((DATETIME_INFO *)wndPtr->wExtra[0])
31 static LRESULT
32 DATETIME_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
34 DATETIME_INFO *infoPtr;
36 /* allocate memory for info structure */
37 infoPtr = (DATETIME_INFO *)COMCTL32_Alloc (sizeof(DATETIME_INFO));
38 wndPtr->wExtra[0] = (DWORD)infoPtr;
40 if (infoPtr == NULL) {
41 ERR (datetime, "could not allocate info memory!\n");
42 return 0;
45 if ((DATETIME_INFO*)wndPtr->wExtra[0] != infoPtr) {
46 ERR (datetime, "pointer assignment error!\n");
47 return 0;
50 /* initialize info structure */
54 return 0;
58 static LRESULT
59 DATETIME_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
61 DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr(wndPtr);
63 /* free datetime info data */
64 COMCTL32_Free (infoPtr);
66 return 0;
72 LRESULT WINAPI
73 DATETIME_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
75 WND *wndPtr = WIN_FindWndPtr(hwnd);
77 switch (uMsg)
80 case DTM_GETSYSTEMTIME:
81 FIXME (datetime, "Unimplemented msg DTM_GETSYSTEMTIME\n");
82 return GDT_VALID;
84 case DTM_SETSYSTEMTIME:
85 FIXME (datetime, "Unimplemented msg DTM_SETSYSTEMTIME\n");
86 return 1;
88 case DTM_GETRANGE:
89 FIXME (datetime, "Unimplemented msg DTM_GETRANGE\n");
90 return 0;
92 case DTM_SETRANGE:
93 FIXME (datetime, "Unimplemented msg DTM_SETRANGE\n");
94 return 1;
96 case DTM_SETFORMAT32A:
97 FIXME (datetime, "Unimplemented msg DTM_SETFORMAT32A\n");
98 return 1;
100 case DTM_SETFORMAT32W:
101 FIXME (datetime, "Unimplemented msg DTM_SETFORMAT32W\n");
102 return 1;
104 case DTM_SETMCCOLOR:
105 FIXME (datetime, "Unimplemented msg DTM_SETMCCOLOR\n");
106 return 0;
108 case DTM_GETMCCOLOR:
109 FIXME (datetime, "Unimplemented msg DTM_GETMCCOLOR\n");
110 return 0;
112 case DTM_GETMONTHCAL:
113 FIXME (datetime, "Unimplemented msg DTM_GETMONTHCAL\n");
114 return 0;
116 case DTM_SETMCFONT:
117 FIXME (datetime, "Unimplemented msg DTM_SETMCFONT\n");
118 return 0;
120 case DTM_GETMCFONT:
121 FIXME (datetime, "Unimplemented msg DTM_GETMCFONT\n");
122 return 0;
124 case WM_CREATE:
125 return DATETIME_Create (wndPtr, wParam, lParam);
127 case WM_DESTROY:
128 return DATETIME_Destroy (wndPtr, wParam, lParam);
130 default:
131 if (uMsg >= WM_USER)
132 ERR (datetime, "unknown msg %04x wp=%08x lp=%08lx\n",
133 uMsg, wParam, lParam);
134 return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
136 return 0;
140 VOID
141 DATETIME_Register (VOID)
143 WNDCLASS32A wndClass;
145 if (GlobalFindAtom32A (DATETIMEPICK_CLASS32A)) return;
147 ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
148 wndClass.style = CS_GLOBALCLASS;
149 wndClass.lpfnWndProc = (WNDPROC32)DATETIME_WindowProc;
150 wndClass.cbClsExtra = 0;
151 wndClass.cbWndExtra = sizeof(DATETIME_INFO *);
152 wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
153 wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
154 wndClass.lpszClassName = DATETIMEPICK_CLASS32A;
156 RegisterClass32A (&wndClass);
160 VOID
161 DATETIME_Unregister (VOID)
163 if (GlobalFindAtom32A (DATETIMEPICK_CLASS32A))
164 UnregisterClass32A (DATETIMEPICK_CLASS32A, (HINSTANCE32)NULL);