setupapi: Implement SetupGetFileCompressionInfo on top of SetupGetFileCompressionInfoEx.
[wine] / dlls / comctl32 / tests / trackbar.c
1 /* Unit tests for the track bar control.
2  *
3  * Copyright 2007 Keith Stevens
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14 */
15
16 #include <assert.h>
17 #include <windows.h>
18 #include <commctrl.h>
19 #include <stdio.h>
20
21 #include "wine/test.h"
22 #include "msg.h"
23
24 #define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
25 #define NUM_MSG_SEQUENCE 2
26 #define PARENT_SEQ_INDEX 0
27 #define TRACKBAR_SEQ_INDEX 1
28
29
30 static struct msg_sequence *sequences[NUM_MSG_SEQUENCE];
31
32 static const struct message create_parent_wnd_seq[] = {
33     { WM_GETMINMAXINFO, sent },
34     { WM_NCCREATE, sent },
35     { WM_NCCALCSIZE, sent|wparam, 0 },
36     { WM_CREATE, sent },
37     { WM_SHOWWINDOW, sent|wparam, 1 },
38     { WM_WINDOWPOSCHANGING, sent|wparam, 0 },
39     { WM_WINDOWPOSCHANGING, sent|wparam, 0 },
40     { WM_ACTIVATEAPP, sent|wparam, 1 },
41     { WM_NCACTIVATE, sent|wparam, 1 },
42     { WM_ACTIVATE, sent|wparam, 1 },
43     { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
44     { WM_IME_NOTIFY, sent|defwinproc|optional },
45     { WM_SETFOCUS, sent|wparam|defwinproc, 0 },
46     /* Win9x adds SWP_NOZORDER below */
47     { WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE*/ },
48     { WM_NCCALCSIZE, sent|wparam|optional, 1 },
49     { WM_SIZE, sent },
50     { WM_MOVE, sent },
51     { 0 }
52 };
53
54 static const struct message create_trackbar_wnd_seq[] = {
55     {0}
56 };
57
58 static const struct message parent_empty_test_seq[] = {
59     {0}
60 };
61
62 static const struct message parent_create_trackbar_wnd_seq[] = {
63     { WM_NOTIFYFORMAT, sent},
64     { 0x0129, sent}, /* should be WM_QUERYUISTATE instead of 0x0129 */
65     { WM_WINDOWPOSCHANGING, sent},
66     { WM_NCACTIVATE, sent},
67     { PBT_APMRESUMECRITICAL, sent},
68     { WM_WINDOWPOSCHANGING, sent},
69     { PBT_APMRESUMESTANDBY, sent},
70     { WM_IME_SETCONTEXT, sent|optional},
71     { WM_IME_NOTIFY, sent|optional},
72     { WM_CTLCOLORSTATIC, sent},
73     { WM_NOTIFY, sent},
74     {0}
75 };
76
77 static const struct message parent_new_window_test_seq[] = {
78     { WM_WINDOWPOSCHANGING, sent},
79     { WM_NCACTIVATE, sent},
80     { PBT_APMRESUMECRITICAL, sent},
81     { WM_IME_SETCONTEXT, sent|defwinproc|optional},
82     { WM_IME_NOTIFY, sent|defwinproc|optional},
83     { WM_SETFOCUS, sent|defwinproc},
84     { WM_NOTIFYFORMAT, sent},
85     { 0x0129, sent}, /* should be WM_QUERYUISTATE instead of 0x0129*/
86     {0}
87 };
88
89 static const struct message buddy_window_test_seq[] = {
90     { TBM_GETBUDDY, sent|wparam, TRUE},
91     { TBM_SETBUDDY, sent|wparam, FALSE},
92     { WM_PAINT, sent|defwinproc},
93     { TBM_SETBUDDY, sent|wparam, FALSE},
94     { WM_PAINT, sent|defwinproc},
95     { TBM_GETBUDDY, sent|wparam, TRUE},
96     { TBM_SETBUDDY, sent|wparam, TRUE},
97     { WM_PAINT, sent|defwinproc},
98     { TBM_SETBUDDY, sent|wparam, TRUE},
99     { WM_PAINT, sent|defwinproc},
100     { TBM_GETBUDDY, sent|wparam, FALSE},
101     { TBM_GETBUDDY, sent|wparam, TRUE},
102     {0}
103 };
104
105 static const struct message parent_buddy_window_test_seq[] = {
106     { WM_CTLCOLORSTATIC, sent},
107     { WM_NOTIFY, sent},
108     { WM_CTLCOLORSTATIC, sent},
109     { WM_NOTIFY, sent},
110     { WM_CTLCOLORSTATIC, sent},
111     { WM_NOTIFY, sent},
112     { WM_CTLCOLORSTATIC, sent},
113     { WM_NOTIFY, sent},
114     {0}
115 };
116
117 static const struct message line_size_test_seq[] = {
118     { TBM_SETLINESIZE, sent|lparam, 0, 10},
119     { TBM_SETLINESIZE, sent|lparam, 0, 4},
120     { TBM_GETLINESIZE, sent},
121     {0}
122 };
123
124 static const struct message page_size_test_seq[] = {
125     { TBM_SETPAGESIZE, sent|lparam, 0, 10},
126     { TBM_SETPAGESIZE, sent|lparam, 0, -1},
127     { TBM_GETPAGESIZE, sent},
128     {0}
129 };
130
131 static const struct message position_test_seq[] = {
132     { TBM_SETPOS, sent|wparam|lparam, TRUE, -1},
133     { WM_PAINT, sent|defwinproc},
134     { TBM_GETPOS, sent},
135     { TBM_SETPOS, sent|wparam|lparam, TRUE, 5},
136     { WM_PAINT, sent|defwinproc},
137     { TBM_GETPOS, sent},
138     { TBM_SETPOS, sent|wparam|lparam, TRUE, 1000},
139     { WM_PAINT, sent|defwinproc},
140     { TBM_GETPOS, sent},
141     { TBM_SETPOS, sent|wparam|lparam, FALSE, 20},
142     { TBM_GETPOS, sent},
143     { TBM_GETPOS, sent},
144     {0}
145 };
146
147 static const struct message parent_position_test_seq[] = {
148     { WM_CTLCOLORSTATIC, sent},
149     { WM_NOTIFY, sent},
150     { WM_CTLCOLORSTATIC, sent},
151     { WM_NOTIFY, sent},
152     { WM_CTLCOLORSTATIC, sent},
153     { WM_NOTIFY, sent},
154     {0}
155 };
156
157 static const struct message range_test_seq[] = {
158     { TBM_SETRANGE, sent|wparam|lparam, TRUE, MAKELONG(0, 10)},
159     { WM_PAINT, sent|defwinproc},
160     { TBM_GETRANGEMAX, sent},
161     { TBM_GETRANGEMIN, sent},
162     { TBM_SETRANGE, sent|wparam|lparam, TRUE, MAKELONG(-1, 1000)},
163     { WM_PAINT, sent|defwinproc},
164     { TBM_GETRANGEMAX, sent},
165     { TBM_GETRANGEMIN, sent},
166     { TBM_SETRANGE, sent|wparam|lparam, TRUE, MAKELONG(10, 0)},
167     { WM_PAINT, sent|defwinproc},
168     { TBM_GETRANGEMAX, sent},
169     { TBM_GETRANGEMIN, sent},
170     { TBM_SETRANGE, sent|wparam|lparam, FALSE, MAKELONG(0, 10)},
171     { TBM_GETRANGEMAX, sent},
172     { TBM_GETRANGEMIN, sent},
173     { TBM_SETRANGEMAX, sent|wparam|lparam, TRUE, 10},
174     { WM_PAINT, sent|defwinproc},
175     { TBM_GETRANGEMAX, sent},
176     { TBM_SETRANGEMAX, sent|wparam|lparam, TRUE, -1},
177     { WM_PAINT, sent|defwinproc},
178     { TBM_GETRANGEMAX, sent},
179     { TBM_SETRANGEMAX, sent|wparam|lparam, FALSE, 10},
180     { TBM_GETRANGEMAX, sent},
181     { TBM_SETRANGEMIN, sent|wparam|lparam, TRUE, 0},
182     { WM_PAINT, sent|defwinproc},
183     { TBM_GETRANGEMIN, sent},
184     { TBM_SETRANGEMIN, sent|wparam|lparam, TRUE, 10},
185     { WM_PAINT, sent|defwinproc},
186     { TBM_GETRANGEMIN, sent},
187     { TBM_SETRANGEMIN, sent|wparam|lparam, TRUE, -10},
188     { WM_PAINT, sent|defwinproc},
189     { TBM_GETRANGEMIN, sent},
190     { TBM_SETRANGEMIN, sent|wparam|lparam, FALSE, 5},
191     { TBM_GETRANGEMIN, sent},
192     { TBM_GETRANGEMAX, sent},
193     { TBM_GETRANGEMIN, sent},
194     {0}
195 };
196
197 static const struct message parent_range_test_seq[] = {
198     { WM_CTLCOLORSTATIC, sent},
199     { WM_NOTIFY, sent},
200     { WM_CTLCOLORSTATIC, sent},
201     { WM_NOTIFY, sent},
202     { WM_CTLCOLORSTATIC, sent},
203     { WM_NOTIFY, sent},
204     { WM_CTLCOLORSTATIC, sent},
205     { WM_NOTIFY, sent},
206     { WM_CTLCOLORSTATIC, sent},
207     { WM_NOTIFY, sent},
208     { WM_CTLCOLORSTATIC, sent},
209     { WM_NOTIFY, sent},
210     { WM_CTLCOLORSTATIC, sent},
211     { WM_NOTIFY, sent},
212     { WM_CTLCOLORSTATIC, sent},
213     { WM_NOTIFY, sent},
214     {0}
215 };
216
217 static const struct message selection_test_seq[] = {
218     { TBM_SETSEL, sent|wparam|lparam, TRUE, MAKELONG(0, 10)},
219     { WM_PAINT, sent|defwinproc},
220     { TBM_GETSELEND, sent},
221     { TBM_GETSELSTART, sent},
222     { TBM_SETSEL, sent|wparam|lparam, TRUE, MAKELONG(5, 20)},
223     { WM_PAINT, sent|defwinproc},
224     { TBM_GETSELEND, sent},
225     { TBM_GETSELSTART, sent},
226     { TBM_SETSEL, sent|wparam|lparam, FALSE, MAKELONG(5, 10)},
227     { TBM_GETSELEND, sent},
228     { TBM_GETSELSTART, sent},
229     { TBM_SETSELEND, sent|wparam|lparam, TRUE, 10},
230     { WM_PAINT, sent|defwinproc},
231     { TBM_GETSELEND, sent},
232     { TBM_SETSELEND, sent|wparam|lparam, TRUE, 20},
233     { WM_PAINT, sent|defwinproc},
234     { TBM_GETSELEND, sent},
235     { TBM_SETSELEND, sent|wparam|lparam, TRUE, 4},
236     { WM_PAINT, sent|defwinproc},
237     { TBM_GETSELEND, sent},
238     { TBM_SETSELEND, sent|wparam|lparam, FALSE, 2},
239     { TBM_GETSELEND, sent},
240     { TBM_GETSELEND, sent},
241     { TBM_SETSELSTART, sent|wparam|lparam, TRUE, 5},
242     { WM_PAINT, sent|defwinproc},
243     { TBM_GETSELSTART, sent},
244     { TBM_SETSELSTART, sent|wparam|lparam, TRUE, 0},
245     { WM_PAINT, sent|defwinproc},
246     { TBM_GETSELSTART, sent},
247     { TBM_SETSELSTART, sent|wparam|lparam, TRUE, 20},
248     { WM_PAINT, sent|defwinproc},
249     { TBM_GETSELSTART, sent},
250     { TBM_SETSELSTART, sent|wparam|lparam, FALSE, 8},
251     { TBM_GETSELSTART, sent},
252     { TBM_GETSELSTART, sent},
253     {0}
254 };
255
256 static const struct message parent_selection_test_seq[] = {
257     { WM_CTLCOLORSTATIC, sent},
258     { WM_NOTIFY, sent},
259     { WM_CTLCOLORSTATIC, sent},
260     { WM_NOTIFY, sent},
261     { WM_CTLCOLORSTATIC, sent},
262     { WM_NOTIFY, sent},
263     { WM_CTLCOLORSTATIC, sent},
264     { WM_NOTIFY, sent},
265     { WM_CTLCOLORSTATIC, sent},
266     { WM_NOTIFY, sent},
267     { WM_CTLCOLORSTATIC, sent},
268     { WM_NOTIFY, sent},
269     { WM_CTLCOLORSTATIC, sent},
270     { WM_NOTIFY, sent},
271     { WM_CTLCOLORSTATIC, sent},
272     { WM_NOTIFY, sent},
273     {0}
274 };
275
276 static const struct message tic_settings_test_seq[] = {
277     { TBM_SETTIC, sent|lparam, 0, 0},
278     { TBM_SETTIC, sent|lparam, 0, 5},
279     { TBM_SETTIC, sent|lparam, 0, 10},
280     { TBM_SETTIC, sent|lparam, 0, 20},
281     { TBM_SETRANGE, sent|wparam|lparam, TRUE, MAKELONG(0,10)},
282     { WM_PAINT, sent|defwinproc},
283     { TBM_SETTICFREQ, sent|wparam, 2},
284     { WM_PAINT, sent|defwinproc},
285     { TBM_GETNUMTICS, sent},
286     { TBM_SETTICFREQ, sent|wparam, 5},
287     { WM_PAINT, sent|defwinproc},
288     { TBM_GETNUMTICS, sent},
289     { TBM_SETTICFREQ, sent|wparam, 15},
290     { WM_PAINT, sent|defwinproc},
291     { TBM_GETNUMTICS, sent},
292     { TBM_GETNUMTICS, sent},
293     {0}
294 };
295
296 static const struct message parent_tic_settings_test_seq[] = {
297     { WM_CTLCOLORSTATIC, sent},
298     { WM_NOTIFY, sent},
299     { WM_CTLCOLORSTATIC, sent},
300     { WM_NOTIFY, sent},
301     { WM_CTLCOLORSTATIC, sent},
302     { WM_NOTIFY, sent},
303     { WM_CTLCOLORSTATIC, sent},
304     { WM_NOTIFY, sent},
305     {0}
306 };
307
308 static const struct message thumb_length_test_seq[] = {
309     { TBM_SETTHUMBLENGTH, sent|wparam|lparam, 15, 0},
310     { WM_PAINT, sent|defwinproc},
311     { TBM_GETTHUMBLENGTH, sent},
312     { TBM_SETTHUMBLENGTH, sent|wparam|lparam, 20, 0},
313     { WM_PAINT, sent|defwinproc},
314     { TBM_GETTHUMBLENGTH, sent},
315     { TBM_GETTHUMBLENGTH, sent},
316     {0}
317 };
318
319 static const struct message parent_thumb_length_test_seq[] = {
320     { WM_CTLCOLORSTATIC, sent},
321     { WM_NOTIFY, sent},
322     { WM_CTLCOLORSTATIC, sent},
323     { WM_NOTIFY, sent},
324     {0}
325 };
326
327 static const struct message tic_placement_test_seq[] = {
328     { TBM_GETPTICS, sent},
329     { TBM_GETTIC, sent|wparam, 0},
330     { TBM_GETTIC, sent|wparam, 4},
331     { TBM_GETTIC, sent|wparam, 11},
332     { TBM_GETTICPOS, sent|wparam, 0},
333     { TBM_GETTICPOS, sent|wparam, 4},
334     {0}
335 };
336
337 static const struct message tool_tips_test_seq[] = {
338     { TBM_SETTIPSIDE, sent|wparam, TBTS_TOP},
339     { TBM_SETTIPSIDE, sent|wparam, TBTS_LEFT},
340     { TBM_SETTIPSIDE, sent|wparam, TBTS_BOTTOM},
341     { TBM_SETTIPSIDE, sent|wparam, TBTS_RIGHT},
342     { TBM_SETTOOLTIPS, sent},
343     { TBM_GETTOOLTIPS, sent},
344     { TBM_SETTOOLTIPS, sent},
345     { TBM_GETTOOLTIPS, sent},
346     { TBM_SETTOOLTIPS, sent},
347     { TBM_GETTOOLTIPS, sent},
348     { TBM_GETTOOLTIPS, sent},
349     {0}
350 };
351
352 static const struct message unicode_test_seq[] = {
353     { TBM_SETUNICODEFORMAT, sent|wparam, TRUE},
354     { TBM_SETUNICODEFORMAT, sent|wparam, FALSE},
355     { TBM_GETUNICODEFORMAT, sent},
356     {0}
357 };
358
359 static const struct message ignore_selection_test_seq[] = {
360     { TBM_SETSEL, sent|wparam|lparam, TRUE, MAKELONG(0,10)},
361     { TBM_GETSELEND, sent},
362     { TBM_GETSELSTART, sent},
363     { TBM_SETSEL, sent|wparam|lparam, FALSE, MAKELONG(0,10)},
364     { TBM_GETSELEND, sent},
365     { TBM_GETSELSTART, sent},
366     { TBM_SETSELEND, sent|wparam|lparam, TRUE,0},
367     { TBM_GETSELEND, sent},
368     { TBM_SETSELEND, sent|wparam|lparam, TRUE, 10},
369     { TBM_GETSELEND, sent},
370     { TBM_SETSELEND, sent|wparam|lparam, FALSE,0},
371     { TBM_GETSELEND, sent},
372     { TBM_SETSELSTART, sent|wparam|lparam, TRUE,0},
373     { TBM_GETSELSTART, sent},
374     { TBM_SETSELSTART, sent|wparam|lparam, TRUE, 10},
375     { TBM_GETSELSTART, sent},
376     { TBM_SETSELSTART, sent|wparam|lparam, FALSE,0},
377     { TBM_GETSELSTART, sent},
378     {0}
379 };
380
381 struct subclass_info
382 {
383     WNDPROC oldproc;
384 };
385
386 static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
387     static long defwndproc_counter = 0;
388     LRESULT ret;
389     struct message msg;
390
391     /* do not log painting messages */
392     if (message != WM_PAINT &&
393         message != WM_ERASEBKGND &&
394         message != WM_NCPAINT &&
395         message != WM_NCHITTEST &&
396         message != WM_GETTEXT &&
397         message != WM_GETICON &&
398         message != WM_DEVICECHANGE)
399     {
400         msg.message = message;
401         msg.flags = sent|wparam|lparam;
402         if (defwndproc_counter) msg.flags |= defwinproc;
403         msg.wParam = wParam;
404         msg.lParam = lParam;
405         add_message(sequences, PARENT_SEQ_INDEX, &msg);
406     }
407
408     defwndproc_counter++;
409     ret = DefWindowProcA(hwnd, message, wParam, lParam);
410     defwndproc_counter--;
411
412     return ret;
413 }
414
415 static BOOL register_parent_wnd_class(void){
416     WNDCLASSA cls;
417
418     cls.style = 0;
419     cls.lpfnWndProc = parent_wnd_proc;
420     cls.cbClsExtra = 0;
421     cls.cbWndExtra = 0;
422     cls.hInstance = GetModuleHandleA(NULL);
423     cls.hIcon = 0;
424     cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
425     cls.hbrBackground = GetStockObject(WHITE_BRUSH);
426     cls.lpszMenuName = NULL;
427     cls.lpszClassName = "Trackbar test parent class";
428     return RegisterClassA(&cls);
429 }
430
431 static HWND create_parent_window(void){
432     if (!register_parent_wnd_class())
433         return NULL;
434
435     return CreateWindowEx(0, "Trackbar test parent class",
436         "Trackbar test parent window",
437         WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
438         WS_MAXIMIZEBOX | WS_VISIBLE,
439         0, 0, 100, 100,
440         GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL);
441 }
442
443 static LRESULT WINAPI trackbar_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
444     struct subclass_info *info = (struct subclass_info *) GetWindowLongA(hwnd, GWL_USERDATA);
445     static long defwndproc_counter = 0;
446     LRESULT ret;
447     struct message msg;
448
449     msg.message = message;
450     msg.flags = sent|wparam|lparam;
451     if (defwndproc_counter) msg.flags |= defwinproc;
452     msg.wParam = wParam;
453     msg.lParam = lParam;
454     add_message(sequences, TRACKBAR_SEQ_INDEX, &msg);
455
456     defwndproc_counter++;
457     ret = CallWindowProcA(info->oldproc, hwnd, message, wParam, lParam);
458     defwndproc_counter--;
459
460     return ret;
461 }
462
463 static HWND create_trackbar(DWORD style, HWND parent){
464     struct subclass_info *info;
465     HWND hWndTrack;
466     RECT rect;
467
468     info = HeapAlloc(GetProcessHeap(), 0, sizeof(struct subclass_info));
469     if (!info)
470         return NULL;
471
472     GetClientRect(parent, &rect);
473     hWndTrack = CreateWindowEx(
474       0, TRACKBAR_CLASS,"Trackbar Control", style,
475       rect.right,rect.bottom, 100, 50,
476       parent, NULL,GetModuleHandleA(NULL) ,NULL);
477
478     if (!hWndTrack)
479     {
480         HeapFree(GetProcessHeap(), 0, info);
481         return NULL;
482     }
483
484     info->oldproc = (WNDPROC)SetWindowLongA(hWndTrack, GWL_WNDPROC, (LONG)trackbar_subclass_proc);
485
486     SetWindowLongA(hWndTrack, GWL_USERDATA, (LONG)info);
487
488     return hWndTrack;
489 }
490
491 /* test functions for setters, getters, and sequences */
492
493 static void test_trackbar_buddy(HWND hWndTrackbar){
494     HWND hWndLeftBuddy;
495     HWND hWndRightBuddy;
496     HWND hWndCurrentBuddy;
497     HWND rTest;
498
499     flush_sequences(sequences, NUM_MSG_SEQUENCE);
500
501     hWndLeftBuddy = (HWND) CreateWindowEx(0, STATUSCLASSNAME, NULL, 0,
502         0,0,300,20, NULL, NULL, NULL, NULL);
503     ok(hWndLeftBuddy != NULL, "Expected non NULL value\n");
504
505     if (hWndLeftBuddy != NULL){
506         hWndCurrentBuddy = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, TRUE, 0);
507         rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, FALSE, (LPARAM) hWndLeftBuddy);
508         ok(rTest == hWndCurrentBuddy, "Expected hWndCurrentBuddy\n");
509         rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, FALSE, (LPARAM) hWndLeftBuddy);
510         ok(rTest == hWndLeftBuddy, "Expected hWndLeftBuddy\n");
511     } else
512         skip ("left buddy control not present?\n");
513
514     hWndRightBuddy = (HWND) CreateWindowEx(0, STATUSCLASSNAME, NULL, 0,
515         0,0,300,20,NULL,NULL, NULL, NULL);
516
517     ok(hWndRightBuddy != NULL, "expected non NULL value\n");
518
519     /* test TBM_SETBUDDY */
520     if (hWndRightBuddy != NULL){
521         hWndCurrentBuddy = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, TRUE, 0);
522         rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, TRUE, (LPARAM) hWndRightBuddy);
523         ok(rTest == hWndCurrentBuddy, "Expected hWndCurrentBuddy\n");
524         rTest = (HWND) SendMessage(hWndTrackbar, TBM_SETBUDDY, TRUE, (LPARAM) hWndRightBuddy);
525         ok(rTest == hWndRightBuddy, "Expected hWndRightbuddy\n");
526      } else
527        skip("Right buddy control not present?\n");
528
529     /* test TBM_GETBUDDY */
530     if (hWndLeftBuddy != NULL){
531         rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, FALSE, 0);
532         ok(rTest == hWndLeftBuddy, "Expected hWndLeftBuddy\n");
533         DestroyWindow(hWndLeftBuddy);
534     }
535     if (hWndRightBuddy != NULL){
536         rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETBUDDY, TRUE,0);
537         ok(rTest == hWndRightBuddy, "Expected hWndRightBuddy\n");
538         DestroyWindow(hWndRightBuddy);
539     }
540
541     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, buddy_window_test_seq, "buddy test sequence", TRUE);
542     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_buddy_window_test_seq, "parent buddy test seq", TRUE);
543
544 }
545
546 static void test_line_size(HWND hWndTrackbar){
547     int r;
548
549     flush_sequences(sequences, NUM_MSG_SEQUENCE);
550
551     /* test TBM_SETLINESIZE */
552     r = SendMessage(hWndTrackbar, TBM_SETLINESIZE, 0, 10);
553     r = SendMessage(hWndTrackbar, TBM_SETLINESIZE, 0, 4);
554     expect(10, r);
555
556     /* test TBM_GETLINESIZE */
557     r = SendMessage(hWndTrackbar, TBM_GETLINESIZE, 0,0);
558     expect(4, r);
559
560     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, line_size_test_seq, "linesize test sequence", FALSE);
561     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent line test sequence", FALSE);
562 }
563
564
565 static void test_page_size(HWND hWndTrackbar){
566     int r;
567
568     flush_sequences(sequences, NUM_MSG_SEQUENCE);
569
570     /* test TBM_SETPAGESIZE */
571     r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, 10);
572     expect(20, r);
573     r = SendMessage(hWndTrackbar, TBM_SETPAGESIZE, 0, -1);
574     expect(10, r);
575
576     /* test TBM_GETPAGESIZE */
577     r = SendMessage(hWndTrackbar, TBM_GETPAGESIZE, 0,0);
578     todo_wine{
579         expect(20, r);
580     }
581
582     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, page_size_test_seq, "page size test sequence", FALSE);
583     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent page size test sequence", FALSE);
584 }
585
586 static void test_position(HWND hWndTrackbar){
587     int r;
588
589     flush_sequences(sequences, NUM_MSG_SEQUENCE);
590     /* test TBM_SETPOS */
591     SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, -1);
592     r = SendMessage(hWndTrackbar, TBM_GETPOS, 0, 0);
593     expect(0, r);
594     SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5);
595     r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
596     expect(5, r);
597     SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 1000);
598     r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
599     expect(100, r);
600     SendMessage(hWndTrackbar, TBM_SETPOS, FALSE, 20);
601     r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
602     expect(20, r);
603
604     /* test TBM_GETPOS */
605     r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
606     expect(20, r);
607
608     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, position_test_seq, "position test sequence", TRUE);
609     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_position_test_seq, "parent position test sequence", TRUE);
610 }
611
612 static void test_range(HWND hWndTrackbar){
613     int r;
614
615     flush_sequences(sequences, NUM_MSG_SEQUENCE);
616     /* test TBM_SETRANGE */
617     SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(0, 10));
618     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
619     expect(10, r);
620     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
621     expect(0, r);
622     SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(-1, 1000));
623     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
624     expect(1000, r);
625     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
626     expect(-1, r);
627     SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(10, 0));
628     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
629     expect(0, r);
630     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
631     expect(10, r);
632     SendMessage(hWndTrackbar, TBM_SETRANGE, FALSE, MAKELONG(0,10));
633     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
634     expect(10, r);
635     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
636     expect(0, r);
637
638     /*test TBM_SETRANGEMAX */
639     SendMessage(hWndTrackbar, TBM_SETRANGEMAX, TRUE, 10);
640     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
641     expect(10, r);
642     SendMessage(hWndTrackbar, TBM_SETRANGEMAX, TRUE, -1);
643     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
644     expect(-1, r);
645     SendMessage(hWndTrackbar, TBM_SETRANGEMAX, FALSE, 10);
646     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
647     expect(10, r);
648
649     /* testing TBM_SETRANGEMIN */
650     SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 0);
651     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
652     expect(0, r);
653     SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, 10);
654     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
655     expect(10, r);
656     SendMessage(hWndTrackbar, TBM_SETRANGEMIN, TRUE, -10);
657     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
658     expect(-10, r);
659     SendMessage(hWndTrackbar, TBM_SETRANGEMIN, FALSE, 5);
660     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
661     expect(5, r);
662
663     /* test TBM_GETRANGEMAX */
664     r = SendMessage(hWndTrackbar, TBM_GETRANGEMAX, 0,0);
665     expect(10, r);
666
667     /* test TBM_GETRANGEMIN */
668     r = SendMessage(hWndTrackbar, TBM_GETRANGEMIN, 0,0);
669     expect(5, r);
670
671     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, range_test_seq, "range test sequence", TRUE);
672     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_range_test_seq, "parent range test sequence", TRUE);
673 }
674
675 static void test_selection(HWND hWndTrackbar){
676     int r;
677
678     flush_sequences(sequences, NUM_MSG_SEQUENCE);
679     /* test TBM_SETSEL */
680     SendMessage(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(0,10));
681     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
682     expect(10, r);
683     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
684     expect(5, r);
685     SendMessage(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(5, 20));
686     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
687     expect(10, r);
688     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
689     expect(5, r);
690     SendMessage(hWndTrackbar, TBM_SETSEL, FALSE, MAKELONG(5, 10));
691     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
692     expect(10, r);
693     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
694     expect(5, r);
695
696     /* test TBM_SETSELEND */
697     SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 10);
698     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
699     expect(10, r);
700     SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 20);
701     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
702     expect(10, r);
703     SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 4);
704     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
705     expect(4, r);
706     SendMessage(hWndTrackbar, TBM_SETSELEND, FALSE, 2);
707     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
708     expect(2, r);
709
710     /* test TBM_GETSELEND */
711     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
712     expect(2, r);
713
714     /* testing TBM_SETSELSTART */
715     SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 5);
716     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
717     expect(5, r);
718     SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 0);
719     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
720     expect(5, r);
721     SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 20);
722     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
723     expect(20, r);
724     SendMessage(hWndTrackbar, TBM_SETSELSTART, FALSE, 8);
725     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
726     expect(8, r);
727
728     /* test TBM_GETSELSTART */
729     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
730     expect(8, r);
731
732     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, selection_test_seq, "selection test sequence", TRUE);
733     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_selection_test_seq, "parent selection test seqence", TRUE);
734 }
735
736 static void test_thumb_length(HWND hWndTrackbar){
737     int r;
738
739     flush_sequences(sequences, NUM_MSG_SEQUENCE);
740     /* testing TBM_SETTHUMBLENGTH */
741     SendMessage(hWndTrackbar, TBM_SETTHUMBLENGTH, 15, 0);
742     r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0);
743     expect(15, r);
744     SendMessage(hWndTrackbar, TBM_SETTHUMBLENGTH, 20, 0);
745     r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0);
746     expect(20, r);
747
748     /* test TBM_GETTHUMBLENGTH */
749     r = SendMessage(hWndTrackbar, TBM_GETTHUMBLENGTH, 0,0);
750     expect(20, r);
751
752     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, thumb_length_test_seq, "thumb length test sequence", TRUE);
753     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_thumb_length_test_seq, "parent thumb lenth test sequence", TRUE);
754 }
755
756 static void test_tic_settings(HWND hWndTrackbar){
757     int r;
758
759     flush_sequences(sequences, NUM_MSG_SEQUENCE);
760     /* testing TBM_SETTIC */
761     /* Set tics at 5 and 10 */
762     /* 0 and 20 are out of range and should not be set */
763     r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 0);
764     ok(r == FALSE, "Expected FALSE, got %d\n", r);
765     r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 5);
766     todo_wine{
767         ok(r == TRUE, "Expected TRUE, got %d\n", r);
768         r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 10);
769         ok(r == TRUE, "Expected TRUE, got %d\n", r);
770     }
771     r = SendMessage(hWndTrackbar, TBM_SETTIC, 0, 20);
772     ok(r == FALSE, "Expected False, got %d\n", r);
773
774     /* test TBM_SETTICFREQ */
775     SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(0, 10));
776     SendMessage(hWndTrackbar, TBM_SETTICFREQ, 2, 0);
777     r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
778     expect(6, r);
779     SendMessage(hWndTrackbar, TBM_SETTICFREQ, 5, 0);
780     r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
781     expect(3, r);
782     SendMessage(hWndTrackbar, TBM_SETTICFREQ, 15, 0);
783     r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
784     expect(2, r);
785
786     /* test TBM_GETNUMTICS */
787     /* since TIC FREQ is 15, there should be only 2 tics now */
788     r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
789     expect(2, r);
790
791     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, tic_settings_test_seq, "tic settings test sequence", TRUE);
792     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_tic_settings_test_seq, "parent tic settings test sequence", TRUE);
793 }
794
795 static void test_tic_placement(HWND hWndTrackbar){
796     int r;
797     DWORD *rPTics;
798
799     flush_sequences(sequences, NUM_MSG_SEQUENCE);
800     /* test TBM_GETPTICS */
801     rPTics = (DWORD *) SendMessage(hWndTrackbar, TBM_GETPTICS, 0,0);
802     todo_wine{
803         expect(1, rPTics[0]);
804         expect(2, rPTics[1]);
805         expect(3, rPTics[2]);
806         expect(4, rPTics[3]);
807     }
808
809     /* test TBM_GETTIC */
810     r = SendMessage(hWndTrackbar, TBM_GETTIC, 0,0);
811     todo_wine{
812         expect(1, r);
813         r = SendMessage(hWndTrackbar, TBM_GETTIC, 4,0);
814         expect(5, r);
815     }
816     r = SendMessage(hWndTrackbar, TBM_GETTIC, 11,0);
817     expect(-1, r);
818
819     /* test TBM_GETTICPIC */
820     r = SendMessage(hWndTrackbar, TBM_GETTICPOS, 0, 0);
821     todo_wine{
822         ok(r > 0, "Expected r > 0, got %d\n", r);
823         r = SendMessage(hWndTrackbar, TBM_GETTICPOS, 4, 0);
824         ok(r > 0, "Expected r > 0, got %d\n", r);
825     }
826
827     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, tic_placement_test_seq, "get tic placement test sequence", FALSE);
828     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent get tic placement test sequence", FALSE);
829 }
830
831
832 static void test_tool_tips(HWND hWndTrackbar){
833     int r;
834     HWND hWndTooltip;
835     HWND rTest;
836
837     flush_sequences(sequences, NUM_MSG_SEQUENCE);
838     /* testing TBM_SETTIPSIDE */
839     r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_TOP, 0);
840     todo_wine{
841         expect(0, r);
842     }
843     r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_LEFT, 0);
844     expect(0, r);
845     r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_BOTTOM, 0);
846     expect(1, r);
847     r = SendMessage(hWndTrackbar, TBM_SETTIPSIDE, TBTS_RIGHT, 0);
848     expect(2, r);
849
850     /* testing TBM_SETTOOLTIPS */
851     hWndTooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, 0,
852       CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
853       NULL, NULL, NULL, NULL);
854
855     ok(hWndTooltip != NULL, "Expected non NULL value\n");
856     if (hWndTooltip != NULL){
857         SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 0);
858         rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
859         ok(rTest == hWndTooltip, "Expected hWndToolTip, got\n");
860         SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) NULL, 0);
861         rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
862         ok(rTest == NULL, "Expected NULL\n");
863         SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 5);
864         rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
865         ok(rTest == hWndTooltip, "Expected hWndTooltip, got\n");
866     } else
867         skip("tool tip control not present?\n");
868
869     /* test TBM_GETTOOLTIPS */
870     rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
871     ok(rTest == hWndTooltip, "Expected hWndTooltip\n");
872
873     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, tool_tips_test_seq, "tool tips test sequence", FALSE);
874     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent tool tips test sequence", FALSE);
875 }
876
877
878 static void test_unicode(HWND hWndTrackbar){
879     int r;
880
881     flush_sequences(sequences, NUM_MSG_SEQUENCE);
882     /* testing TBM_SETUNICODEFORMAT */
883     r = SendMessage(hWndTrackbar, TBM_SETUNICODEFORMAT, TRUE, 0);
884     ok(r == FALSE, "Expected FALSE, got %d\n",r);
885     r = SendMessage(hWndTrackbar, TBM_SETUNICODEFORMAT, FALSE, 0);
886     ok(r == TRUE, "Expected TRUE, got %d\n",r);
887
888     /* test TBM_GETUNICODEFORMAT */
889     r = SendMessage(hWndTrackbar, TBM_GETUNICODEFORMAT, 0,0);
890     ok(r == FALSE, "Expected FALSE, got %d\n",r);
891
892     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, unicode_test_seq, "unicode test sequence", FALSE);
893     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent unicode test sequence", FALSE);
894 }
895
896 static void test_ignore_selection(HWND hWndTrackbar){
897     int r;
898
899     flush_sequences(sequences, NUM_MSG_SEQUENCE);
900     /* test TBM_SETSEL  ensure that it is ignored */
901     SendMessage(hWndTrackbar, TBM_SETSEL, TRUE, MAKELONG(0,10));
902     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
903     expect(0, r);
904     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
905     expect(0, r);
906     SendMessage(hWndTrackbar, TBM_SETSEL, FALSE, MAKELONG(0,10));
907     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
908     expect(0, r);
909     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
910     expect(0, r);
911
912     /* test TBM_SETSELEND, ensure that it is ignored */
913     SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 0);
914     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
915     expect(0, r);
916     SendMessage(hWndTrackbar, TBM_SETSELEND, TRUE, 10);
917     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
918     expect(0,r);
919     SendMessage(hWndTrackbar, TBM_SETSELEND, FALSE, 0);
920     r = SendMessage(hWndTrackbar, TBM_GETSELEND, 0,0);
921     expect(0, r);
922
923     /* test TBM_SETSELSTART, ensure that it is ignored */
924     SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 0);
925     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
926     expect(0, r);
927     SendMessage(hWndTrackbar, TBM_SETSELSTART, TRUE, 10);
928     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
929     expect(0,r);
930     SendMessage(hWndTrackbar, TBM_SETSELSTART, FALSE, 0);
931     r = SendMessage(hWndTrackbar, TBM_GETSELSTART, 0,0);
932     expect(0, r);
933
934     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, ignore_selection_test_seq, "ignore selection setting test sequence", FALSE);
935     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_empty_test_seq, "parent ignore selection setting test sequence", FALSE);
936 }
937
938 START_TEST(trackbar)
939 {
940     DWORD style = WS_VISIBLE | TBS_TOOLTIPS | TBS_ENABLESELRANGE | TBS_FIXEDLENGTH | TBS_AUTOTICKS;
941     HWND hWndTrackbar;
942     HWND hWndParent;
943
944     init_msg_sequences(sequences, NUM_MSG_SEQUENCE);
945     InitCommonControls();
946
947     flush_sequences(sequences, NUM_MSG_SEQUENCE);
948
949     /* create parent window */
950     hWndParent = create_parent_window();
951     ok(hWndParent != NULL, "Failed to create parent Window!\n");
952
953     if(!hWndParent){
954         skip("parent window not present\n");
955         return;
956     }
957
958     ok_sequence(sequences, PARENT_SEQ_INDEX, create_parent_wnd_seq, "create Parent Window", TRUE);
959     flush_sequences(sequences, NUM_MSG_SEQUENCE);
960
961     /* create trackbar with set styles */
962     hWndTrackbar = create_trackbar(style, hWndParent);
963
964     ok(hWndTrackbar != NULL, "Expected non NULL value\n");
965
966     if (!hWndTrackbar){
967         skip("trackbar control not present?\n");
968         return;
969     }
970
971     ok_sequence(sequences, TRACKBAR_SEQ_INDEX, create_trackbar_wnd_seq, "create Trackbar Window", FALSE);
972     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_create_trackbar_wnd_seq, "parent trackbar window", TRUE);
973     flush_sequences(sequences, NUM_MSG_SEQUENCE);
974
975     /* TEST OF ALL SETTER and GETTER MESSAGES with required styles turned on*/
976     test_trackbar_buddy(hWndTrackbar);
977     test_line_size(hWndTrackbar);
978     test_page_size(hWndTrackbar);
979     test_position(hWndTrackbar);
980     test_range(hWndTrackbar);
981     test_selection(hWndTrackbar);
982     test_thumb_length(hWndTrackbar);
983     test_tic_settings(hWndTrackbar);
984     test_tic_placement(hWndTrackbar);
985     test_tool_tips(hWndTrackbar);
986     test_unicode(hWndTrackbar);
987
988     flush_sequences(sequences, NUM_MSG_SEQUENCE);
989     DestroyWindow(hWndTrackbar);
990
991     /* test getters and setters without styles set */
992     hWndTrackbar = create_trackbar(0, hWndParent);
993
994     ok(hWndTrackbar != NULL, "Expected non NULL value\n");
995
996     if (!hWndTrackbar){
997         skip("trackbar control not present?\n");
998         return;
999     }
1000
1001     ok_sequence(sequences, PARENT_SEQ_INDEX, parent_new_window_test_seq, "new trackbar window test sequence", TRUE);
1002
1003     test_ignore_selection(hWndTrackbar);
1004
1005     DestroyWindow(hWndTrackbar);
1006
1007     DestroyWindow(hWndParent);
1008 }