57#define compare(val, exp, fmt) ok((val) == (exp), #val " value: " fmt ", expected: " fmt "\n", (val), (exp))
59#define expect(expected, got) ok(expected == got, "expected %d, got %d\n", expected,got)
61#define NUM_MSG_SEQUENCES 2
62#define PARENT_SEQ_INDEX 0
63#define HEADER_SEQ_INDEX 1
77 { WM_QUERYUISTATE,
sent },
289 ok(
notifies_received(),
"setItemUnicodeNotify(): not all expected notifies were received\n");
316 phdiRead->
mask = maskRead;
338 hlayout.
prc = &rectwin;
339 hlayout.
pwpos = &winpos;
342 winpos.
cx, winpos.
cy, 0);
352 ok(hdi1->
cxy == hdi2->
cxy,
"Notify %d cxy mismatch (%08x != %08x)\n",
iCode, hdi1->
cxy, hdi2->
cxy);
368 "Notify %d text mismatch (L\"%s\" vs L\"%s\")\n",
374 "Notify %d text mismatch (\"%s\" vs \"%s\")\n",
394#define TEST_GET_ITEM(i,c)\
395{ res = getItem(hWndHeader, i, buffer);\
396 ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%d)\n", i, res);\
397 ok(strcmp(str_items[c], buffer) == 0, "Getting item[%d] returned \"%s\" expecting \"%s\"\n", i, buffer, str_items[c]);\
400#define TEST_GET_ITEMCOUNT(i)\
401{ res = getItemCount(hWndHeader);\
402 ok(res == i, "Got Item Count as %d\n", res);\
408 static LONG defwndproc_counter = 0;
419 defwndproc_counter++;
421 defwndproc_counter--;
428 static LONG defwndproc_counter = 0;
451 defwndproc_counter++;
453 defwndproc_counter--;
480 return CreateWindowExA(0,
"Header test parent class",
"Header Message Sequence Testing",
496 static char firstHeaderItem[] =
"Name";
497 static char secondHeaderItem[] =
"Size";
498 static char *
items[] = {secondHeaderItem, firstHeaderItem};
511 ok(childHandle !=
NULL,
"failed to create child window\n");
512 if (preloadHeaderItems)
514 for ( loopcnt = 0 ; loopcnt < 2 ; loopcnt++ )
518 ok(retVal == loopcnt,
"Adding item %d failed with return value %d\n", ( loopcnt + 1 ), retVal);
526 hlayout.
prc = &rectwin;
527 hlayout.
pwpos = &winpos;
530 winpos.
cx, winpos.
cy, 0);
543 ok(
ret != -1,
"Failed to add header item.\n");
549 ok(
ret != 0,
"Failed to get item data.\n");
551 ok(
ret != 0,
"Failed to delete item.\n");
556 static char text[] =
"Test";
627 ok(hdiRead.
cxy == hdiCreate.
cxy,
"cxy should be automatically set\n");
632 hdiCreate.
lParam = 0x12345678;
635 ok(hdiRead.
lParam == hdiCreate.
lParam,
"lParam should be automatically set\n");
643 ok(hdiRead.
fmt == hdiCreate.
fmt,
"fmt should be automatically set\n");
652 ok(hdiRead.
hbm ==
NULL,
"hbm should not be automatically set\n");
661 ok(hdiRead.
pszText==
NULL,
"pszText shouldn't be automatically set\n");
682 ok(
ret == -1,
"Creating an item with a zero mask should have failed\n");
689 ok(
ret != -1,
"Adding item with non-zero mask failed\n");
699 ok(
ret != -1,
"Adding item failed\n");
707 ok(hdi.lParam == 133,
"comctl32 4.0 field not set\n");
708 ok(hdi.iImage == 17,
"comctl32 >4.0 field not set\n");
714 ok(hdi.lParam == 133,
"comctl32 4.0 field not read\n");
715 ok(hdi.iImage == 0,
"comctl32 >4.0 field shouldn't be read\n");
729 for (
i = 3;
i >= 0;
i--)
733 ok(
res == 0,
"Adding simple item failed (%d)\n",
res);
738 ok(
res != -1,
"Adding Out of Range item should fail with -1 got (%d)\n",
res);
741 ok(
res != -1,
"Adding Out of Range item should fail with -1 got (%d)\n",
res);
747 ok(
res == 0,
"Getting Out of Range item should fail with 0 (%d), got %s\n",
res,
buffer);
749 ok(
res == 1,
"Getting Out of Range item should fail with 1 (%d), got %s\n",
res,
buffer);
751 ok(
res == 0,
"Getting Out of Range item should fail with 0 (%d), got %s\n",
res,
buffer);
761 ok(
res == 0,
"Setting Out of Range item should fail with 0 (%d)\n",
res);
763 ok(
res == 1,
"Setting Out of Range item should fail with 1 (%d)\n",
res);
765 ok(
res == 0,
"Setting Out of Range item should fail with 0 (%d)\n",
res);
768 for (
i = 0;
i < 4;
i++)
771 ok(
res != 0,
"Setting %d item failed (%d)\n",
i+1,
res);
799 ok(
res == 1,
"Deleting Out of Range item should fail with 1 (%d)\n",
res);
801 ok(
res == 0,
"Deleting Out of Range item should fail with 0 (%d)\n",
res);
805 ok(
res != 0,
"Deleting using out of range index failed (%d)\n",
res);
808 ok(
res != 0,
"Deleting using out of range index failed (%d)\n",
res);
811 ok(
res != 0,
"Deleting using out of range index failed (%d)\n",
res);
814 ok(
res != 0,
"Deleting using out of range index failed (%d)\n",
res);
830 "adder header control to parent",
FALSE);
833 ok(retVal ==
TRUE,
"Getting item rect should TRUE, got %d\n", retVal);
842 ok(retVal ==
TRUE,
"Getting item rect should TRUE, got %d\n", retVal);
851 ok(retVal == 0,
"Getting rect of nonexistent item should return 0, got %d\n", retVal);
865 hdLayout.
pwpos = &windowPos;
870 "adder header control to parent",
FALSE);
889 "adder header control to parent",
FALSE);
905 const int firstItemRightBoundary = 80;
906 const int secondItemRightBoundary = 160;
909 pt.x = firstItemRightBoundary - 1;
910 pt.y = bottomBoundary - 1;
911 hdHitTestInfo.
pt =
pt;
917 "adder header control to parent",
FALSE);
925 pt.x = secondItemRightBoundary - 1;
926 pt.y = bottomBoundary - 1;
927 hdHitTestInfo.
pt =
pt;
933 pt.x = secondItemRightBoundary;
934 pt.y = bottomBoundary + 1;
935 hdHitTestInfo.
pt =
pt;
957 "adder header control to parent",
FALSE);
969 "setHotDivider sequence testing",
TRUE);
972 "setHotDivider sequence testing",
FALSE);
979 HIMAGELIST hImageList = pImageList_Create (4, 4, 0, 1, 0);
987 "adder header control to parent",
FALSE);
992 ok(hIml ==
NULL,
"Expected NULL, got %p\n", hIml);
995 ok(hIml !=
NULL,
"Expected non-NULL handle, got %p\n", hIml);
998 ok(hIml !=
NULL,
"Expected non-NULL handle, got %p\n", hIml);
999 pImageList_Destroy(hIml);
1005 wasValid = pImageList_Destroy(hImageList);
1006 ok(wasValid,
"Header must not free image list at destruction!\n");
1017 "adder header control to parent",
FALSE);
1031 ok(retVal == 100,
"got %d\n", retVal);
1048 win_skip(
"HDM_CLEARFILTER needs 5.80\n");
1054 win_skip(
"HDM_EDITFILTER needs 5.80\n");
1060 "filterMessages sequence testing",
TRUE);
1063 "filterMessages sequence testing",
FALSE);
1076 "adder header control to parent",
FALSE);
1085 "unicodeformatMessages sequence testing",
FALSE);
1097 "adder header control to parent",
FALSE);
1102 win_skip(
"HDM_GETBITMAPMARGIN needs 5.80\n");
1107 "bitmapmarginMessages sequence testing",
FALSE);
1114 int retVal,
i, iSize;
1115 static const int lpiarray[2] = {1, 0};
1116 static const char *item_texts[] = {
1117 "Name",
"Size",
"Type",
"Date Modified"
1128 "adder header control to parent",
TRUE);
1131 "adder header control to parent",
FALSE);
1136 hdItem.
pszText = (
char*)item_texts[
i];
1141 ok(retVal ==
i,
"Adding item %d failed with return value %d\n",
i, retVal);
1148 ok(retVal ==
TRUE,
"Deleting item 3 should return TRUE, got %d\n", retVal);
1150 ok(retVal == 3,
"Getting item count should return 3, got %d\n", retVal);
1153 ok(retVal ==
FALSE,
"Deleting already-deleted item should return FALSE, got %d\n", retVal);
1155 ok(retVal == 3,
"Getting item count should return 3, got %d\n", retVal);
1158 ok(retVal ==
TRUE,
"Deleting item 2 should return TRUE, got %d\n", retVal);
1160 ok(retVal == 2,
"Getting item count should return 2, got %d\n", retVal);
1163 "deleteItem_getItemCount sequence testing",
FALSE);
1169 ok(retVal ==
FALSE,
"Getting already-deleted item should return FALSE, got %d\n", retVal);
1175 ok(retVal ==
TRUE,
"Getting the 1st header item should return TRUE, got %d\n", retVal);
1180 ok(!
strcmp(hdItem.
pszText, item_texts[0]),
"got wrong item %s, expected %s\n",
1181 hdItem.
pszText, item_texts[0]);
1193 ok(
rect.left != 0,
"Expected updated rectangle\n");
1198 ok(retVal ==
TRUE,
"Setting header items order should return TRUE, got %d\n", retVal);
1201 ok(retVal ==
TRUE,
"Getting header items order should return TRUE, got %d\n", retVal);
1207 ok(lpiarray[0] ==
array[0],
"got %d, expected %d\n",
array[0], lpiarray[0]);
1208 ok(lpiarray[1] ==
array[1],
"got %d, expected %d\n",
array[1], lpiarray[1]);
1216 ok(retVal ==
TRUE,
"Aligning 1st header item to center should return TRUE, got %d\n", retVal);
1219 ok(retVal ==
TRUE,
"Aligning 2nd header item to right should return TRUE, got %d\n", retVal);
1236 hdItem.
fmt = HDF_FIXEDWIDTH;
1245 ok(
rect.right != 0,
"Expected not zero width\n");
1246 ok(
rect.bottom != 0,
"Expected not zero height\n");
1256 win_skip(
"HDF_FIXEDWIDTH format not supported\n");
1273 ht.pt.x =
rect.right - 1;
1274 ht.pt.y =
rect.bottom / 2;
1286 ht.pt.y =
rect.bottom / 2;
1303 memset(&hdItem, 0,
sizeof(hdItem));
1317 ok(
rect.right != 0,
"Expected not zero width\n");
1318 ok(
rect.bottom != 0,
"Expected not zero height\n");
1328 win_skip(
"HDS_NOSIZING style not supported\n");
1337 ok(!(hdItem.
fmt & HDF_FIXEDWIDTH),
"Unexpected HDF_FIXEDWIDTH\n");
1351 ht.pt.x =
rect.right - 1;
1352 ht.pt.y =
rect.bottom / 2;
1361 ht.pt.y =
rect.bottom / 2;
1368#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom) \
1369 ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %d\n", draw_stage, nm->dwDrawStage); \
1370 if (item_spec != -1) \
1371 ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %ld\n", item_spec, nm->dwItemSpec); \
1372 ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %ld\n", lparam, nm->lItemlParam); \
1373 ok((nm->rc.top == _top && nm->rc.bottom == _bottom && nm->rc.left == _left && nm->rc.right == _right) || \
1374 broken(draw_stage != CDDS_ITEMPREPAINT),
\
1375 "Invalid rect (%d,%d)-(%d,%d) vs %s\n", _left, _top, _right, _bottom, \
1376 wine_dbgstr_rect(&nm->rc));
1381 ok(
n==1,
"NM_CUSTOMDRAW messages: %d, expected: 1\n",
n);
1393 ok(
FALSE,
"Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n",
n, nm->
dwDrawStage);
1400 ok(
n==4,
"NM_CUSTOMDRAW messages: %d, expected: 4\n",
n);
1420 ok(
FALSE,
"Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n",
n, nm->
dwDrawStage);
1427 ok(
n==5,
"NM_CUSTOMDRAW messages: %d, expected: 5\n",
n);
1450 ok(
FALSE,
"Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n",
n, nm->
dwDrawStage);
1458 ok(
n==4,
"NM_CUSTOMDRAW messages: %d, expected: 4\n",
n);
1478 ok(
FALSE,
"Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n",
n, nm->
dwDrawStage);
1501 "Tests will fail as header size is %dx%d instead of 670x%d\n",
1504 for (
i = 0;
i < 3;
i++)
1508 item.cxy = 50*(
i+1);
1548 "Invalid item ids after '%s'- item %d has lParam %d\n",
type,
i, (
int)hdi.lParam);
1549 ok(hdi.iOrder == expected_order[
i],
1550 "Invalid item order after '%s'- item %d has iOrder %d\n",
type,
i, hdi.iOrder);
1556 const int rand1[] = {0, 1, 1, 0, 4};
1557 const int rand2[] = {4, 5, 6, 7, 4};
1558 const int rand3[] = {5, 5, 1, 6, 1};
1559 const int rand4[] = {1, 5, 2, 7, 6, 1, 4, 2, 3, 2};
1560 const int rand5[] = {7, 8, 5, 6, 7, 2, 1, 9, 10, 10};
1561 const int rand6[] = {2, 8, 3, 4, 0};
1563 const int ids1[] = {3, 0, 2, 1, 4};
1564 const int ord1[] = {0, 1, 2, 3, 4};
1565 const int ids2[] = {3, 9, 7, 0, 2, 1, 4, 8, 6, 5};
1566 const int ord2[] = {0, 4, 7, 1, 2, 3, 9, 8, 6, 5};
1567 const int ord3[] = {0, 3, 9, 2, 1, 8, 7, 6, 5, 4};
1568 const int ids4[] = {9, 0, 1, 8, 6};
1569 const int ord4[] = {1, 0, 4, 3, 2};
1582 for (
i = 0;
i < 5;
i++)
1587 check_order(ids1, ord1, 5,
"insert without iOrder");
1590 for (
i = 0;
i < 5;
i++)
1599 for (
i=0;
i<10;
i++)
1604 check_order(ids2, ord3, 10,
"setitems changing order");
1674#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
1735 ok_(__FILE__,
line)(
ret,
"Expected HDM_SETORDERARRAY to succeed, got %d\n",
ret);
1741 ok_(__FILE__,
line)(
ret,
"Expected HDM_SETORDERARRAY to succeed, got %d\n",
ret);
1745 ok_(__FILE__,
line)(
ret,
"Expected HDM_GETORDERARRAY to succeed, got %d\n",
ret);
1769 win_skip(
"HDM_GETORDERARRAY not implemented.\n");
int strcmp(const char *String1, const char *String2)
char * strcpy(char *DstString, const char *SrcString)
static void init_msg_sequences(struct msg_sequence **seq, int n)
static void flush_sequences(struct msg_sequence **seq, int n)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
#define WideCharToMultiByte
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLuint GLdouble GLdouble GLint GLint order
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
static const struct newhuff ht[]
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define todo_wine_if(is_todo)
#define WS_OVERLAPPEDWINDOW
#define HDM_SETORDERARRAY
#define CDRF_NOTIFYPOSTERASE
#define CDDS_ITEMPREPAINT
#define HDM_GETBITMAPMARGIN
#define HDM_SETUNICODEFORMAT
#define HDM_GETUNICODEFORMAT
#define CDRF_NOTIFYITEMDRAW
#define LPSTR_TEXTCALLBACKA
struct _IMAGELIST * HIMAGELIST
#define CDRF_NOTIFYPOSTPAINT
#define HDN_ITEMCHANGINGA
#define HDM_SETHOTDIVIDER
#define HDN_ITEMCHANGINGW
#define HDM_GETORDERARRAY
#define HDM_SETFILTERCHANGETIMEOUT
#define HDM_CREATEDRAGIMAGE
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
static LRESULT expected_id
HGDIOBJ WINAPI GetStockObject(_In_ int)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define SetWindowLongPtrA
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)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_WINDOWPOSCHANGING
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GetWindowLongPtrA
#define WM_IME_SETCONTEXT
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
BOOL WINAPI UpdateWindow(_In_ HWND)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
#define WM_WINDOWPOSCHANGED
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)