ReactOS 0.4.16-dev-2491-g3dc6630
scroll.c
Go to the documentation of this file.
1/*
2 * Unit tests for scrollbar
3 *
4 * Copyright 2008 Lyutin Anatoly (Etersoft)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <assert.h>
22#include <stdarg.h>
23#include <stdio.h>
24#include <windows.h>
25
26#include "wine/test.h"
27
30
32{
33 switch(msg)
34 {
35
36 case WM_CREATE:
37 {
38 hScroll = CreateWindowA( "SCROLLBAR", "", WS_CHILD | WS_VISIBLE, 0, 0, 120, 100, hWnd, (HMENU)100, GetModuleHandleA(0), 0 );
39
40 return 0;
41 }
42 case WM_DESTROY:
44 break;
45 case WM_HSCROLL:
46 case WM_VSCROLL:
47 /* stop tracking */
49 return 0;
50 default:
52 }
53 return 0;
54}
55
57{
59
60 hScroll = NULL;
61 hMainWnd = CreateWindowExA( 0, "MyTestWnd", "Scroll",
64 ok(hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n");
65 ok(hScroll != NULL, "got NULL scroll bar handle\n");
66
67 return hMainWnd;
68}
69
70static void scrollbar_test_track(void)
71{
72 HWND mainwnd;
73
74 mainwnd = create_main_test_wnd();
75
76 /* test that scrollbar tracking is terminated when
77 * the control loses mouse capture */
79 /* a normal return from SendMessage */
80 /* not normal for instances such as closing the window */
81 ok( IsWindow( hScroll), "Scrollbar has gone!\n");
82
84 DestroyWindow(mainwnd);
85}
86
87static void test_EnableScrollBar(void)
88{
89 HWND mainwnd;
90 BOOL ret;
91
92 mainwnd = create_main_test_wnd();
93
95 ok( ret, "The scrollbar should be disabled.\n" );
96 ok( !IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" );
97
99 ok( ret, "The scrollbar should be enabled.\n" );
100 ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
101
102 /* test buttons separately */
104 ok( ret, "The scrollbar LTUP button should be disabled.\n" );
105 ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
107 ok( ret, "The scrollbar should be enabled.\n" );
108 ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
109
111 ok( ret, "The scrollbar RTDN button should be disabled.\n" );
112 ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
114 ok( ret, "The scrollbar should be enabled.\n" );
115 ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
116
117 SetLastError( 0xdeadbeef );
119 ok( !ret, "EnableScrollBar should fail.\n" );
122 || broken(GetLastError() == 0xdeadbeef), /* winxp */
123 "GetLastError() = %lu\n", GetLastError() );
124
125 /* disable window, try to re-enable */
127 ok( !ret, "got %d\n", ret );
128 ok( !IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" );
129
131 ok( ret, "got %d\n", ret );
132 ok( IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" );
133
135 DestroyWindow(mainwnd);
136}
137
138static void test_SetScrollPos(void)
139{
140 HWND mainwnd;
141 int ret;
142
143 mainwnd = create_main_test_wnd();
144
146 ok( !IsWindowEnabled( hScroll ), "The scroll should be disabled.\n" );
147
149 ok( !ret, "The position should not be set.\n" );
150
152 ok( !ret, "The position should be equal to zero\n");
153
154 ret = SetScrollRange( hScroll, SB_CTL, 0, 100, TRUE );
155 ok( ret, "The range should be set.\n" );
156
158 ok( !ret , "The position should not be set.\n" );
159
161 ok( ret == 30, "The position should be set!!!\n");
162
164 ok( IsWindowEnabled( hScroll ), "The scroll should be enabled.\n" );
165
167 ok( ret == 30, "The position should be set.\n" );
168
170 ok( ret == 30, "The position should not be equal to zero\n");
171
172 ret = SetScrollRange( hScroll, SB_CTL, 0, 100, TRUE );
173 ok( ret, "The range should be set.\n" );
174
176 ok( ret == 30, "The position should be set.\n" );
177
179 ok( ret == 30, "The position should not be equal to zero\n");
180
181 SetLastError( 0xdeadbeef );
182 ret = SetScrollPos( mainwnd, SB_CTL, 30, TRUE );
183 ok( !ret, "The position should not be set.\n" );
184 ok( GetLastError() == 0xdeadbeef, "GetLastError() = %lu\n", GetLastError() );
185
186 SetLastError( 0xdeadbeef );
187 ret = GetScrollPos( mainwnd, SB_CTL );
188 ok( !ret, "The position should be equal to zero\n");
189 ok( GetLastError() == 0xdeadbeef, "GetLastError() = %lu\n", GetLastError() );
190
192 DestroyWindow(mainwnd);
193}
194
195static void test_ShowScrollBar(void)
196{
197 HWND mainwnd;
198 BOOL ret;
199
200 mainwnd = create_main_test_wnd();
201
203 ok( ret, "The ShowScrollBar() should not failed.\n" );
204 ok( !IsWindowVisible( hScroll ), "The scrollbar window should not be visible\n" );
205
207 ok( ret, "The ShowScrollBar() should not failed.\n" );
208 ok( !IsWindowVisible( hScroll ), "The scrollbar window should be visible\n" );
209
211 ok( !ret, "The ShowScrollBar() should failed.\n" );
212
213 ret = ShowScrollBar( mainwnd, SB_CTL, TRUE );
214 ok( ret, "The ShowScrollBar() should not fail.\n" );
215
217 DestroyWindow(mainwnd);
218}
219
220static void test_GetScrollBarInfo(void)
221{
223 BOOL ret;
224 SCROLLBARINFO sbi;
225 RECT rect;
226 BOOL (WINAPI *pGetScrollBarInfo)(HWND, LONG, LPSCROLLBARINFO);
227
228 pGetScrollBarInfo = (void*)GetProcAddress(GetModuleHandleA("user32.dll"), "GetScrollBarInfo");
229 if (!pGetScrollBarInfo)
230 {
231 win_skip("GetScrollBarInfo is not available\n");
232 return;
233 }
234
236
237 /* Test GetScrollBarInfo to make sure it returns rcScrollBar in screen
238 * coordinates. */
239 sbi.cbSize = sizeof(sbi);
240 ret = pGetScrollBarInfo( hScroll, OBJID_CLIENT, &sbi);
241 ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
243 ok( ret, "The GetWindowRect() call should not fail.\n" );
245 "unexpected rgstate(0x%lx)\n", sbi.rgstate[0]);
246 ok(EqualRect(&rect, &sbi.rcScrollBar), "WindowRect %s != rcScrollBar %s\n",
248
249 /* Test windows horizontal and vertical scrollbar to make sure rcScrollBar
250 * is still returned in screen coordinates by moving the window, and
251 * making sure that it shifts the rcScrollBar value. */
253 sbi.cbSize = sizeof(sbi);
254 ret = pGetScrollBarInfo( hMainWnd, OBJID_HSCROLL, &sbi);
255 ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
257 ok( ret, "The GetWindowRect() call should not fail.\n" );
258 MoveWindow( hMainWnd, rect.left+5, rect.top+5,
259 rect.right-rect.left, rect.bottom-rect.top, TRUE );
260 rect = sbi.rcScrollBar;
261 OffsetRect(&rect, 5, 5);
262 ret = pGetScrollBarInfo( hMainWnd, OBJID_HSCROLL, &sbi);
263 ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
264 ok(EqualRect(&rect, &sbi.rcScrollBar), "PreviousRect %s != CurrentRect %s\n",
266
267 sbi.cbSize = sizeof(sbi);
268 ret = pGetScrollBarInfo( hMainWnd, OBJID_VSCROLL, &sbi);
269 ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
271 ok( ret, "The GetWindowRect() call should not fail.\n" );
272 MoveWindow( hMainWnd, rect.left+5, rect.top+5,
273 rect.right-rect.left, rect.bottom-rect.top, TRUE );
274 rect = sbi.rcScrollBar;
275 OffsetRect(&rect, 5, 5);
276 ret = pGetScrollBarInfo( hMainWnd, OBJID_VSCROLL, &sbi);
277 ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
278 ok(EqualRect(&rect, &sbi.rcScrollBar), "PreviousRect %s != CurrentRect %s\n",
280
283}
284
285/* some tests designed to show that Horizontal and Vertical
286 * window scroll bar info are not created independently */
288{
289 INT min, max, ret;
290 DWORD winstyle;
291 HWND hwnd;
292 SCROLLINFO si = { sizeof( SCROLLINFO), SIF_TRACKPOS };
293
294 hwnd = CreateWindowExA( 0, "static", "", WS_POPUP | style,
295 0, 0, 10, 10, 0, 0, 0, NULL);
296 assert( hwnd != 0);
297
299 ok( ret ||
300 broken( !ret) /* Win 9x/ME */ , "GetScrollRange failed.\n");
301 /* range is 0,0 if there are no H or V scroll bars. 0,100 otherwise */
302 if( !( style & ( WS_VSCROLL | WS_HSCROLL)))
303 ok( min == 0 && max == 0,
304 "Scroll bar range is %d,%d. Expected 0,0. Style %08lx\n", min, max, style);
305 else
306 ok(( min == 0 && max == 100) ||
307 broken( min == 0 && max == 0), /* Win 9x/ME */
308 "Scroll bar range is %d,%d. Expected 0,100. Style %08lx\n", min, max, style);
310 ok( ret ||
311 broken( !ret) /* Win 9x/ME */ , "GetScrollRange failed.\n");
312 /* range is 0,0 if there are no H or V scroll bars. 0,100 otherwise */
313 if( !( style & ( WS_VSCROLL | WS_HSCROLL)))
314 ok( min == 0 && max == 0,
315 "Scroll bar range is %d,%d. Expected 0,0. Style %08lx\n", min, max, style);
316 else
317 ok(( min == 0 && max == 100) ||
318 broken( min == 0 && max == 0), /* Win 9x/ME */
319 "Scroll bar range is %d,%d. Expected 0,100. Style %08lx\n", min, max, style);
320 /* test GetScrollInfo, vist for vertical SB */
322 /* should fail if no H or V scroll bar styles are present. Succeed otherwise */
323 if( !( style & ( WS_VSCROLL | WS_HSCROLL)))
324 ok( !ret, "GetScrollInfo succeeded unexpectedly. Style is %08lx\n", style);
325 else
326 ok( ret ||
327 broken( !ret), /* Win 9x/ME */
328 "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
329 /* Same for Horizontal SB */
331 /* should fail if no H or V scroll bar styles are present. Succeed otherwise */
332 if( !( style & ( WS_VSCROLL | WS_HSCROLL)))
333 ok( !ret, "GetScrollInfo succeeded unexpectedly. Style is %08lx\n", style);
334 else
335 ok( ret ||
336 broken( !ret), /* Win 9x/ME */
337 "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
338 /* now set the Vertical Scroll range to something that could be the default value it
339 * already has */;
340 ret = SetScrollRange( hwnd, SB_VERT, 0, 100, FALSE);
341 ok( ret, "SetScrollRange failed.\n");
342 /* and request the Horizontal range */
344 ok( ret, "GetScrollRange failed.\n");
345 /* now the range should be 0,100 in ALL cases */
346 ok( min == 0 && max == 100,
347 "Scroll bar range is %d,%d. Expected 0,100. Style %08lx\n", min, max, style);
348 /* See what is different now for GetScrollRange */
350 /* should succeed in ALL cases */
351 ok( ret, "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
353 /* should succeed in ALL cases */
354 ok( ret, "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
355 /* report the windows style */
356 winstyle = GetWindowLongA( hwnd, GWL_STYLE );
357 /* WS_VSCROLL added to the window style */
358 if( !(style & WS_VSCROLL))
359 {
360 if (bThemeActive || style != WS_HSCROLL)
362 ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == ( style | WS_VSCROLL),
363 "unexpected style change %08lx/%08lx\n", winstyle, style);
364 else
365 ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == style,
366 "unexpected style change %08lx/%08lx\n", winstyle, style);
367 }
368 /* do the test again with H and V reversed.
369 * Start with a clean window */
371 hwnd = CreateWindowExA( 0, "static", "", WS_POPUP | style,
372 0, 0, 10, 10, 0, 0, 0, NULL);
373 assert( hwnd != 0);
374 /* Set Horizontal Scroll range to something that could be the default value it
375 * already has */;
376 ret = SetScrollRange( hwnd, SB_HORZ, 0, 100, FALSE);
377 ok( ret, "SetScrollRange failed.\n");
378 /* and request the Vertical range */
380 ok( ret, "GetScrollRange failed.\n");
381 /* now the range should be 0,100 in ALL cases */
382 ok( min == 0 && max == 100,
383 "Scroll bar range is %d,%d. Expected 0,100. Style %08lx\n", min, max, style);
384 /* See what is different now for GetScrollRange */
386 /* should succeed in ALL cases */
387 ok( ret, "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
389 /* should succeed in ALL cases */
390 ok( ret, "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
391 /* report the windows style */
392 winstyle = GetWindowLongA( hwnd, GWL_STYLE );
393 /* WS_HSCROLL added to the window style */
394 if( !(style & WS_HSCROLL))
395 {
396 if (bThemeActive || style != WS_VSCROLL)
398 ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == ( style | WS_HSCROLL),
399 "unexpected style change %08lx/%08lx\n", winstyle, style);
400 else
401 ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == style,
402 "unexpected style change %08lx/%08lx\n", winstyle, style);
403 }
404 /* Slightly change the test to use SetScrollInfo
405 * Start with a clean window */
407 hwnd = CreateWindowExA( 0, "static", "", WS_POPUP | style,
408 0, 0, 10, 10, 0, 0, 0, NULL);
409 assert( hwnd != 0);
410 /* set Horizontal position with SetScrollInfo */
411 si.nPos = 0;
412 si.nMin = 11;
413 si.nMax = 22;
414 si.fMask |= SIF_RANGE;
416 ok( ret, "SetScrollInfo failed. Style is %08lx\n", style);
417 /* and request the Vertical range */
419 ok( ret, "GetScrollRange failed.\n");
420 /* now the range should be 0,100 in ALL cases */
421 ok( min == 0 && max == 100,
422 "Scroll bar range is %d,%d. Expected 0,100. Style %08lx\n", min, max, style);
423 /* See what is different now for GetScrollRange */
425 /* should succeed in ALL cases */
426 ok( ret, "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
428 /* should succeed in ALL cases */
429 ok( ret, "GetScrollInfo failed unexpectedly. Style is %08lx\n", style);
430 /* also test if the window scroll bars are enabled */
432 ok( !ret, "Vertical window scroll bar was not enabled\n");
434 ok( !ret, "Horizontal window scroll bar was not enabled\n");
436 /* finally, check if adding a WS_[HV]SCROLL style of a window makes the scroll info
437 * available */
438 if( style & (WS_HSCROLL | WS_VSCROLL)) return;/* only test if not yet set */
439 /* Start with a clean window */
441 hwnd = CreateWindowExA( 0, "static", "", WS_POPUP ,
442 0, 0, 10, 10, 0, 0, 0, NULL);
443 assert( hwnd != 0);
445 /* should fail */
446 ok( !ret, "GetScrollInfo succeeded unexpectedly. Style is %08lx\n", style);
447 /* add scroll styles */
448 winstyle = GetWindowLongA( hwnd, GWL_STYLE );
451 /* should still fail */
452 ok( !ret, "GetScrollInfo succeeded unexpectedly. Style is %08lx\n", style);
453 /* clean up */
455}
456
459{
460 SCROLLINFO horz, vert;
462 BOOL h_ret, v_ret;
463
464 switch(msg)
465 {
466 case WM_NCCREATE:
467 return cs->lpCreateParams ? DefWindowProcA(hwnd, msg, wparam, lparam) :
468 TRUE;
469
470 case WM_CREATE:
471 horz.cbSize = sizeof horz;
472 horz.fMask = SIF_ALL;
473 horz.nMin = 0xdeadbeaf;
474 horz.nMax = 0xbaadc0de;
475 vert = horz;
476 h_ret = GetScrollInfo(hwnd, SB_HORZ, &horz);
477 v_ret = GetScrollInfo(hwnd, SB_VERT, &vert);
478
479 if(cs->lpCreateParams)
480 {
481 /* WM_NCCREATE was passed to DefWindowProc */
482 if(cs->style & (WS_VSCROLL | WS_HSCROLL))
483 {
484 ok(h_ret && v_ret, "GetScrollInfo() should return NON-zero "
485 "but got h_ret=%d v_ret=%d\n", h_ret, v_ret);
486 ok(vert.nMin == 0 && vert.nMax == 100,
487 "unexpected init values(SB_VERT): min=%d max=%d\n",
488 vert.nMin, vert.nMax);
489 ok(horz.nMin == 0 && horz.nMax == 100,
490 "unexpected init values(SB_HORZ): min=%d max=%d\n",
491 horz.nMin, horz.nMax);
492 }
493 else
494 {
495 ok(!h_ret && !v_ret, "GetScrollInfo() should return zeru, "
496 "but got h_ret=%d v_ret=%d\n", h_ret, v_ret);
497 ok(vert.nMin == 0xdeadbeaf && vert.nMax == 0xbaadc0de,
498 "unexpected initialization(SB_VERT): min=%d max=%d\n",
499 vert.nMin, vert.nMax);
500 ok(horz.nMin == 0xdeadbeaf && horz.nMax == 0xbaadc0de,
501 "unexpected initialization(SB_HORZ): min=%d max=%d\n",
502 horz.nMin, horz.nMax);
503 }
504 }
505 else
506 {
507 ok(!h_ret && !v_ret, "GetScrollInfo() should return zeru, "
508 "but got h_ret=%d v_ret=%d\n", h_ret, v_ret);
509 ok(horz.nMin == 0xdeadbeaf && horz.nMax == 0xbaadc0de &&
510 vert.nMin == 0xdeadbeaf && vert.nMax == 0xbaadc0de,
511 "unexpected initialization\n");
512 }
513 return FALSE; /* abort creation */
514
515 default:
516 /* need for WM_GETMINMAXINFO, which precedes WM_NCCREATE */
517 return 0;
518 }
519}
520
521static void scrollbar_test_init(void)
522{
523 WNDCLASSEXA wc;
524 CHAR cls_name[] = "scroll_test_class";
526 int i;
527
528 memset( &wc, 0, sizeof wc );
529 wc.cbSize = sizeof wc;
536 RegisterClassExA(&wc);
537
538 for(i = 0; i < ARRAY_SIZE(style); i++)
539 {
540 /* need not to destroy these windows due creation abort */
542 100, 100, 100, 100, NULL, NULL, wc.hInstance, (LPVOID)TRUE);
544 100, 100, 100, 100, NULL, NULL, wc.hInstance, (LPVOID)FALSE);
545 }
547}
548
549static void test_SetScrollInfo(void)
550{
552 HWND mainwnd;
553 BOOL ret;
554
555 mainwnd = create_main_test_wnd();
556
558 ok(ret, "scroll bar disabled\n");
559
561
563 ok(!ret, "scroll bar enabled\n");
565 ok(!ret, "Unexpected visible state.\n");
566
567 memset(&si, 0, sizeof(si));
568 si.cbSize = sizeof(si);
569 si.fMask = 0xf;
571 ok(ret, "got %d\n", ret);
572
573 /* SetScrollInfo */
574 memset(&si, 0, sizeof(si));
575 si.cbSize = sizeof(si);
577 ok(!ret, "scroll bar enabled\n");
579 si.nMax = 100;
580 si.nMin = 10;
581 si.nPos = 0;
582 si.nPage = 100;
585 ok(!ret, "scroll bar enabled\n");
587 ok(!ret, "Unexpected visible state.\n");
588
589 si.fMask = 0xf;
591 ok(ret, "got %d\n", ret);
592
594 ok(IsWindowEnabled(hScroll), "expected enabled scrollbar\n");
596 ok(!ret, "Unexpected visible state.\n");
597
599 si.nMax = 10;
600 si.nMin = 100;
601 si.nPos = 0;
602 si.nPage = 100;
605 ok(ret, "scroll bar disabled\n");
607 ok(!ret, "Unexpected visible state.\n");
608
609 /* With visible window. */
610 ShowWindow(mainwnd, SW_SHOW);
611
613 ok(ret, "Unexpected visible state.\n");
614
617 ok(!ret, "Unexpected enabled state.\n");
618
619 /* Enabled state is changed only for visible windows, and only with redraw flag. */
621 si.nMax = 100;
622 si.nMin = 10;
623 si.nPos = 0;
624 si.nPage = 50;
627 ok(!ret, "Unexpected enabled state.\n");
628
629 /* State changes when called with same arguments too. */
631 si.nMax = 100;
632 si.nMin = 10;
633 si.nPos = 0;
634 si.nPage = 50;
637 ok(ret, "Unexpected enabled state.\n");
638
640 si.nMax = 100;
641 si.nMin = 10;
642 si.nPos = 0;
643 si.nPage = 100;
646 ok(!ret, "Unexpected enabled state.\n");
647
650 ok(ret, "Unexpected enabled state.\n");
651
653 si.nMax = 100;
654 si.nMin = 10;
655 si.nPos = 0;
656 si.nPage = 100;
659 ok(!ret, "Unexpected enabled state.\n");
660
663 ok(!ret, "Unexpected enabled state.\n");
664
666 si.nMax = 41;
667 si.nMin = 0;
668 si.nPos = 0;
669 si.nPage = 41;
672 ok(ret, "Unexpected enabled state.\n");
673
675
676 si.fMask = SIF_POS;
677 si.nPos = 3;
678 ret = SetScrollInfo(mainwnd, SB_HORZ, &si, FALSE);
679 ok(ret == 3, "SetScrollInfo returned %d\n", ret);
680
681 /* undocumented flag making SetScrollInfo return previous position */
682 si.fMask = SIF_POS | 0x1000;
683 si.nPos = 4;
684 ret = SetScrollInfo(mainwnd, SB_HORZ, &si, FALSE);
685 ok(ret == 3, "SetScrollInfo returned %d\n", ret);
686
688 DestroyWindow(mainwnd);
689}
690
692
694
696{
697 if (msg == WM_CREATE && ((CREATESTRUCTA*)lparam)->lpCreateParams)
699
700 if (msg == SBM_SETSCROLLINFO)
702
704}
705
706static void test_subclass(void)
707{
708 SCROLLBARINFO scroll_info;
710 WNDCLASSA wc;
711 LRESULT res;
712 HWND hwnd;
713 BOOL r;
714
716 ok(r, "GetClassInfoEx failed: %lu\n", GetLastError());
717 scrollbar_wndproc = class_info.lpfnWndProc;
718
719 memset(&wc, 0, sizeof(wc));
720 wc.cbWndExtra = class_info.cbWndExtra + 3; /* more space than needed works */
722 wc.lpszClassName = "MyTestSubclass";
724 r = RegisterClassA(&wc);
725 ok(r, "RegisterClass failed: %lu\n", GetLastError());
726
727 hwnd = CreateWindowExA( 0, "MyTestSubclass", "Scroll", WS_OVERLAPPEDWINDOW,
729 ok(hwnd != NULL, "Failed to create window: %lu\n", GetLastError());
730
731 r = SetScrollRange(hwnd, SB_CTL, 0, 100, TRUE);
732 ok(r, "SetScrollRange failed: %lu\n", GetLastError());
733
735 ok(!res, "SetScrollPos returned %Iu\n", res);
736
737 memset(&set_scrollinfo, 0xcc, sizeof(set_scrollinfo));
739 ok(res == 2, "SetScrollPos returned %Iu\n", res);
740 ok(set_scrollinfo.cbSize == sizeof(SCROLLINFO), "cbSize = %u\n", set_scrollinfo.cbSize);
741 ok(set_scrollinfo.fMask == (0x1000 | SIF_POS), "fMask = %x\n", set_scrollinfo.fMask);
742 ok(set_scrollinfo.nPos == 1, "nPos = %x\n", set_scrollinfo.nPos);
743
744 memset(&scroll_info, 0xcc, sizeof(scroll_info));
745 scroll_info.cbSize = sizeof(scroll_info);
746 res = SendMessageA(hwnd, SBM_GETSCROLLBARINFO, 0, (LPARAM)&scroll_info);
747 ok(res == 1, "SBM_GETSCROLLBARINFO returned %Iu\n", res);
748
750
751 /* if we skip calling wndproc for WM_CREATE, window is not considered a scrollbar */
752 hwnd = CreateWindowExA( 0, "MyTestSubclass", "Scroll", WS_OVERLAPPEDWINDOW,
753 CW_USEDEFAULT, CW_USEDEFAULT, 100, 100, NULL, NULL, GetModuleHandleA(NULL), (void *)1 );
754 ok(hwnd != NULL, "Failed to create window: %lu\n", GetLastError());
755
756 memset(&scroll_info, 0xcc, sizeof(scroll_info));
757 scroll_info.cbSize = sizeof(scroll_info);
758 res = SendMessageA(hwnd, SBM_GETSCROLLBARINFO, 0, (LPARAM)&scroll_info);
759 ok(!res, "SBM_GETSCROLLBARINFO returned %Iu\n", res);
760
762
763 /* not enough space in extra data */
764 wc.cbWndExtra = class_info.cbWndExtra - 1;
765 wc.lpszClassName = "MyTestSubclass2";
766 r = RegisterClassA(&wc);
767 ok(r, "RegisterClass failed: %lu\n", GetLastError());
768
769 hwnd = CreateWindowExA( 0, "MyTestSubclass2", "Scroll", WS_OVERLAPPEDWINDOW,
771 ok(hwnd != NULL, "Failed to create window: %lu\n", GetLastError());
772
773 memset(&scroll_info, 0xcc, sizeof(scroll_info));
774 scroll_info.cbSize = sizeof(scroll_info);
775 res = SendMessageA(hwnd, SBM_GETSCROLLBARINFO, 0, (LPARAM)&scroll_info);
776 ok(!res, "SBM_GETSCROLLBARINFO returned %Iu\n", res);
777
778 memset(&set_scrollinfo, 0xcc, sizeof(set_scrollinfo));
780 ok(res == 0, "SetScrollPos returned %Iu\n", res);
781 ok(set_scrollinfo.cbSize == sizeof(SCROLLINFO), "cbSize = %u\n", set_scrollinfo.cbSize);
782 ok(set_scrollinfo.fMask == (0x1000 | SIF_POS), "fMask = %x\n", set_scrollinfo.fMask);
783 ok(set_scrollinfo.nPos == 1, "nPos = %x\n", set_scrollinfo.nPos);
784
786}
787
789{
790 SCROLLBARINFO sbi = {0};
792 BOOL ret;
793 RECT rect, intersection;
794 BOOL (WINAPI *pGetScrollBarInfo)(HWND, LONG, LPSCROLLBARINFO);
795
796 si.cbSize = sizeof(si);
798 si.nMin = si.nMax = si.nPos = (int)0xdeadbeef;
799 si.nPage = 0xdeadbeef;
801 todo_wine ok( ret, "GetScrollInfo should succeed\n" );
802
803 todo_wine ok( si.nMin == 1, "unexpected nMin %i\n", si.nMin );
804 todo_wine ok( si.nMax == 10, "unexpected nMax %i\n", si.nMax );
805 todo_wine ok( si.nPage == 3, "unexpected nPage %u\n", si.nPage );
806 todo_wine ok( si.nPos == 4, "unexpected nPos %i\n", si.nPos );
807
808 si.cbSize = sizeof(si);
810 si.nMin = si.nMax = si.nPos = (int)0xdeadbeef;
811 si.nPage = 0xdeadbeef;
813 todo_wine ok( ret, "GetScrollInfo should succeed\n" );
814
815 todo_wine ok( si.nMin == 201, "unexpected nMin %i\n", si.nMin );
816 todo_wine ok( si.nMax == 210, "unexpected nMax %i\n", si.nMax );
817 todo_wine ok( si.nPage == 2, "unexpected nPage %u\n", si.nPage );
818 todo_wine ok( si.nPos == 204, "unexpected nPos %i\n", si.nPos );
819
820 pGetScrollBarInfo = (void*)GetProcAddress(GetModuleHandleA("user32.dll"), "GetScrollBarInfo");
821 if (!pGetScrollBarInfo)
822 {
823 win_skip("GetScrollBarInfo is not available\n");
824 return;
825 }
826
828 ok( ret, "The GetWindowRect() call should not fail.\n" );
829
830 sbi.cbSize = sizeof(sbi);
831 sbi.rgstate[0] = 0xdeadbeef;
832 ret = pGetScrollBarInfo( hMainWnd, OBJID_HSCROLL, &sbi );
833 todo_wine ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
834
835 if (ret)
836 {
837 IntersectRect( &intersection, &sbi.rcScrollBar, &rect );
838 ok( EqualRect( &intersection, &sbi.rcScrollBar ), "hscroll rect %s outside window rect %s\n",
841 "hscroll rect %s should have width > height\n", wine_dbgstr_rect( &rect ));
842 ok( sbi.rgstate[0] == 0, "unexpected hscroll state %#lx\n", sbi.rgstate[0] );
843 }
844
845 sbi.cbSize = sizeof(sbi);
846 sbi.rgstate[0] = 0xdeadbeef;
847 ret = pGetScrollBarInfo( hMainWnd, OBJID_VSCROLL, &sbi );
848 todo_wine ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
849
850 if (ret)
851 {
852 IntersectRect( &intersection, &sbi.rcScrollBar, &rect );
853 ok( EqualRect( &intersection, &sbi.rcScrollBar ), "vscroll rect %s outside window rect %s\n",
856 "vscroll rect %s should have width < height\n", wine_dbgstr_rect( &rect ));
857 ok( sbi.rgstate[0] == 0, "unexpected vscroll state %#lx\n", sbi.rgstate[0] );
858 }
859}
860
862{
863 SCROLLBARINFO sbi;
865 BOOL ret;
866 BOOL (WINAPI *pGetScrollBarInfo)(HWND, LONG, LPSCROLLBARINFO);
867
868 si.cbSize = sizeof(si);
869 si.fMask = SIF_POS;
870 si.nPos = 6;
872 todo_wine ok( ret, "SetScrollInfo should succeed\n" );
873
874 si.nPos = 206;
876 todo_wine ok( ret, "SetScrollInfo should succeed\n" );
877
878 si.nPos = 0xdeadbeef;
880 todo_wine ok( ret, "GetScrollInfo should succeed\n" );
881 todo_wine ok( si.nPos == 6, "unexpected nPos %i\n", si.nPos );
882
883 si.nPos = 0xdeadbeef;
885 todo_wine ok( ret, "GetScrollInfo should succeed\n" );
886 todo_wine ok( si.nPos == 206, "unexpected nPos %i\n", si.nPos );
887
888 pGetScrollBarInfo = (void*)GetProcAddress(GetModuleHandleA("user32.dll"), "GetScrollBarInfo");
889 if (!pGetScrollBarInfo)
890 {
891 win_skip("GetScrollBarInfo is not available\n");
892 return 0;
893 }
894
896 todo_wine ok( ret, "EnableScrollBar should succeed\n" );
897
899 ok( ret, "ShowScrollBar should succeed\n" );
900
901 sbi.cbSize = sizeof(sbi);
902 sbi.rgstate[0] = 0xdeadbeef;
903 ret = pGetScrollBarInfo( hMainWnd, OBJID_HSCROLL, &sbi );
904 todo_wine ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
905 todo_wine ok( sbi.rgstate[0] == STATE_SYSTEM_UNAVAILABLE, "unexpected hscroll state %#lx\n", sbi.rgstate[0] );
906
907 sbi.cbSize = sizeof(sbi);
908 sbi.rgstate[0] = 0xdeadbeef;
909 ret = pGetScrollBarInfo( hMainWnd, OBJID_VSCROLL, &sbi );
910 todo_wine ok( ret, "The GetScrollBarInfo() call should not fail.\n" );
911 todo_wine ok( sbi.rgstate[0] == STATE_SYSTEM_INVISIBLE, "unexpected vscroll state %#lx\n", sbi.rgstate[0] );
912
913 return 0;
914}
915
916static void test_cross_process(const char* argv0)
917{
919 BOOL ret;
921 STARTUPINFOA startup_info = {0};
922 PROCESS_INFORMATION process_info;
923 char path[MAX_PATH];
924
926
927 si.cbSize = sizeof(si);
929 si.nMin = 1;
930 si.nMax = 10;
931 si.nPage = 3;
932 si.nPos = 4;
934
935 si.nMin = 201;
936 si.nMax = 210;
937 si.nPage = 2;
938 si.nPos = 204;
940
941 startup_info.cb = sizeof(startup_info);
942 sprintf( path, "%s scroll read_process %p", argv0, hMainWnd );
943 ret = CreateProcessA( NULL, path, NULL, NULL, FALSE, 0, NULL, NULL, &startup_info, &process_info );
944 ok(ret, "CreateProcess \"%s\" failed err %lu.\n", path, GetLastError());
945
946 /* Messages do not need to be processed to read info. */
948 CloseHandle(process_info.hProcess);
949 CloseHandle(process_info.hThread);
950
951 sprintf( path, "%s scroll write_process %p", argv0, hMainWnd );
952 ret = CreateProcessA( NULL, path, NULL, NULL, FALSE, 0, NULL, NULL, &startup_info, &process_info );
953 ok(ret, "CreateProcess \"%s\" failed err %lu.\n", path, GetLastError());
954
955 /* Modifying info requires a message loop. */
956 while (MsgWaitForMultipleObjects( 1, &process_info.hProcess, FALSE, 5000, QS_SENDMESSAGE ) == 1)
957 {
958 MSG msg;
959 while (PeekMessageA( &msg, NULL, 0, 0, PM_REMOVE ))
960 {
963 }
964 }
965
967 CloseHandle(process_info.hProcess);
968 CloseHandle(process_info.hThread);
969
972}
973
974static void test_visual(void)
975{
976 static const int color_indices[] = {COLOR_SCROLLBAR, COLOR_BTNFACE};
977 static const DWORD styles[] = {SBS_SIZEBOX, SBS_SIZEGRIP};
978 COLORREF old_colors[2], colors[2], color;
979 HWND hwnd;
980 BOOL ret;
981 HDC hdc;
982 int i;
983
984 old_colors[0] = GetSysColor(color_indices[0]);
985 old_colors[1] = GetSysColor(color_indices[1]);
986 colors[0] = RGB(0x11, 0x22, 0x33);
987 colors[1] = RGB(0xaa, 0xbb, 0xcc);
988 ret = SetSysColors(ARRAY_SIZE(color_indices), color_indices, colors);
989 ok(ret, "SetSysColors failed, error %lu.\n", GetLastError());
990
991 for (i = 0; i < ARRAY_SIZE(styles); ++i)
992 {
993 winetest_push_context("style %#lx", styles[i]);
994
995 hwnd = CreateWindowA("ScrollBar", "", WS_POPUP | WS_VISIBLE | styles[i], 0, 0, 20, 20, 0, 0,
996 0, 0);
997 ok(hwnd != NULL, "CreateWindowA failed, error %lu.\n", GetLastError());
999
1000 hdc = GetDC(hwnd);
1001 color = GetPixel(hdc, 5, 5);
1002 ok(color == colors[1], "Expected color %#lx, got %#lx.\n", colors[1], color);
1003
1004 ReleaseDC(hwnd, hdc);
1007 }
1008
1009 ret = SetSysColors(ARRAY_SIZE(color_indices), color_indices, old_colors);
1010 ok(ret, "SetSysColors failed, error %lu.\n", GetLastError());
1011}
1012
1013START_TEST ( scroll )
1014{
1015 char **argv;
1016 int argc;
1017 WNDCLASSA wc;
1018 HMODULE hUxtheme;
1020
1022 if (argc >= 4 && (!strcmp( argv[2], "read_process" ) || !strcmp( argv[2], "write_process" )))
1023 {
1024 long wnd_long = strtol( argv[3], NULL, 16 );
1025 HWND wnd = (HWND)(INT_PTR)wnd_long;
1026
1027 if (!strcmp( argv[2], "read_process" ))
1028 read_process( wnd );
1029 else
1030 write_process( wnd );
1031
1032 return;
1033 }
1034
1036 wc.cbClsExtra = 0;
1037 wc.cbWndExtra = 0;
1039 wc.hIcon = NULL;
1042 wc.lpszMenuName = NULL;
1043 wc.lpszClassName = "MyTestWnd";
1045 RegisterClassA(&wc);
1046
1053 test_subclass();
1055
1056 /* Some test results vary depending of theming being active or not */
1057 hUxtheme = LoadLibraryA("uxtheme.dll");
1058 if (hUxtheme)
1059 {
1060 pIsThemeActive = (void*)GetProcAddress(hUxtheme, "IsThemeActive");
1061 if (pIsThemeActive)
1063 FreeLibrary(hUxtheme);
1064 }
1065
1066 test_visual();
1067
1072
1074}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define VOID
Definition: acefi.h:82
Arabic default style
Definition: afstyles.h:94
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define ARRAY_SIZE(A)
Definition: main.h:20
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
HANDLE HWND
Definition: compat.h:19
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
Definition: process.c:686
MonoAssembly int argc
Definition: metahost.c:107
#define assert(_expr)
Definition: assert.h:32
_ACRTIMP __msvcrt_long __cdecl strtol(const char *, char **, int)
Definition: string.c:1833
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3319
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define RGB(r, g, b)
Definition: precomp.h:67
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint res
Definition: glext.h:9613
GLuint color
Definition: glext.h:6243
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define cs
Definition: i386-dis.c:442
HWND hMainWnd
Definition: magnifier.c:32
#define win_skip
Definition: minitest.h:67
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
Definition: test.h:537
#define todo_wine
Definition: minitest.h:80
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#define sprintf
Definition: sprintf.c:45
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static SYSTEM_INFO si
Definition: virtual.c:39
static const char cls_name[]
Definition: compobj.c:2614
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define min(a, b)
Definition: monoChain.cc:55
#define argv
Definition: mplay32.c:18
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_POPUP
Definition: pedump.c:616
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define WS_HSCROLL
Definition: pedump.c:628
static void test_subclass(void)
Definition: scroll.c:706
static HWND hScroll
Definition: scroll.c:28
static void test_visual(void)
Definition: scroll.c:974
static BOOL bThemeActive
Definition: scroll.c:29
static void scrollbar_test_track(void)
Definition: scroll.c:70
static DWORD WINAPI write_process(HWND hMainWnd)
Definition: scroll.c:861
static LRESULT CALLBACK scroll_init_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: scroll.c:457
static void scrollbar_test_init(void)
Definition: scroll.c:521
static void read_process(HWND hMainWnd)
Definition: scroll.c:788
static void test_cross_process(const char *argv0)
Definition: scroll.c:916
static LRESULT CALLBACK subclass_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: scroll.c:695
static void test_EnableScrollBar(void)
Definition: scroll.c:87
static void test_ShowScrollBar(void)
Definition: scroll.c:195
static WNDPROC scrollbar_wndproc
Definition: scroll.c:691
static void test_SetScrollInfo(void)
Definition: scroll.c:549
static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: scroll.c:31
static HWND create_main_test_wnd(void)
Definition: scroll.c:56
static void test_GetScrollBarInfo(void)
Definition: scroll.c:220
static void scrollbar_test_default(DWORD style)
Definition: scroll.c:287
static void test_SetScrollPos(void)
Definition: scroll.c:138
static SCROLLINFO set_scrollinfo
Definition: scroll.c:693
int winetest_get_mainargs(char ***pargv)
void winetest_wait_child_process(HANDLE process)
#define memset(x, y, z)
Definition: compat.h:39
static char argv0[MAX_PATH]
Definition: shlexec.c:49
& rect
Definition: startmenu.cpp:1413
HBRUSH hbrBackground
Definition: winuser.h:3278
HICON hIcon
Definition: winuser.h:3276
HINSTANCE hInstance
Definition: winuser.h:3275
HCURSOR hCursor
Definition: winuser.h:3277
int cbWndExtra
Definition: winuser.h:3274
UINT style
Definition: winuser.h:3271
LPCSTR lpszMenuName
Definition: winuser.h:3279
LPCSTR lpszClassName
Definition: winuser.h:3280
WNDPROC lpfnWndProc
Definition: winuser.h:3272
int cbClsExtra
Definition: winuser.h:3273
HINSTANCE hInstance
Definition: winuser.h:3314
HCURSOR hCursor
Definition: winuser.h:3316
UINT style
Definition: winuser.h:3310
UINT cbSize
Definition: winuser.h:3309
WNDPROC lpfnWndProc
Definition: winuser.h:3311
LPCSTR lpszClassName
Definition: winuser.h:3319
HBRUSH hbrBackground
Definition: winuser.h:3317
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3862
#define max(a, b)
Definition: svc.c:63
static IsThemeActiveT pIsThemeActive
Definition: treelist.c:367
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define OBJID_VSCROLL
Definition: winable.h:20
#define OBJID_HSCROLL
Definition: winable.h:21
#define OBJID_CLIENT
Definition: winable.h:19
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
DWORD COLORREF
Definition: windef.h:100
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CS_VREDRAW
Definition: winuser.h:666
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define QS_SENDMESSAGE
Definition: winuser.h:891
#define WM_HSCROLL
Definition: winuser.h:1771
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define SBS_SIZEGRIP
Definition: winuser.h:332
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define COLOR_WINDOW
Definition: winuser.h:929
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define COLOR_SCROLLBAR
Definition: winuser.h:923
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct tagSCROLLINFO SCROLLINFO
#define WM_VSCROLL
Definition: winuser.h:1772
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define SIF_RANGE
Definition: winuser.h:1246
#define WM_CREATE
Definition: winuser.h:1636
BOOL WINAPI SetSysColors(_In_ int cElements, _In_reads_(cElements) CONST INT *lpaElements, _In_reads_(cElements) CONST COLORREF *lpaRgbValues)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SB_VERT
Definition: winuser.h:553
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
#define ESB_DISABLE_BOTH
Definition: winuser.h:556
#define SBS_SIZEBOX
Definition: winuser.h:329
#define CS_HREDRAW
Definition: winuser.h:661
#define ESB_DISABLE_RTDN
Definition: winuser.h:561
#define IDC_ARROW
Definition: winuser.h:695
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetClassInfoExA(_In_opt_ HINSTANCE, _In_ LPCSTR, _Out_ LPWNDCLASSEXA)
#define SIF_PAGE
Definition: winuser.h:1244
#define RDW_UPDATENOW
Definition: winuser.h:1231
#define RDW_ERASE
Definition: winuser.h:1222
struct tagSCROLLBARINFO * LPSCROLLBARINFO
#define WM_LBUTTONDOWN
Definition: winuser.h:1804
#define SIF_TRACKPOS
Definition: winuser.h:1248
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
int WINAPI SetScrollPos(_In_ HWND, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI GetScrollRange(_In_ HWND, _In_ int, _Out_ LPINT, _Out_ LPINT)
#define WM_NCCREATE
Definition: winuser.h:1711
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
BOOL WINAPI SetScrollRange(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define SIF_DISABLENOSCROLL
Definition: winuser.h:1247
#define PM_REMOVE
Definition: winuser.h:1207
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define RDW_ERASENOW
Definition: winuser.h:1230
#define RDW_FRAME
Definition: winuser.h:1223
#define STATE_SYSTEM_INVISIBLE
Definition: winuser.h:2984
#define SIF_ALL
Definition: winuser.h:1243
#define IDC_IBEAM
Definition: winuser.h:696
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define STATE_SYSTEM_OFFSCREEN
Definition: winuser.h:2985
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define STATE_SYSTEM_UNAVAILABLE
Definition: winuser.h:2969
#define SIF_POS
Definition: winuser.h:1245
#define SB_CTL
Definition: winuser.h:554
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SW_SHOW
Definition: winuser.h:786
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define WM_DESTROY
Definition: winuser.h:1637
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
int WINAPI GetScrollPos(_In_ HWND, _In_ int)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
#define GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EnableScrollBar(_In_ HWND, _In_ UINT, _In_ UINT)
#define ESB_ENABLE_BOTH
Definition: winuser.h:563
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define RDW_INVALIDATE
Definition: winuser.h:1225
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2459
#define SB_HORZ
Definition: winuser.h:552
#define COLOR_BTNFACE
Definition: winuser.h:939
#define ESB_DISABLE_LTUP
Definition: winuser.h:559
const char * LPCSTR
Definition: xmlstorage.h:183
char CHAR
Definition: xmlstorage.h:175