mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 17:01:28 +00:00
[USER32_APITEST] Show that scrollbars can be created when extra window data is requested.
This commit is contained in:
parent
e022d8d7cb
commit
3df31a8217
|
@ -29,6 +29,7 @@ list(APPEND SOURCE
|
|||
RedrawWindow.c
|
||||
RegisterClassEx.c
|
||||
RegisterHotKey.c
|
||||
ScrollBarWndExtra.c
|
||||
ScrollDC.c
|
||||
ScrollWindowEx.c
|
||||
SendMessageTimeout.c
|
||||
|
|
61
modules/rostests/apitests/user32/ScrollBarWndExtra.c
Normal file
61
modules/rostests/apitests/user32/ScrollBarWndExtra.c
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* PROJECT: ReactOS API tests
|
||||
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
|
||||
* PURPOSE: Test for ScrollBar cbWndExtra
|
||||
* COPYRIGHT: Copyright 2019 Mark Jansen <mark.jansen@reactos.org>
|
||||
*
|
||||
* Why do we need this test?
|
||||
* Ask the authors of Civilization II...
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#define BUILTIN_SCROLLBAR "Scrollbar"
|
||||
#define CUSTOM_SCROLLBAR "MSScrollBarClass"
|
||||
|
||||
|
||||
|
||||
START_TEST(ScrollBarWndExtra)
|
||||
{
|
||||
HWND hScrollBar;
|
||||
HWND hScrollBarImpersonator;
|
||||
WNDCLASSA WndClass;
|
||||
ATOM ClassAtom;
|
||||
|
||||
LONG_PTR dummyData = (LONG_PTR)0xbeefbeefbeefbeefULL, result;
|
||||
WNDPROC lpfnWndProc;
|
||||
DWORD dwExtra;
|
||||
|
||||
hScrollBar = CreateWindowExA(0, BUILTIN_SCROLLBAR, "", WS_POPUP,
|
||||
20, 20, 120, 120, NULL, 0, GetModuleHandle(NULL), 0);
|
||||
|
||||
ok(hScrollBar != NULL, "Scrollbar creation failed (%lu)\n", GetLastError());
|
||||
|
||||
lpfnWndProc = (WNDPROC)GetWindowLongPtrA(hScrollBar, GWL_WNDPROC);
|
||||
dwExtra = GetClassLongPtrA(hScrollBar, GCL_CBWNDEXTRA);
|
||||
|
||||
ZeroMemory(&WndClass, sizeof(WndClass));
|
||||
WndClass.style = CS_DBLCLKS | CS_PARENTDC | CS_HREDRAW | CS_VREDRAW;
|
||||
WndClass.lpfnWndProc = lpfnWndProc;
|
||||
WndClass.cbWndExtra = dwExtra + sizeof(LONG_PTR);
|
||||
WndClass.hInstance = GetModuleHandle(NULL);
|
||||
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
WndClass.hbrBackground = GetStockObject(LTGRAY_BRUSH);
|
||||
WndClass.lpszClassName = CUSTOM_SCROLLBAR;
|
||||
ClassAtom = RegisterClassA(&WndClass);
|
||||
|
||||
ok(ClassAtom != 0, "RegisterClassA failed (%lu)\n", GetLastError());
|
||||
DestroyWindow(hScrollBar);
|
||||
|
||||
|
||||
hScrollBarImpersonator = CreateWindowExA(0, CUSTOM_SCROLLBAR, "", WS_POPUP,
|
||||
20, 20, 120, 120, NULL, 0, GetModuleHandle(NULL), 0);
|
||||
ok(hScrollBarImpersonator != NULL, "Scrollbar creation failed (%lu)\n", GetLastError());
|
||||
|
||||
SetWindowLongPtrA(hScrollBarImpersonator, dwExtra, dummyData);
|
||||
result = GetWindowLongPtrA(hScrollBarImpersonator, dwExtra);
|
||||
ok(result == dummyData, "Invalid dummyData\n");
|
||||
|
||||
DestroyWindow(hScrollBarImpersonator);
|
||||
UnregisterClassA(CUSTOM_SCROLLBAR, GetModuleHandle(NULL));
|
||||
}
|
|
@ -31,6 +31,7 @@ extern void func_RealGetWindowClass(void);
|
|||
extern void func_RedrawWindow(void);
|
||||
extern void func_RegisterHotKey(void);
|
||||
extern void func_RegisterClassEx(void);
|
||||
extern void func_ScrollBarWndExtra(void);
|
||||
extern void func_ScrollDC(void);
|
||||
extern void func_ScrollWindowEx(void);
|
||||
extern void func_SendMessageTimeout(void);
|
||||
|
@ -76,6 +77,7 @@ const struct test winetest_testlist[] =
|
|||
{ "RedrawWindow", func_RedrawWindow },
|
||||
{ "RegisterHotKey", func_RegisterHotKey },
|
||||
{ "RegisterClassEx", func_RegisterClassEx },
|
||||
{ "ScrollBarWndExtra", func_ScrollBarWndExtra },
|
||||
{ "ScrollDC", func_ScrollDC },
|
||||
{ "ScrollWindowEx", func_ScrollWindowEx },
|
||||
{ "SendMessageTimeout", func_SendMessageTimeout },
|
||||
|
|
Loading…
Reference in a new issue