2 * comctl32 month calendar unit tests
4 * Copyright (C) 2006 Vitaliy Margolen
5 * Copyright (C) 2007 Farshad Agah
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/test.h"
35 #define expect(expected, got) ok(expected == got, "Expected %d, got %d\n", expected, got);
37 #define NUM_MSG_SEQUENCES 2
38 #define PARENT_SEQ_INDEX 0
39 #define MONTHCAL_SEQ_INDEX 1
46 static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
48 static const struct message create_parent_window_seq[] = {
49 { WM_GETMINMAXINFO, sent },
50 { WM_NCCREATE, sent },
51 { WM_NCCALCSIZE, sent|wparam, 0 },
53 { WM_SHOWWINDOW, sent|wparam, 1 },
54 { WM_WINDOWPOSCHANGING, sent|wparam, 0 },
55 { WM_QUERYNEWPALETTE, sent|optional },
56 { WM_WINDOWPOSCHANGING, sent|wparam|optional, 0 },
57 { WM_WINDOWPOSCHANGED, sent|optional },
58 { WM_ACTIVATEAPP, sent|wparam, 1 },
59 { WM_NCACTIVATE, sent },
60 { WM_ACTIVATE, sent|wparam, 1 },
61 { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
62 { WM_IME_NOTIFY, sent|defwinproc|optional },
63 { WM_SETFOCUS, sent|wparam|defwinproc, 0 },
64 /* Win9x adds SWP_NOZORDER below */
65 { WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE*/ },
66 { WM_NCCALCSIZE, sent|wparam|optional, 1 },
72 static const struct message create_monthcal_control_seq[] = {
73 { WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
74 { WM_QUERYUISTATE, sent|optional },
76 { WM_PARENTNOTIFY, sent|wparam, WM_CREATE},
80 static const struct message create_monthcal_multi_sel_style_seq[] = {
81 { WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
82 { WM_QUERYUISTATE, sent|optional },
87 static const struct message monthcal_color_seq[] = {
88 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_BACKGROUND, 0},
89 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_BACKGROUND, RGB(0,0,0)},
90 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_BACKGROUND, 0},
91 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_BACKGROUND, RGB(255,255,255)},
92 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_BACKGROUND, 0},
94 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_MONTHBK, 0},
95 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_MONTHBK, RGB(0,0,0)},
96 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_MONTHBK, 0},
97 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_MONTHBK, RGB(255,255,255)},
98 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_MONTHBK, 0},
100 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TEXT, 0},
101 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TEXT, RGB(0,0,0)},
102 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TEXT, 0},
103 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TEXT, RGB(255,255,255)},
104 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TEXT, 0},
106 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TITLEBK, 0},
107 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TITLEBK, RGB(0,0,0)},
108 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TITLEBK, 0},
109 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TITLEBK, RGB(255,255,255)},
110 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TITLEBK, 0},
112 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TITLETEXT, 0},
113 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TITLETEXT, RGB(0,0,0)},
114 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TITLETEXT, 0},
115 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TITLETEXT, RGB(255,255,255)},
116 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TITLETEXT, 0},
118 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TRAILINGTEXT, 0},
119 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TRAILINGTEXT, RGB(0,0,0)},
120 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TRAILINGTEXT, 0},
121 { MCM_SETCOLOR, sent|wparam|lparam, MCSC_TRAILINGTEXT, RGB(255,255,255)},
122 { MCM_GETCOLOR, sent|wparam|lparam, MCSC_TRAILINGTEXT, 0},
126 static const struct message monthcal_curr_date_seq[] = {
127 { MCM_SETCURSEL, sent|wparam, 0},
128 { WM_PAINT, sent|wparam|lparam|defwinproc, 0, 0},
129 { WM_ERASEBKGND, sent|lparam|defwinproc, 0},
130 { MCM_SETCURSEL, sent|wparam, 0},
131 { MCM_SETCURSEL, sent|wparam, 0},
132 { MCM_GETCURSEL, sent|wparam, 0},
133 { MCM_GETCURSEL, sent|wparam|lparam, 0, 0},
137 static const struct message monthcal_first_day_seq[] = {
138 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
140 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, -5},
141 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
143 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, -4},
144 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
146 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, -3},
147 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
149 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, -2},
150 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
152 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, -1},
153 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
155 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
156 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
158 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 1},
159 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
161 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 2},
162 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
164 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 3},
165 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
167 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 4},
168 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
170 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 5},
171 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
173 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 6},
174 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
176 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 7},
177 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
179 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 8},
180 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
182 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 9},
183 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
185 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 10},
186 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
188 { MCM_SETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 11},
189 { MCM_GETFIRSTDAYOFWEEK, sent|wparam|lparam, 0, 0},
193 static const struct message monthcal_unicode_seq[] = {
194 { MCM_GETUNICODEFORMAT, sent|wparam|lparam, 0, 0},
195 { MCM_SETUNICODEFORMAT, sent|wparam|lparam, 1, 0},
196 { MCM_GETUNICODEFORMAT, sent|wparam|lparam, 0, 0},
197 { MCM_SETUNICODEFORMAT, sent|wparam|lparam, 0, 0},
198 { MCM_GETUNICODEFORMAT, sent|wparam|lparam, 0, 0},
199 { MCM_SETUNICODEFORMAT, sent|wparam|lparam, 1, 0},
203 static const struct message monthcal_hit_test_seq[] = {
204 { MCM_SETCURSEL, sent|wparam, 0},
205 { WM_PAINT, sent|wparam|lparam|defwinproc, 0, 0},
206 { MCM_HITTEST, sent|wparam, 0},
207 { MCM_HITTEST, sent|wparam, 0},
208 { MCM_HITTEST, sent|wparam, 0},
209 { MCM_HITTEST, sent|wparam, 0},
210 { MCM_HITTEST, sent|wparam, 0},
211 { MCM_HITTEST, sent|wparam, 0},
212 { MCM_HITTEST, sent|wparam, 0},
213 { MCM_HITTEST, sent|wparam, 0},
214 { MCM_HITTEST, sent|wparam, 0},
215 { MCM_HITTEST, sent|wparam, 0},
216 { MCM_HITTEST, sent|wparam, 0},
217 { MCM_HITTEST, sent|wparam, 0},
218 { MCM_HITTEST, sent|wparam, 0},
222 static const struct message monthcal_todaylink_seq[] = {
223 { MCM_HITTEST, sent|wparam, 0},
224 { MCM_SETTODAY, sent|wparam, 0},
225 { WM_PAINT, sent|wparam|lparam|defwinproc, 0, 0},
226 { MCM_GETTODAY, sent|wparam, 0},
227 { WM_LBUTTONDOWN, sent|wparam|lparam, MK_LBUTTON, MAKELONG(70, 370)},
228 { WM_CAPTURECHANGED, sent|wparam|lparam|defwinproc, 0, 0},
229 { WM_PAINT, sent|wparam|lparam|defwinproc, 0, 0},
230 { MCM_GETCURSEL, sent|wparam, 0},
234 static const struct message monthcal_today_seq[] = {
235 { MCM_SETTODAY, sent|wparam, 0},
236 { WM_PAINT, sent|wparam|lparam|defwinproc, 0, 0},
237 { MCM_GETTODAY, sent|wparam, 0},
238 { MCM_SETTODAY, sent|wparam, 0},
239 { WM_PAINT, sent|wparam|lparam|defwinproc, 0, 0},
240 { MCM_GETTODAY, sent|wparam, 0},
244 static const struct message monthcal_scroll_seq[] = {
245 { MCM_SETMONTHDELTA, sent|wparam|lparam, 2, 0},
246 { MCM_SETMONTHDELTA, sent|wparam|lparam, 3, 0},
247 { MCM_GETMONTHDELTA, sent|wparam|lparam, 0, 0},
248 { MCM_SETMONTHDELTA, sent|wparam|lparam, 12, 0},
249 { MCM_GETMONTHDELTA, sent|wparam|lparam, 0, 0},
250 { MCM_SETMONTHDELTA, sent|wparam|lparam, 15, 0},
251 { MCM_GETMONTHDELTA, sent|wparam|lparam, 0, 0},
252 { MCM_SETMONTHDELTA, sent|wparam|lparam, -5, 0},
253 { MCM_GETMONTHDELTA, sent|wparam|lparam, 0, 0},
257 static const struct message monthcal_monthrange_seq[] = {
258 { MCM_GETMONTHRANGE, sent|wparam, GMR_VISIBLE},
259 { MCM_GETMONTHRANGE, sent|wparam, GMR_DAYSTATE},
263 static const struct message monthcal_max_sel_day_seq[] = {
264 { MCM_SETMAXSELCOUNT, sent|wparam|lparam, 5, 0},
265 { MCM_GETMAXSELCOUNT, sent|wparam|lparam, 0, 0},
266 { MCM_SETMAXSELCOUNT, sent|wparam|lparam, 15, 0},
267 { MCM_GETMAXSELCOUNT, sent|wparam|lparam, 0, 0},
268 { MCM_SETMAXSELCOUNT, sent|wparam|lparam, -1, 0},
269 { MCM_GETMAXSELCOUNT, sent|wparam|lparam, 0, 0},
273 /* expected message sequence for parent*/
274 static const struct message destroy_monthcal_parent_msgs_seq[] = {
275 { WM_PARENTNOTIFY, sent|wparam, WM_DESTROY},
279 /* expected message sequence for child*/
280 static const struct message destroy_monthcal_child_msgs_seq[] = {
281 { 0x0090, sent|optional }, /* Vista */
282 { WM_SHOWWINDOW, sent|wparam|lparam, 0, 0},
283 { WM_WINDOWPOSCHANGING, sent|wparam, 0},
284 { WM_WINDOWPOSCHANGED, sent|wparam, 0},
285 { WM_DESTROY, sent|wparam|lparam, 0, 0},
286 { WM_NCDESTROY, sent|wparam|lparam, 0, 0},
290 static const struct message destroy_monthcal_multi_sel_style_seq[] = {
291 { 0x0090, sent|optional }, /* Vista */
292 { WM_DESTROY, sent|wparam|lparam, 0, 0},
293 { WM_NCDESTROY, sent|wparam|lparam, 0, 0},
297 /* expected message sequence for parent window*/
298 static const struct message destroy_parent_seq[] = {
299 { 0x0090, sent|optional }, /* Vista */
300 { WM_WINDOWPOSCHANGING, sent|wparam, 0},
301 { WM_WINDOWPOSCHANGED, sent|wparam, 0},
302 { WM_IME_SETCONTEXT, sent|wparam|optional, 0},
303 { WM_IME_NOTIFY, sent|wparam|lparam|defwinproc|optional, 1, 0},
304 { WM_NCACTIVATE, sent|wparam|optional, 0},
305 { WM_ACTIVATE, sent|wparam|optional, 0},
306 { WM_NCACTIVATE, sent|wparam|lparam|optional, 0, 0},
307 { WM_ACTIVATE, sent|wparam|lparam|optional, 0, 0},
308 { WM_ACTIVATEAPP, sent|wparam|optional, 0},
309 { WM_KILLFOCUS, sent|wparam|lparam|optional, 0, 0},
310 { WM_IME_SETCONTEXT, sent|wparam|optional, 0},
311 { WM_IME_NOTIFY, sent|wparam|lparam|defwinproc|optional, 1, 0},
312 { WM_DESTROY, sent|wparam|lparam, 0, 0},
313 { WM_NCDESTROY, sent|wparam|lparam, 0, 0},
317 static void test_monthcal(void)
320 SYSTEMTIME st[2], st1[2];
321 int res, month_range;
323 hwnd = CreateWindowA(MONTHCAL_CLASSA, "MonthCal", WS_POPUP | WS_VISIBLE, CW_USEDEFAULT,
324 0, 300, 300, 0, 0, NULL, NULL);
325 ok(hwnd != NULL, "Failed to create MonthCal\n");
326 GetSystemTime(&st[0]);
329 /* Invalid date/time */
331 /* Time should not matter */
332 st[1].wHour = st[1].wMinute = st[1].wSecond = 70;
333 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set MAX limit\n");
334 ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n");
335 ok(st1[0].wYear != 2000, "Lover limit changed\n");
338 ok(!SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Should have failed to set limits\n");
339 ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n");
340 ok(st1[0].wYear != 2000, "Lover limit changed\n");
341 ok(!SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Should have failed to set MAX limit\n");
342 ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "No limits should be set\n");
343 ok(st1[0].wYear != 2000, "Lover limit changed\n");
345 GetSystemTime(&st[0]);
350 month_range = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1);
352 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n");
353 res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1);
354 ok(res == month_range, "Invalid month range (%d)\n", res);
355 ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == (GDTR_MIN|GDTR_MAX), "Limits should be set\n");
358 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n");
359 res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st1);
360 ok(res == month_range, "Invalid month range (%d)\n", res);
363 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n");
365 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st), "Failed to set both min and max limits\n");
368 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
369 ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "Only MAX limit should be set\n");
371 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
373 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
375 ok(SendMessage(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st), "Failed to set max limit\n");
376 ok(SendMessage(hwnd, MCM_GETRANGE, 0, (LPARAM)st1) == GDTR_MAX, "Only MAX limit should be set\n");
381 static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
383 static LONG defwndproc_counter = 0;
387 /* log system messages, except for painting */
388 if (message < WM_USER &&
389 message != WM_PAINT &&
390 message != WM_ERASEBKGND &&
391 message != WM_NCPAINT &&
392 message != WM_NCHITTEST &&
393 message != WM_GETTEXT &&
394 message != WM_GETICON &&
395 message != WM_DEVICECHANGE)
397 trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
399 msg.message = message;
400 msg.flags = sent|wparam|lparam;
401 if (defwndproc_counter) msg.flags |= defwinproc;
404 add_message(sequences, PARENT_SEQ_INDEX, &msg);
407 defwndproc_counter++;
408 ret = DefWindowProcA(hwnd, message, wParam, lParam);
409 defwndproc_counter--;
414 static BOOL register_parent_wnd_class(void)
419 cls.lpfnWndProc = parent_wnd_proc;
422 cls.hInstance = GetModuleHandleA(NULL);
424 cls.hCursor = LoadCursorA(0, IDC_ARROW);
425 cls.hbrBackground = GetStockObject(WHITE_BRUSH);
426 cls.lpszMenuName = NULL;
427 cls.lpszClassName = "Month-Cal test parent class";
428 return RegisterClassA(&cls);
431 static HWND create_parent_window(void)
435 InitCommonControls();
437 /* flush message sequences, so we can check the new sequence by the end of function */
438 flush_sequences(sequences, NUM_MSG_SEQUENCES);
440 if (!register_parent_wnd_class())
443 hwnd = CreateWindowEx(0, "Month-Cal test parent class",
444 "Month-Cal test parent window",
445 WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
446 WS_MAXIMIZEBOX | WS_VISIBLE,
448 GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL);
452 /* check for message sequences */
453 ok_sequence(sequences, PARENT_SEQ_INDEX, create_parent_window_seq, "create parent window", FALSE);
458 static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
460 struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
461 static LONG defwndproc_counter = 0;
465 msg.message = message;
466 msg.flags = sent|wparam|lparam;
467 if (defwndproc_counter) msg.flags |= defwinproc;
470 add_message(sequences, MONTHCAL_SEQ_INDEX, &msg);
472 defwndproc_counter++;
473 ret = CallWindowProcA(info->oldproc, hwnd, message, wParam, lParam);
474 defwndproc_counter--;
479 static HWND create_monthcal_control(DWORD style, HWND parent_window)
481 struct subclass_info *info;
484 info = HeapAlloc(GetProcessHeap(), 0, sizeof(struct subclass_info));
488 hwnd = CreateWindowEx(0,
493 parent_window, NULL, GetModuleHandleA(NULL), NULL);
497 HeapFree(GetProcessHeap(), 0, info);
501 info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
502 (LONG_PTR)monthcal_subclass_proc);
503 SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
509 /* Setter and Getters Tests */
511 static void test_monthcal_color(HWND hwnd)
515 flush_sequences(sequences, NUM_MSG_SEQUENCES);
517 /* Setter and Getters for color*/
518 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0);
519 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_BACKGROUND, RGB(0,0,0));
521 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0);
522 expect(RGB(0,0,0), temp);
523 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_BACKGROUND, RGB(255,255,255));
525 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_BACKGROUND, 0);
526 expect(RGB(255,255,255), temp);
528 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0);
529 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(0,0,0));
531 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0);
532 expect(RGB(0,0,0), temp);
533 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_MONTHBK, RGB(255,255,255));
535 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_MONTHBK, 0);
536 expect(RGB(255,255,255), temp);
538 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0);
539 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(0,0,0));
541 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0);
542 expect(RGB(0,0,0), temp);
543 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TEXT, RGB(255,255,255));
545 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TEXT, 0);
546 expect(RGB(255,255,255), temp);
548 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0);
549 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(0,0,0));
551 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0);
552 expect(RGB(0,0,0), temp);
553 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLEBK, RGB(255,255,255));
555 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLEBK, 0);
556 expect(RGB(255,255,255), temp);
558 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0);
559 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(0,0,0));
561 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0);
562 expect(RGB(0,0,0), temp);
563 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TITLETEXT, RGB(255,255,255));
565 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TITLETEXT, 0);
566 expect(RGB(255,255,255), temp);
568 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0);
569 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT, RGB(0,0,0));
571 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0);
572 expect(RGB(0,0,0), temp);
573 res = SendMessage(hwnd, MCM_SETCOLOR, MCSC_TRAILINGTEXT, RGB(255,255,255));
575 temp = SendMessage(hwnd, MCM_GETCOLOR, MCSC_TRAILINGTEXT, 0);
576 expect(RGB(255,255,255), temp);
578 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_color_seq, "monthcal color", FALSE);
581 static void test_monthcal_currDate(HWND hwnd)
583 SYSTEMTIME st_original, st_new, st_test;
586 flush_sequences(sequences, NUM_MSG_SEQUENCES);
588 /* Setter and Getters for current date selected */
589 st_original.wYear = 2000;
590 st_original.wMonth = 11;
591 st_original.wDay = 28;
592 st_original.wHour = 11;
593 st_original.wMinute = 59;
594 st_original.wSecond = 30;
595 st_original.wMilliseconds = 0;
596 st_original.wDayOfWeek = 0;
598 st_new = st_test = st_original;
600 /* Should not validate the time */
601 res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
604 /* Overflow matters, check for wDay */
606 res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
609 /* correct wDay before checking for wMonth */
611 expect(st_original.wDay, st_test.wDay);
613 /* Overflow matters, check for wMonth */
615 res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st_test);
618 /* checking if gets the information right, modify st_new */
626 res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new);
629 /* st_new change to st_origin, above settings with overflow */
630 /* should not change the current settings */
631 expect(st_original.wYear, st_new.wYear);
632 expect(st_original.wMonth, st_new.wMonth);
633 expect(st_original.wDay, st_new.wDay);
634 expect(st_original.wHour, st_new.wHour);
635 expect(st_original.wMinute, st_new.wMinute);
636 expect(st_original.wSecond, st_new.wSecond);
638 /* lparam cannot be NULL */
639 res = SendMessage(hwnd, MCM_GETCURSEL, 0, 0);
642 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_curr_date_seq, "monthcal currDate", TRUE);
645 static void test_monthcal_firstDay(HWND hwnd)
647 int res, fday, i, prev;
649 LCID lcid = LOCALE_USER_DEFAULT;
651 flush_sequences(sequences, NUM_MSG_SEQUENCES);
653 /* Setter and Getters for first day of week */
654 /* check for locale first day */
655 if(GetLocaleInfo(lcid, LOCALE_IFIRSTDAYOFWEEK, b, 128)){
657 trace("fday: %d\n", fday);
658 res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0);
662 /* checking for the values that actually will be stored as */
663 /* current first day when we set a new value */
664 for (i = -5; i < 12; i++){
665 res = SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, (LPARAM) i);
667 res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0);
671 expect(MAKELONG(fday, FALSE), res);
673 /* out of range sets max first day of week, locale is ignored */
674 expect(MAKELONG(6, TRUE), res);
676 expect(MAKELONG(i, TRUE), res);
680 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_first_day_seq, "monthcal firstDay", FALSE);
683 skip("Cannot retrieve first day of the week\n");
688 static void test_monthcal_unicode(HWND hwnd)
692 flush_sequences(sequences, NUM_MSG_SEQUENCES);
694 /* Setter and Getters for Unicode format */
696 /* getting the current settings */
697 temp = SendMessage(hwnd, MCM_GETUNICODEFORMAT, 0, 0);
699 /* setting to 1, should return previous settings */
700 res = SendMessage(hwnd, MCM_SETUNICODEFORMAT, 1, 0);
703 /* current setting is 1, so, should return 1 */
704 res = SendMessage(hwnd, MCM_GETUNICODEFORMAT, 0, 0);
705 todo_wine {expect(1, res);}
707 /* setting to 0, should return previous settings */
708 res = SendMessage(hwnd, MCM_SETUNICODEFORMAT, 0, 0);
709 todo_wine {expect(1, res);}
711 /* current setting is 0, so, it should return 0 */
712 res = SendMessage(hwnd, MCM_GETUNICODEFORMAT, 0, 0);
715 /* should return previous settings */
716 res = SendMessage(hwnd, MCM_SETUNICODEFORMAT, 1, 0);
719 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_unicode_seq, "monthcal unicode", FALSE);
722 static void test_monthcal_HitTest(HWND hwnd)
729 static const UINT title_hits[] =
730 { MCHT_NOWHERE, MCHT_TITLEBK, MCHT_TITLEBTNPREV, MCHT_TITLEBK,
731 MCHT_TITLEMONTH, MCHT_TITLEBK, MCHT_TITLEYEAR, MCHT_TITLEBK,
732 MCHT_TITLEBTNNEXT, MCHT_TITLEBK, MCHT_NOWHERE };
734 memset(&mchit, 0, sizeof(MCHITTESTINFO));
736 flush_sequences(sequences, NUM_MSG_SEQUENCES);
744 st.wMilliseconds = 0;
747 res = SendMessage(hwnd, MCM_SETCURSEL, 0, (LPARAM)&st);
750 /* (0, 0) is the top left of the control and should not be active */
751 mchit.cbSize = sizeof(MCHITTESTINFO);
754 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
755 expect(0, mchit.pt.x);
756 expect(0, mchit.pt.y);
757 expect(mchit.uHit, res);
758 todo_wine {expect(MCHT_NOWHERE, res);}
760 /* (300, 400) is the bottom right of the control and should not be active */
763 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
764 expect(300, mchit.pt.x);
765 expect(400, mchit.pt.y);
766 expect(mchit.uHit, res);
767 todo_wine {expect(MCHT_NOWHERE, res);}
769 /* (500, 500) is completely out of the control and should not be active */
772 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
773 expect(500, mchit.pt.x);
774 expect(500, mchit.pt.y);
775 expect(mchit.uHit, res);
776 todo_wine {expect(MCHT_NOWHERE, res);}
778 /* (120, 180) is in active area - calendar background */
781 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
782 expect(120, mchit.pt.x);
783 expect(180, mchit.pt.y);
784 expect(mchit.uHit, res);
785 expect(MCHT_CALENDARBK, res);
787 /* (70, 70) is in active area - day of the week */
790 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
791 expect(70, mchit.pt.x);
792 expect(70, mchit.pt.y);
793 expect(mchit.uHit, res);
794 todo_wine {expect(MCHT_CALENDARDAY, res);}
796 /* (70, 90) is in active area - date from prev month */
799 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
800 expect(70, mchit.pt.x);
801 expect(90, mchit.pt.y);
802 expect(mchit.uHit, res);
803 todo_wine {expect(MCHT_CALENDARDATEPREV, res);}
806 /* (125, 115) is in active area - date from this month */
809 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
810 expect(125, mchit.pt.x);
811 expect(115, mchit.pt.y);
812 expect(mchit.uHit, res);
813 expect(MCHT_CALENDARDATE, res);
816 /* (80, 220) is in active area - background section of the title */
819 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
820 expect(80, mchit.pt.x);
821 expect(220, mchit.pt.y);
822 expect(mchit.uHit, res);
823 todo_wine {expect(MCHT_TITLEBK, res);}
825 /* (140, 215) is in active area - month section of the title */
828 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
829 expect(140, mchit.pt.x);
830 expect(215, mchit.pt.y);
831 expect(mchit.uHit, res);
832 todo_wine {expect(MCHT_TITLEMONTH, res);}
834 /* (170, 215) is in active area - year section of the title */
837 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
838 expect(170, mchit.pt.x);
839 expect(215, mchit.pt.y);
840 expect(mchit.uHit, res);
841 todo_wine {expect(MCHT_TITLEYEAR, res);}
843 /* (150, 260) is in active area - date from this month */
846 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
847 expect(150, mchit.pt.x);
848 expect(260, mchit.pt.y);
849 expect(mchit.uHit, res);
850 todo_wine {expect(MCHT_CALENDARDATE, res);}
852 /* (150, 350) is in active area - date from next month */
855 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
856 expect(150, mchit.pt.x);
857 expect(350, mchit.pt.y);
858 expect(mchit.uHit, res);
859 todo_wine {expect(MCHT_CALENDARDATENEXT, res);}
861 /* (150, 370) is in active area - today link */
864 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
865 expect(150, mchit.pt.x);
866 expect(370, mchit.pt.y);
867 expect(mchit.uHit, res);
868 todo_wine {expect(MCHT_TODAYLINK, res);}
870 /* (70, 370) is in active area - today link */
873 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
874 expect(70, mchit.pt.x);
875 expect(370, mchit.pt.y);
876 expect(mchit.uHit, res);
877 todo_wine {expect(MCHT_TODAYLINK, res);}
879 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_hit_test_seq, "monthcal hit test", TRUE);
881 /* The horizontal position of title bar elements depends on locale (y pos
882 is constant), so we sample across a horizontal line and make sure we
883 find all elements. */
886 for (x = 0; x < 300; x++){
888 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
889 expect(x, mchit.pt.x);
890 expect(40, mchit.pt.y);
891 expect(mchit.uHit, res);
892 if (res != title_hits[title_index]){
894 if (sizeof(title_hits) / sizeof(title_hits[0]) <= title_index)
896 todo_wine {expect(title_hits[title_index], res);}
899 todo_wine {ok(300 <= x && title_index + 1 == sizeof(title_hits) / sizeof(title_hits[0]),
900 "Wrong title layout\n");}
903 static void test_monthcal_todaylink(HWND hwnd)
906 SYSTEMTIME st_test, st_new;
910 memset(&mchit, 0, sizeof(MCHITTESTINFO));
912 flush_sequences(sequences, NUM_MSG_SEQUENCES);
914 /* (70, 370) is in active area - today link */
915 mchit.cbSize = sizeof(MCHITTESTINFO);
918 res = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM) & mchit);
919 expect(70, mchit.pt.x);
920 expect(370, mchit.pt.y);
921 expect(mchit.uHit, res);
922 todo_wine {expect(MCHT_TODAYLINK, res);}
923 if (70 != mchit.pt.x || 370 != mchit.pt.y || mchit.uHit != res
924 || MCHT_TODAYLINK != res)
929 st_test.wYear = 2005;
930 memset(&st_new, 0, sizeof(SYSTEMTIME));
932 SendMessage(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test);
934 res = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new);
936 expect(1, st_new.wDay);
937 expect(1, st_new.wMonth);
938 expect(2005, st_new.wYear);
939 if (1 != res || 1 != st_new.wDay || 1 != st_new.wMonth
940 || 2005 != st_new.wYear)
944 skip("cannot perform today link test\n");
948 res = SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(70, 370));
951 memset(&st_new, 0, sizeof(SYSTEMTIME));
952 res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM)&st_new);
954 expect(1, st_new.wDay);
955 expect(1, st_new.wMonth);
956 expect(2005, st_new.wYear);
958 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_todaylink_seq, "monthcal hit test", TRUE);
961 static void test_monthcal_today(HWND hwnd)
963 SYSTEMTIME st_test, st_new;
966 flush_sequences(sequences, NUM_MSG_SEQUENCES);
968 /* Setter and Getters for "today" information */
970 /* check for overflow, should be ok */
977 SendMessage(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test);
979 res = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new);
982 /* st_test should not change */
983 expect(38, st_test.wDay);
984 expect(38, st_test.wMonth);
986 /* st_new should change, overflow does not matter */
987 expect(38, st_new.wDay);
988 expect(38, st_new.wMonth);
990 /* check for zero, should be ok*/
994 SendMessage(hwnd, MCM_SETTODAY, 0, (LPARAM)&st_test);
996 res = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st_new);
999 /* st_test should not change */
1000 expect(0, st_test.wDay);
1001 expect(0, st_test.wMonth);
1003 /* st_new should change to zero*/
1004 expect(0, st_new.wDay);
1005 expect(0, st_new.wMonth);
1007 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_today_seq, "monthcal today", TRUE);
1010 static void test_monthcal_scroll(HWND hwnd)
1014 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1016 /* Setter and Getters for scroll rate */
1017 res = SendMessage(hwnd, MCM_SETMONTHDELTA, 2, 0);
1020 res = SendMessage(hwnd, MCM_SETMONTHDELTA, 3, 0);
1022 res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0);
1025 res = SendMessage(hwnd, MCM_SETMONTHDELTA, 12, 0);
1027 res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0);
1030 res = SendMessage(hwnd, MCM_SETMONTHDELTA, 15, 0);
1032 res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0);
1035 res = SendMessage(hwnd, MCM_SETMONTHDELTA, -5, 0);
1037 res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0);
1040 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_scroll_seq, "monthcal scroll", FALSE);
1043 static void test_monthcal_monthrange(HWND hwnd)
1046 SYSTEMTIME st_visible[2], st_daystate[2];
1048 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1049 st_visible[0].wYear = 0;
1050 st_visible[0].wMonth = 0;
1051 st_visible[0].wDay = 0;
1052 st_daystate[1] = st_daystate[0] = st_visible[1] = st_visible[0];
1054 res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st_visible);
1057 expect(2000, st_visible[0].wYear);
1058 expect(11, st_visible[0].wMonth);
1059 expect(1, st_visible[0].wDay);
1060 expect(2000, st_visible[1].wYear);
1061 expect(12, st_visible[1].wMonth);
1062 expect(31, st_visible[1].wDay);
1064 res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_DAYSTATE, (LPARAM)st_daystate);
1067 expect(2000, st_daystate[0].wYear);
1068 expect(10, st_daystate[0].wMonth);
1069 expect(29, st_daystate[0].wDay);
1070 expect(2001, st_daystate[1].wYear);
1071 expect(1, st_daystate[1].wMonth);
1072 expect(6, st_daystate[1].wDay);
1075 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_monthrange_seq, "monthcal monthrange", FALSE);
1078 static void test_monthcal_MaxSelDay(HWND hwnd)
1082 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1084 /* Setter and Getters for max selected days */
1085 res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, 5, 0);
1087 res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0);
1090 res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, 15, 0);
1092 res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0);
1095 res = SendMessage(hwnd, MCM_SETMAXSELCOUNT, -1, 0);
1096 todo_wine {expect(0, res);}
1097 res = SendMessage(hwnd, MCM_GETMAXSELCOUNT, 0, 0);
1098 todo_wine {expect(15, res);}
1100 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_max_sel_day_seq, "monthcal MaxSelDay", FALSE);
1103 static void test_monthcal_size(HWND hwnd)
1107 HFONT hFont1, hFont2;
1110 lstrcpyA(logfont.lfFaceName, "Arial");
1111 memset(&logfont, 0, sizeof(logfont));
1112 logfont.lfHeight = 12;
1113 hFont1 = CreateFontIndirectA(&logfont);
1115 logfont.lfHeight = 24;
1116 hFont2 = CreateFontIndirectA(&logfont);
1118 /* initialize to a font we can compare against */
1119 SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont1, 0);
1120 res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r1);
1122 /* check that setting a larger font results in an larger rect */
1123 SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont2, 0);
1124 res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r2);
1126 OffsetRect(&r1, -r1.left, -r1.top);
1127 OffsetRect(&r2, -r2.left, -r2.top);
1129 ok(r1.bottom < r2.bottom, "Failed to get larger rect with larger font\n");
1132 START_TEST(monthcal)
1135 BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
1136 INITCOMMONCONTROLSEX iccex;
1137 HWND hwnd, parent_wnd;
1139 hComctl32 = GetModuleHandleA("comctl32.dll");
1140 pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx");
1141 if (!pInitCommonControlsEx)
1143 skip("InitCommonControlsEx() is missing. Skipping the tests\n");
1146 iccex.dwSize = sizeof(iccex);
1147 iccex.dwICC = ICC_DATE_CLASSES;
1148 pInitCommonControlsEx(&iccex);
1152 init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
1154 parent_wnd = create_parent_window();
1156 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1157 hwnd = create_monthcal_control(WS_CHILD | WS_BORDER | WS_VISIBLE, parent_wnd);
1159 ok_sequence(sequences, PARENT_SEQ_INDEX, create_monthcal_control_seq, "create monthcal control", TRUE);
1161 SendMessage(hwnd, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0);
1163 test_monthcal_color(hwnd);
1164 test_monthcal_currDate(hwnd);
1165 test_monthcal_firstDay(hwnd);
1166 test_monthcal_unicode(hwnd);
1167 test_monthcal_today(hwnd);
1168 test_monthcal_scroll(hwnd);
1169 test_monthcal_monthrange(hwnd);
1170 test_monthcal_HitTest(hwnd);
1171 test_monthcal_todaylink(hwnd);
1172 test_monthcal_size(hwnd);
1174 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1175 DestroyWindow(hwnd);
1176 ok_sequence(sequences, PARENT_SEQ_INDEX, destroy_monthcal_parent_msgs_seq, "Destroy monthcal (parent msg)", FALSE);
1177 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, destroy_monthcal_child_msgs_seq, "Destroy monthcal (child msg)", FALSE);
1179 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1180 hwnd = create_monthcal_control(MCS_MULTISELECT, parent_wnd);
1182 ok_sequence(sequences, PARENT_SEQ_INDEX, create_monthcal_multi_sel_style_seq, "create monthcal (multi sel style)", TRUE);
1184 test_monthcal_MaxSelDay(hwnd);
1186 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1187 DestroyWindow(hwnd);
1188 ok_sequence(sequences, MONTHCAL_SEQ_INDEX, destroy_monthcal_multi_sel_style_seq, "Destroy monthcal (multi sel style)", FALSE);
1190 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1191 DestroyWindow(parent_wnd);
1192 ok_sequence(sequences, PARENT_SEQ_INDEX, destroy_parent_seq, "Destroy parent window", FALSE);