ReactOS 0.4.16-dev-91-g764881a
header.c
Go to the documentation of this file.
1/* Unit test suite for header control.
2 *
3 * Copyright 2005 Vijay Kiran Kamuju
4 * Copyright 2007 Shanren Zhou
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
22#include <windows.h>
23#include <commctrl.h>
24
25#include "wine/test.h"
26#include "v6util.h"
27#include "msg.h"
28
29static HIMAGELIST (WINAPI *pImageList_Create)(int, int, UINT, int, int);
30static BOOL (WINAPI *pImageList_Destroy)(HIMAGELIST);
31
32typedef struct tagEXPECTEDNOTIFY
33{
38
39typedef LRESULT (*CUSTOMDRAWPROC)(int n, NMCUSTOMDRAW *nm);
40
46
52
55#define MAX_CHARS 100
56
57#define compare(val, exp, fmt) ok((val) == (exp), #val " value: " fmt ", expected: " fmt "\n", (val), (exp))
58
59#define expect(expected, got) ok(expected == got, "expected %d, got %d\n", expected,got)
60
61#define NUM_MSG_SEQUENCES 2
62#define PARENT_SEQ_INDEX 0
63#define HEADER_SEQ_INDEX 1
64
66
67static const struct message create_parent_wnd_seq[] = {
69 { WM_NCCREATE, sent },
71 { WM_CREATE, sent },
72 { 0 }
73};
74
76 { WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
77 { WM_QUERYUISTATE, sent },
84 { WM_ACTIVATE, sent|wparam, 1 },
89 { WM_SIZE, sent|wparam, 0 },
90 { WM_MOVE, sent|wparam, 0 },
91 { 0 }
92};
93
94static const struct message add_header_to_parent_seq[] = {
95 { WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
96 { WM_QUERYUISTATE, sent|optional },
98 { 0 }
99};
100
101static const struct message insertItem_seq[] = {
106 { 0 }
107};
108
109static const struct message getItem_seq[] = {
110 { HDM_GETITEMA, sent|wparam, 3 },
111 { HDM_GETITEMA, sent|wparam, 0 },
112 { 0 }
113};
114
115
116static const struct message deleteItem_getItemCount_seq[] = {
117 { HDM_DELETEITEM, sent|wparam, 3 },
119 { HDM_DELETEITEM, sent|wparam, 3 },
121 { HDM_DELETEITEM, sent|wparam, 2 },
123 { 0 }
124};
125
126static const struct message orderArray_seq[] = {
129 { 0 }
130};
131
132static const struct message setItem_seq[] = {
133 { HDM_SETITEMA, sent|wparam, 0 },
134 { HDM_SETITEMA, sent|wparam, 1 },
135 { 0 }
136};
137
138static const struct message getItemRect_seq[] = {
141 { HDM_GETITEMRECT, sent|wparam, 10 },
142 { 0 }
143};
144
145static const struct message layout_seq[] = {
146 { HDM_LAYOUT, sent },
147 { 0 }
148};
149
150static const struct message orderToIndex_seq[] = {
152 { 0 }
153};
154
155static const struct message hittest_seq[] = {
156 { HDM_HITTEST, sent },
157 { HDM_HITTEST, sent },
158 { HDM_HITTEST, sent },
159 { 0 }
160};
161
162static const struct message setHotDivider_seq_interactive[] = {
171 { 0 }
172};
173
178 { 0 }
179};
180
181static const struct message imageMessages_seq[] = {
185 { 0 }
186};
187
191 { HDM_EDITFILTER, sent|wparam|lparam, 1, 0 },
195 { 0 }
196};
197
201 { HDM_EDITFILTER, sent|wparam|lparam, 1, 0 },
204 { 0 }
205};
206
207static const struct message unicodeformatMessages_seq[] = {
210 { 0 }
211};
212
213static const struct message bitmapmarginMessages_seq[] = {
215 { 0 }
216};
217
218
219static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
220{
221 ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify);
222 if (nExpectedNotify < 10)
223 {
228 }
229}
230
232{
233 ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify);
234 if (nExpectedNotify < 10)
236}
237
239{
243 return fRet;
244}
245
246static LONG addItem(HWND hdex, int idx, LPSTR text)
247{
248 HDITEMA hdItem;
249 hdItem.mask = HDI_TEXT | HDI_WIDTH;
250 hdItem.cxy = 100;
251 hdItem.pszText = text;
252 hdItem.cchTextMax = 0;
253 return SendMessageA(hdex, HDM_INSERTITEMA, idx, (LPARAM)&hdItem);
254}
255
256static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
257{
258 LONG ret;
259 HDITEMA hdexItem;
260 hdexItem.mask = HDI_TEXT;
261 hdexItem.pszText = text;
262 hdexItem.cchTextMax = 0;
263 if (fCheckNotifies)
264 {
267 }
268 ret = SendMessageA(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
269 if (fCheckNotifies)
270 ok(notifies_received(), "setItem(): not all expected notifies were received\n");
271 return ret;
272}
273
275{
276 LONG ret;
277 HDITEMA hdexItem;
278 HDITEMW hdexNotify;
279 hdexItem.mask = HDI_TEXT;
280 hdexItem.pszText = text;
281 hdexItem.cchTextMax = 0;
282
283 hdexNotify.mask = HDI_TEXT;
284 hdexNotify.pszText = wText;
285
288 ret = SendMessageA(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
289 ok(notifies_received(), "setItemUnicodeNotify(): not all expected notifies were received\n");
290 return ret;
291}
292
293static LONG delItem(HWND hdex, int idx)
294{
295 return SendMessageA(hdex, HDM_DELETEITEM, idx, 0);
296}
297
299{
300 return SendMessageA(hdex, HDM_GETITEMCOUNT, 0, 0);
301}
302
304{
305 HDITEMA hdItem;
306 hdItem.mask = HDI_TEXT;
307 hdItem.pszText = textBuffer;
308 hdItem.cchTextMax = MAX_CHARS;
309 return SendMessageA(hdex, HDM_GETITEMA, idx, (LPARAM)&hdItem);
310}
311
312static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
313{
314 ok(SendMessageA(hdex, HDM_INSERTITEMA, 0, (LPARAM)phdiCreate)!=-1, "Adding item failed\n");
315 ZeroMemory(phdiRead, sizeof(HDITEMA));
316 phdiRead->mask = maskRead;
317 ok(SendMessageA(hdex, HDM_GETITEMA, 0, (LPARAM)phdiRead)!=0, "Getting item data failed\n");
318 ok(SendMessageA(hdex, HDM_DELETEITEM, 0, 0)!=0, "Deleting item failed\n");
319}
320
322{
323 HWND handle;
324 HDLAYOUT hlayout;
325 RECT rectwin;
326 WINDOWPOS winpos;
327
330 0, 0, 0, 0,
332 ok(handle != NULL, "failed to create header window\n");
333
336
338 hlayout.prc = &rectwin;
339 hlayout.pwpos = &winpos;
340 SendMessageA(handle, HDM_LAYOUT, 0, (LPARAM)&hlayout);
341 SetWindowPos(handle, winpos.hwndInsertAfter, winpos.x, winpos.y,
342 winpos.cx, winpos.cy, 0);
343
344 return handle;
345}
346
347static void compare_items(INT iCode, HDITEMA *hdi1, HDITEMA *hdi2, BOOL fUnicode)
348{
349 ok(hdi1->mask == hdi2->mask, "Notify %d mask mismatch (%08x != %08x)\n", iCode, hdi1->mask, hdi2->mask);
350 if (hdi1->mask & HDI_WIDTH)
351 {
352 ok(hdi1->cxy == hdi2->cxy, "Notify %d cxy mismatch (%08x != %08x)\n", iCode, hdi1->cxy, hdi2->cxy);
353 }
354 if (hdi1->mask & HDI_TEXT)
355 {
356 if (hdi1->pszText == LPSTR_TEXTCALLBACKA)
357 {
358 ok(hdi1->pszText == LPSTR_TEXTCALLBACKA, "Notify %d - only one item is LPSTR_TEXTCALLBACK\n", iCode);
359 }
360 else
361 if (fUnicode)
362 {
363 char buf1[260];
364 char buf2[260];
365 WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)hdi1->pszText, -1, buf1, 260, NULL, NULL);
366 WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)hdi2->pszText, -1, buf2, 260, NULL, NULL);
367 ok(lstrcmpW((LPWSTR)hdi1->pszText, (LPWSTR)hdi2->pszText)==0,
368 "Notify %d text mismatch (L\"%s\" vs L\"%s\")\n",
369 iCode, buf1, buf2);
370 }
371 else
372 {
373 ok(strcmp(hdi1->pszText, hdi2->pszText)==0,
374 "Notify %d text mismatch (\"%s\" vs \"%s\")\n",
375 iCode, hdi1->pszText, hdi2->pszText);
376 }
377 }
378}
379
380static char pszFirstItem[] = "First Item";
381static char pszSecondItem[] = "Second Item";
382static char pszThirdItem[] = "Third Item";
383static char pszFourthItem[] = "Fourth Item";
384static char pszReplaceItem[] = "Replace Item";
385static char pszOutOfRangeItem[] = "Out Of Range Item";
386
387static char *str_items[] =
389
390static char pszUniTestA[] = "TST";
391static WCHAR pszUniTestW[] = {'T','S','T',0};
392
393
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]);\
398}
399
400#define TEST_GET_ITEMCOUNT(i)\
401{ res = getItemCount(hWndHeader);\
402 ok(res == i, "Got Item Count as %d\n", res);\
403}
404
406{
408 static LONG defwndproc_counter = 0;
409 struct message msg = { 0 };
410 LRESULT ret;
411
412 msg.message = message;
413 msg.flags = sent|wparam|lparam;
414 if (defwndproc_counter) msg.flags |= defwinproc;
415 msg.wParam = wParam;
416 msg.lParam = lParam;
418
419 defwndproc_counter++;
421 defwndproc_counter--;
422
423 return ret;
424}
425
427{
428 static LONG defwndproc_counter = 0;
429 LRESULT ret;
430 struct message msg;
431
432 /* do not log painting messages */
433 if (message != WM_PAINT &&
435 message != WM_NCPAINT &&
437 message != WM_GETTEXT &&
438 message != WM_GETICON &&
440
441 {
442 msg.message = message;
443 msg.flags = sent|wparam|lparam;
444 if (defwndproc_counter) msg.flags |= defwinproc;
445 msg.wParam = wParam;
446 msg.lParam = lParam;
447 msg.id = 0;
449 }
450
451 defwndproc_counter++;
453 defwndproc_counter--;
454
455 return ret;
456}
457
459{
460 WNDCLASSA cls;
461
462 cls.style = 0;
464 cls.cbClsExtra = 0;
465 cls.cbWndExtra = 0;
467 cls.hIcon = 0;
470 cls.lpszMenuName = NULL;
471 cls.lpszClassName = "Header test parent class";
472 return RegisterClassA(&cls);
473}
474
476{
478 return NULL;
479
480 return CreateWindowExA(0, "Header test parent class", "Header Message Sequence Testing",
485}
486
487static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
488{
489 WNDPROC oldproc;
490 HWND childHandle;
491 HDLAYOUT hlayout;
492 RECT rectwin;
493 WINDOWPOS winpos;
494 int retVal;
495 int loopcnt;
496 static char firstHeaderItem[] = "Name";
497 static char secondHeaderItem[] = "Size";
498 static char *items[] = {secondHeaderItem, firstHeaderItem};
499 HDITEMA hdItem;
500 hdItem.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
501 hdItem.fmt = HDF_LEFT;
502 hdItem.cxy = 80;
503 hdItem.cchTextMax = 260;
504
506
507 childHandle = CreateWindowExA(0, WC_HEADERA, NULL,
509 0, 0, 0, 0,
510 hParent, NULL, NULL, NULL);
511 ok(childHandle != NULL, "failed to create child window\n");
512 if (preloadHeaderItems)
513 {
514 for ( loopcnt = 0 ; loopcnt < 2 ; loopcnt++ )
515 {
516 hdItem.pszText = items[loopcnt];
517 retVal = SendMessageA(childHandle, HDM_INSERTITEMA, loopcnt, (LPARAM) &hdItem);
518 ok(retVal == loopcnt, "Adding item %d failed with return value %d\n", ( loopcnt + 1 ), retVal);
519 }
520 }
521
523 ShowWindow (hParent, SW_SHOW);
524
525 GetClientRect(hParent,&rectwin);
526 hlayout.prc = &rectwin;
527 hlayout.pwpos = &winpos;
528 SendMessageA(childHandle,HDM_LAYOUT,0,(LPARAM) &hlayout);
529 SetWindowPos(childHandle, winpos.hwndInsertAfter, winpos.x, winpos.y,
530 winpos.cx, winpos.cy, 0);
531
532 oldproc = (WNDPROC)SetWindowLongPtrA(childHandle, GWLP_WNDPROC,
534 SetWindowLongPtrA(childHandle, GWLP_USERDATA, (LONG_PTR)oldproc);
535 return childHandle;
536}
537
539{
540 int ret;
541
543 ok(ret != -1, "Failed to add header item.\n");
544
545 memset(item, 0, sizeof(*item));
546 item->mask = mask;
547
549 ok(ret != 0, "Failed to get item data.\n");
551 ok(ret != 0, "Failed to delete item.\n");
552}
553
555{
556 static char text[] = "Test";
558 HBITMAP hbm;
559 HWND hwnd;
560
562
563 /* Windows implicitly sets some format bits in INSERTITEM */
564
565 /* HDF_STRING is automatically set and cleared for no text */
567 item.pszText = text;
568 item.cxy = 100;
569 item.fmt = HDF_CENTER;
571 ok(item.fmt == (HDF_STRING | HDF_CENTER), "Unexpected item format mask %#x.\n", item.fmt);
572
573 item.mask = HDI_WIDTH | HDI_FORMAT;
574 item.pszText = text;
575 item.fmt = HDF_CENTER | HDF_STRING;
577 ok(item.fmt == HDF_CENTER, "Unexpected item format mask %#x.\n", item.fmt);
578
579 /* HDF_BITMAP is automatically set and cleared for a NULL bitmap or no bitmap */
581 item.hbm = hbm = CreateBitmap(16, 16, 1, 8, NULL);
582 item.fmt = HDF_CENTER;
584 ok(item.fmt == (HDF_BITMAP | HDF_CENTER), "Unexpected item format mask %#x.\n", item.fmt);
586
588 item.hbm = NULL;
589 item.fmt = HDF_CENTER | HDF_BITMAP;
591 ok(item.fmt == HDF_CENTER, "Unexpected item format mask %#x.\n", item.fmt);
592
593 item.mask = HDI_WIDTH | HDI_FORMAT;
594 item.fmt = HDF_CENTER | HDF_BITMAP;
596 ok(item.fmt == HDF_CENTER, "Unexpected item format mask %#x.\n", item.fmt);
597
598 /* HDF_IMAGE is automatically set but not cleared */
600 item.iImage = 17;
602 ok(item.fmt == (HDF_IMAGE | HDF_CENTER), "Unexpected item format mask %#x.\n", item.fmt);
603
604 item.mask = HDI_WIDTH | HDI_FORMAT;
605 item.fmt = HDF_CENTER | HDF_IMAGE;
606 item.iImage = 0;
608 ok(item.fmt == (HDF_CENTER | HDF_IMAGE), "Unexpected item format mask %#x.\n", item.fmt);
609
611}
612
613static void check_auto_fields(void)
614{
615 HDITEMA hdiCreate;
616 HDITEMA hdiRead;
617 static CHAR text[] = "Test";
618 LONG res;
619
620 /* Windows stores the format, width, lparam even if they are not in the item's mask */
621 ZeroMemory(&hdiCreate, sizeof(HDITEMA));
622 hdiCreate.mask = HDI_TEXT;
623 hdiCreate.cxy = 100;
624 hdiCreate.pszText = text;
625 addReadDelItem(hWndHeader, &hdiCreate, HDI_WIDTH, &hdiRead);
627 ok(hdiRead.cxy == hdiCreate.cxy, "cxy should be automatically set\n");
628
629 ZeroMemory(&hdiCreate, sizeof(HDITEMA));
630 hdiCreate.mask = HDI_TEXT;
631 hdiCreate.pszText = text;
632 hdiCreate.lParam = 0x12345678;
633 addReadDelItem(hWndHeader, &hdiCreate, HDI_LPARAM, &hdiRead);
635 ok(hdiRead.lParam == hdiCreate.lParam, "lParam should be automatically set\n");
636
637 ZeroMemory(&hdiCreate, sizeof(HDITEMA));
638 hdiCreate.mask = HDI_TEXT;
639 hdiCreate.pszText = text;
640 hdiCreate.fmt = HDF_STRING|HDF_CENTER;
641 addReadDelItem(hWndHeader, &hdiCreate, HDI_FORMAT, &hdiRead);
643 ok(hdiRead.fmt == hdiCreate.fmt, "fmt should be automatically set\n");
644
645 /* others fields are not set */
646 ZeroMemory(&hdiCreate, sizeof(HDITEMA));
647 hdiCreate.mask = HDI_TEXT;
648 hdiCreate.pszText = text;
649 hdiCreate.hbm = CreateBitmap(16, 16, 1, 8, NULL);
650 addReadDelItem(hWndHeader, &hdiCreate, HDI_BITMAP, &hdiRead);
652 ok(hdiRead.hbm == NULL, "hbm should not be automatically set\n");
653 DeleteObject(hdiCreate.hbm);
654
655 ZeroMemory(&hdiCreate, sizeof(HDITEMA));
656 hdiCreate.mask = HDI_IMAGE;
657 hdiCreate.iImage = 17;
658 hdiCreate.pszText = text;
659 addReadDelItem(hWndHeader, &hdiCreate, HDI_TEXT, &hdiRead);
661 ok(hdiRead.pszText==NULL, "pszText shouldn't be automatically set\n");
662
663 /* field from comctl >4.0 not tested as the system probably won't touch them */
664}
665
666static void check_mask(void)
667{
668 HDITEMA hdi;
669 static CHAR text[] = "ABC";
670 LRESULT ret;
671
672 /* don't create items if the mask is zero */
673 ZeroMemory(&hdi, sizeof(hdi));
674 hdi.mask = 0;
675 hdi.cxy = 200;
676 hdi.pszText = text;
677 hdi.fmt = 0;
678 hdi.iOrder = 0;
679 hdi.lParam = 17;
680 hdi.cchTextMax = 260;
682 ok(ret == -1, "Creating an item with a zero mask should have failed\n");
683 if (ret != -1) SendMessageA(hWndHeader, HDM_DELETEITEM, 0, 0);
684
685 /* with a non-zero mask creation will succeed */
686 ZeroMemory(&hdi, sizeof(hdi));
687 hdi.mask = HDI_LPARAM;
689 ok(ret != -1, "Adding item with non-zero mask failed\n");
690 if (ret != -1)
692
693 /* in SETITEM if the mask contains a unknown bit, it is ignored */
694 ZeroMemory(&hdi, sizeof(hdi));
695 hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
696 hdi.lParam = 133;
697 hdi.iImage = 17;
699 ok(ret != -1, "Adding item failed\n");
700
701 if (ret != -1)
702 {
703 /* check result */
704 ZeroMemory(&hdi, sizeof(hdi));
705 hdi.mask = HDI_LPARAM | HDI_IMAGE;
707 ok(hdi.lParam == 133, "comctl32 4.0 field not set\n");
708 ok(hdi.iImage == 17, "comctl32 >4.0 field not set\n");
709
710 /* but in GETITEM if an unknown bit is set, comctl32 uses only version 4.0 fields */
711 ZeroMemory(&hdi, sizeof(hdi));
712 hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
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");
716
718 }
719}
720
721static void test_header_control (void)
722{
723 LONG res;
724 static char buffer[MAX_CHARS];
725 int i;
726
728
729 for (i = 3; i >= 0; i--)
730 {
733 ok(res == 0, "Adding simple item failed (%d)\n", res);
734 }
735
737 res = addItem(hWndHeader, 99, str_items[i+1]);
738 ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
740 res = addItem(hWndHeader, 5, str_items[i+1]);
741 ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
743
744 for (i = 0; i < 4; i++) { TEST_GET_ITEM(i,i); TEST_GET_ITEMCOUNT(6); }
745
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);
752
754 {
757 }
758
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);
767
768 for (i = 0; i < 4; i++)
769 {
771 ok(res != 0, "Setting %d item failed (%d)\n", i+1, res);
772 TEST_GET_ITEM(i, 4);
774 }
775
780
785 /* unexpected notifies cleared by notifies_received in setItem */
789 /* unexpected notifies cleared by notifies_received in setItem */
791
795 check_mask();
797
798 res = delItem(hWndHeader, 5);
799 ok(res == 1, "Deleting Out of Range item should fail with 1 (%d)\n", res);
800 res = delItem(hWndHeader, -2);
801 ok(res == 0, "Deleting Out of Range item should fail with 0 (%d)\n", res);
803
804 res = delItem(hWndHeader, 3);
805 ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
807 res = delItem(hWndHeader, 0);
808 ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
810 res = delItem(hWndHeader, 0);
811 ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
813 res = delItem(hWndHeader, 0);
814 ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
816
818}
819
820static void test_hdm_getitemrect(HWND hParent)
821{
822
823 HWND hChild;
824 RECT rect;
825 int retVal;
826
830 "adder header control to parent", FALSE);
831
833 ok(retVal == TRUE, "Getting item rect should TRUE, got %d\n", retVal);
834 /* check bounding rectangle information of 2nd header item */
835 expect(80, rect.left);
836 expect(0, rect.top);
837 expect(160, rect.right);
838 expect(g_customheight, rect.bottom);
839
841
842 ok(retVal == TRUE, "Getting item rect should TRUE, got %d\n", retVal);
843 /* check bounding rectangle information of 1st header item */
844 expect(0, rect.left);
845 expect(0, rect.top);
846
847 expect(80, rect.right);
848 expect(g_customheight, rect.bottom);
849
850 retVal = SendMessageA(hChild, HDM_GETITEMRECT, 10, (LPARAM) &rect);
851 ok(retVal == 0, "Getting rect of nonexistent item should return 0, got %d\n", retVal);
852
853 ok_sequence(sequences, HEADER_SEQ_INDEX, getItemRect_seq, "getItemRect sequence testing", FALSE);
855}
856
857static void test_hdm_layout(HWND hParent)
858{
859 HWND hChild;
860 int retVal;
861 RECT rect;
862 HDLAYOUT hdLayout;
863 WINDOWPOS windowPos;
864 hdLayout.prc = &rect;
865 hdLayout.pwpos = &windowPos;
866
870 "adder header control to parent", FALSE);
871
873 retVal = SendMessageA(hChild, HDM_LAYOUT, 0, (LPARAM) &hdLayout);
874 expect(TRUE, retVal);
875
876 ok_sequence(sequences, HEADER_SEQ_INDEX, layout_seq, "layout sequence testing", FALSE);
877
879}
880
881static void test_hdm_ordertoindex(HWND hParent)
882{
883 HWND hChild;
884 int retVal;
885
889 "adder header control to parent", FALSE);
890
892 retVal = SendMessageA(hChild, HDM_ORDERTOINDEX, 1, 0);
893 expect(1, retVal);
894
895 ok_sequence(sequences, HEADER_SEQ_INDEX, orderToIndex_seq, "orderToIndex sequence testing", FALSE);
897}
898
899static void test_hdm_hittest(HWND hParent)
900{
901 HWND hChild;
902 int retVal;
903 POINT pt;
904 HDHITTESTINFO hdHitTestInfo;
905 const int firstItemRightBoundary = 80;
906 const int secondItemRightBoundary = 160;
907 const int bottomBoundary = g_customheight;
908
909 pt.x = firstItemRightBoundary - 1;
910 pt.y = bottomBoundary - 1;
911 hdHitTestInfo.pt = pt;
912
913
917 "adder header control to parent", FALSE);
918
920 retVal = SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
921 expect(0, retVal);
922 expect(0, hdHitTestInfo.iItem);
923 expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
924
925 pt.x = secondItemRightBoundary - 1;
926 pt.y = bottomBoundary - 1;
927 hdHitTestInfo.pt = pt;
928 retVal = SendMessageA(hChild, HDM_HITTEST, 1, (LPARAM) &hdHitTestInfo);
929 expect(1, retVal);
930 expect(1, hdHitTestInfo.iItem);
931 expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
932
933 pt.x = secondItemRightBoundary;
934 pt.y = bottomBoundary + 1;
935 hdHitTestInfo.pt = pt;
936 retVal = SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
937 expect(-1, retVal);
938 expect(-1, hdHitTestInfo.iItem);
939 expect(HHT_BELOW, hdHitTestInfo.flags);
940
941 ok_sequence(sequences, HEADER_SEQ_INDEX, hittest_seq, "hittest sequence testing", FALSE);
942
944}
945
946static void test_hdm_sethotdivider(HWND hParent)
947{
948 HWND hChild;
949 int retVal;
950 /* low word: x coordinate = 5
951 * high word: y coordinate = 5
952 */
953
957 "adder header control to parent", FALSE);
958
961 expect(0, retVal);
962
964 expect(100, retVal);
966 expect(1, retVal);
969 "setHotDivider sequence testing", TRUE);
970 else
972 "setHotDivider sequence testing", FALSE);
973
975}
976
977static void test_hdm_imageMessages(HWND hParent)
978{
979 HIMAGELIST hImageList = pImageList_Create (4, 4, 0, 1, 0);
980 HIMAGELIST hIml;
981 BOOL wasValid;
982 HWND hChild;
983
987 "adder header control to parent", FALSE);
988
990
991 hIml = (HIMAGELIST) SendMessageA(hChild, HDM_SETIMAGELIST, 0, (LPARAM) hImageList);
992 ok(hIml == NULL, "Expected NULL, got %p\n", hIml);
993
995 ok(hIml != NULL, "Expected non-NULL handle, got %p\n", hIml);
996
998 ok(hIml != NULL, "Expected non-NULL handle, got %p\n", hIml);
999 pImageList_Destroy(hIml);
1000
1001 ok_sequence(sequences, HEADER_SEQ_INDEX, imageMessages_seq, "imageMessages sequence testing", FALSE);
1002
1004
1005 wasValid = pImageList_Destroy(hImageList);
1006 ok(wasValid, "Header must not free image list at destruction!\n");
1007}
1008
1009static void test_hdm_filterMessages(HWND hParent)
1010{
1011 HWND hChild;
1012 int retVal, timeout;
1013
1017 "adder header control to parent", FALSE);
1018
1020 ok(timeout == 1000, "got %d\n", timeout);
1021
1023 ok(timeout == 1000, "got %d\n", timeout);
1024
1026 ok(timeout == 1000, "got %d\n", timeout);
1027
1029 ok(timeout == -100, "got %d\n", timeout);
1031 ok(retVal == 100, "got %d\n", retVal);
1032
1034
1035 /* msdn incorrectly states that return value
1036 * is the index of the filter control being
1037 * modified. The sendMessage here should
1038 * return previous filter timeout value
1039 */
1040
1042 expect(timeout, retVal);
1043
1044 todo_wine
1045 {
1046 retVal = SendMessageA(hChild, HDM_CLEARFILTER, 0, 1);
1047 if (retVal == 0)
1048 win_skip("HDM_CLEARFILTER needs 5.80\n");
1049 else
1050 expect(1, retVal);
1051
1052 retVal = SendMessageA(hChild, HDM_EDITFILTER, 1, 0);
1053 if (retVal == 0)
1054 win_skip("HDM_EDITFILTER needs 5.80\n");
1055 else
1056 expect(1, retVal);
1057 }
1060 "filterMessages sequence testing", TRUE);
1061 else
1063 "filterMessages sequence testing", FALSE);
1065
1066}
1067
1069{
1070 HWND hChild;
1071 int retVal;
1072
1076 "adder header control to parent", FALSE);
1077
1080 expect(0, retVal);
1081 retVal = SendMessageA(hChild, HDM_GETUNICODEFORMAT, 0, 0);
1082 expect(1, retVal);
1083
1085 "unicodeformatMessages sequence testing", FALSE);
1087}
1088
1090{
1091 HWND hChild;
1092 int retVal;
1093
1097 "adder header control to parent", FALSE);
1098
1100 retVal = SendMessageA(hChild, HDM_GETBITMAPMARGIN, 0, 0);
1101 if (retVal == 0)
1102 win_skip("HDM_GETBITMAPMARGIN needs 5.80\n");
1103 else
1104 expect(6, retVal);
1105
1107 "bitmapmarginMessages sequence testing", FALSE);
1109}
1110
1111static void test_hdm_index_messages(HWND hParent)
1112{
1113 HWND hChild;
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"
1118 };
1119 RECT rect;
1120 HDITEMA hdItem;
1121 char buffA[32];
1122 int array[2];
1123
1128 "adder header control to parent", TRUE);
1129 else
1131 "adder header control to parent", FALSE);
1133 for (i = 0; i < ARRAY_SIZE(item_texts); i++)
1134 {
1135 hdItem.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
1136 hdItem.pszText = (char*)item_texts[i];
1137 hdItem.fmt = HDF_LEFT;
1138 hdItem.cxy = 80;
1139
1140 retVal = SendMessageA(hChild, HDM_INSERTITEMA, i, (LPARAM) &hdItem);
1141 ok(retVal == i, "Adding item %d failed with return value %d\n", i, retVal);
1142 }
1143 ok_sequence(sequences, HEADER_SEQ_INDEX, insertItem_seq, "insertItem sequence testing", FALSE);
1144
1146
1147 retVal = SendMessageA(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
1148 ok(retVal == TRUE, "Deleting item 3 should return TRUE, got %d\n", retVal);
1149 retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1150 ok(retVal == 3, "Getting item count should return 3, got %d\n", retVal);
1151
1152 retVal = SendMessageA(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
1153 ok(retVal == FALSE, "Deleting already-deleted item should return FALSE, got %d\n", retVal);
1154 retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1155 ok(retVal == 3, "Getting item count should return 3, got %d\n", retVal);
1156
1157 retVal = SendMessageA(hChild, HDM_DELETEITEM, 2, (LPARAM) &hdItem);
1158 ok(retVal == TRUE, "Deleting item 2 should return TRUE, got %d\n", retVal);
1159 retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1160 ok(retVal == 2, "Getting item count should return 2, got %d\n", retVal);
1161
1163 "deleteItem_getItemCount sequence testing", FALSE);
1164
1166
1167 hdItem.mask = HDI_WIDTH;
1168 retVal = SendMessageA(hChild, HDM_GETITEMA, 3, (LPARAM) &hdItem);
1169 ok(retVal == FALSE, "Getting already-deleted item should return FALSE, got %d\n", retVal);
1170
1171 hdItem.mask = HDI_TEXT | HDI_WIDTH;
1172 hdItem.pszText = buffA;
1173 hdItem.cchTextMax = ARRAY_SIZE(buffA);
1174 retVal = SendMessageA(hChild, HDM_GETITEMA, 0, (LPARAM) &hdItem);
1175 ok(retVal == TRUE, "Getting the 1st header item should return TRUE, got %d\n", retVal);
1176
1177 ok_sequence(sequences, HEADER_SEQ_INDEX, getItem_seq, "getItem sequence testing", FALSE);
1178
1179 /* check if the item is the right one */
1180 ok(!strcmp(hdItem.pszText, item_texts[0]), "got wrong item %s, expected %s\n",
1181 hdItem.pszText, item_texts[0]);
1182 expect(80, hdItem.cxy);
1183
1184 iSize = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1185
1186 /* item should be updated just after accepting new array */
1188 retVal = SendMessageA(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
1189 expect(TRUE, retVal);
1190 rect.left = 0;
1191 retVal = SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
1192 expect(TRUE, retVal);
1193 ok(rect.left != 0, "Expected updated rectangle\n");
1194
1196
1197 retVal = SendMessageA(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
1198 ok(retVal == TRUE, "Setting header items order should return TRUE, got %d\n", retVal);
1199
1201 ok(retVal == TRUE, "Getting header items order should return TRUE, got %d\n", retVal);
1202
1203 ok_sequence(sequences, HEADER_SEQ_INDEX, orderArray_seq, "set_get_orderArray sequence testing", FALSE);
1204
1205 /* check if the array order is set correctly and the size of the array is correct. */
1206 expect(2, iSize);
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]);
1209
1210 hdItem.mask = HDI_FORMAT;
1211 hdItem.fmt = HDF_CENTER | HDF_STRING;
1212
1214
1215 retVal = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM) &hdItem);
1216 ok(retVal == TRUE, "Aligning 1st header item to center should return TRUE, got %d\n", retVal);
1217 hdItem.fmt = HDF_RIGHT | HDF_STRING;
1218 retVal = SendMessageA(hChild, HDM_SETITEMA, 1, (LPARAM) &hdItem);
1219 ok(retVal == TRUE, "Aligning 2nd header item to right should return TRUE, got %d\n", retVal);
1220
1221 ok_sequence(sequences, HEADER_SEQ_INDEX, setItem_seq, "setItem sequence testing", FALSE);
1223}
1224
1225static void test_hdf_fixedwidth(HWND hParent)
1226{
1227 HWND hChild;
1228 HDITEMA hdItem;
1229 DWORD ret;
1230 RECT rect;
1232
1234
1235 hdItem.mask = HDI_WIDTH | HDI_FORMAT;
1236 hdItem.fmt = HDF_FIXEDWIDTH;
1237 hdItem.cxy = 80;
1238
1239 ret = SendMessageA(hChild, HDM_INSERTITEMA, 0, (LPARAM)&hdItem);
1240 expect(0, ret);
1241
1242 /* try to change width */
1243 rect.right = rect.bottom = 0;
1245 ok(rect.right != 0, "Expected not zero width\n");
1246 ok(rect.bottom != 0, "Expected not zero height\n");
1247
1248 SendMessageA(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
1249 SendMessageA(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1250 SendMessageA(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1251
1253
1254 if (hdItem.cxy != rect.right)
1255 {
1256 win_skip("HDF_FIXEDWIDTH format not supported\n");
1258 return;
1259 }
1260
1261 /* try to adjust with message */
1262 hdItem.mask = HDI_WIDTH;
1263 hdItem.cxy = 90;
1264
1265 ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
1266 expect(TRUE, ret);
1267
1268 rect.right = 0;
1270 expect(90, rect.right);
1271
1272 /* hittesting doesn't report ondivider flag for HDF_FIXEDWIDTH */
1273 ht.pt.x = rect.right - 1;
1274 ht.pt.y = rect.bottom / 2;
1276 expect(HHT_ONHEADER, ht.flags);
1277
1278 /* try to adjust with message */
1279 hdItem.mask = HDI_FORMAT;
1280 hdItem.fmt = 0;
1281
1282 ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
1283 expect(TRUE, ret);
1284
1285 ht.pt.x = 90;
1286 ht.pt.y = rect.bottom / 2;
1288 expect(HHT_ONDIVIDER, ht.flags);
1289
1291}
1292
1293static void test_hds_nosizing(HWND hParent)
1294{
1295 HWND hChild;
1296 HDITEMA hdItem;
1297 DWORD ret;
1298 RECT rect;
1300
1302
1303 memset(&hdItem, 0, sizeof(hdItem));
1304 hdItem.mask = HDI_WIDTH;
1305 hdItem.cxy = 80;
1306
1307 ret = SendMessageA(hChild, HDM_INSERTITEMA, 0, (LPARAM)&hdItem);
1308 expect(0, ret);
1309
1310 /* HDS_NOSIZING only blocks hittesting */
1312 SetWindowLongA(hChild, GWL_STYLE, ret | HDS_NOSIZING);
1313
1314 /* try to change width with mouse gestures */
1315 rect.right = rect.bottom = 0;
1317 ok(rect.right != 0, "Expected not zero width\n");
1318 ok(rect.bottom != 0, "Expected not zero height\n");
1319
1320 SendMessageA(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
1321 SendMessageA(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1322 SendMessageA(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1323
1325
1326 if (hdItem.cxy != rect.right)
1327 {
1328 win_skip("HDS_NOSIZING style not supported\n");
1330 return;
1331 }
1332
1333 /* this style doesn't set HDF_FIXEDWIDTH for items */
1334 hdItem.mask = HDI_FORMAT;
1335 ret = SendMessageA(hChild, HDM_GETITEMA, 0, (LPARAM)&hdItem);
1336 expect(TRUE, ret);
1337 ok(!(hdItem.fmt & HDF_FIXEDWIDTH), "Unexpected HDF_FIXEDWIDTH\n");
1338
1339 /* try to adjust with message */
1340 hdItem.mask = HDI_WIDTH;
1341 hdItem.cxy = 90;
1342
1343 ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
1344 expect(TRUE, ret);
1345
1346 rect.right = 0;
1348 expect(90, rect.right);
1349
1350 /* hittesting doesn't report ondivider flags for HDS_NOSIZING */
1351 ht.pt.x = rect.right - 1;
1352 ht.pt.y = rect.bottom / 2;
1354 expect(HHT_ONHEADER, ht.flags);
1355
1356 /* try to adjust with message */
1358 SetWindowLongA(hChild, GWL_STYLE, ret & ~HDS_NOSIZING);
1359
1360 ht.pt.x = 90;
1361 ht.pt.y = rect.bottom / 2;
1363 expect(HHT_ONDIVIDER, ht.flags);
1364
1366}
1367
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), /* comctl32 < 5.80 */ \
1375 "Invalid rect (%d,%d)-(%d,%d) vs %s\n", _left, _top, _right, _bottom, \
1376 wine_dbgstr_rect(&nm->rc));
1377
1379{
1380 if (nm == NULL) { /* test ended */
1381 ok(n==1, "NM_CUSTOMDRAW messages: %d, expected: 1\n", n);
1382 return 0;
1383 }
1384
1385 switch (n)
1386 {
1387 case 0:
1388 /* don't test dwItemSpec - it's 0 no comctl5 but 1308756 on comctl6 */
1390 return 0;
1391 }
1392
1393 ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1394 return -1;
1395}
1396
1398{
1399 if (nm == NULL) { /* test ended */
1400 ok(n==4, "NM_CUSTOMDRAW messages: %d, expected: 4\n", n);
1401 return 0;
1402 }
1403
1404 switch (n)
1405 {
1406 case 0:
1408 return CDRF_NOTIFYITEMDRAW;
1409 case 1:
1411 return 0;
1412 case 2:
1414 return 0;
1415 case 3:
1417 return 0;
1418 }
1419
1420 ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1421 return 0;
1422}
1423
1425{
1426 if (nm == NULL) { /* test ended */
1427 ok(n==5, "NM_CUSTOMDRAW messages: %d, expected: 5\n", n);
1428 return 0;
1429 }
1430
1431 switch (n)
1432 {
1433 case 0:
1436 case 1:
1438 return 0;
1439 case 2:
1441 return 0;
1442 case 3:
1444 return 0;
1445 case 4:
1447 return 0;
1448 }
1449
1450 ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1451 return 0;
1452}
1453
1454
1456{
1457 if (nm == NULL) { /* test ended */
1458 ok(n==4, "NM_CUSTOMDRAW messages: %d, expected: 4\n", n);
1459 return 0;
1460 }
1461
1462 switch (n)
1463 {
1464 case 0:
1467 case 1:
1469 return 0;
1470 case 2:
1472 return 0;
1473 case 3:
1475 return 0;
1476 }
1477
1478 ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1479 return 0;
1480}
1481
1483{
1490}
1491
1492static void test_customdraw(void)
1493{
1494 int i;
1495 HDITEMA item;
1496 RECT rect;
1497 CHAR name[] = "Test";
1500 ok(rect.right - rect.left == 670 && rect.bottom - rect.top == g_customheight,
1501 "Tests will fail as header size is %dx%d instead of 670x%d\n",
1502 rect.right - rect.left, rect.bottom - rect.top, g_customheight);
1503
1504 for (i = 0; i < 3; i++)
1505 {
1506 ZeroMemory(&item, sizeof(item));
1507 item.mask = HDI_TEXT|HDI_WIDTH;
1508 item.cxy = 50*(i+1);
1509 item.pszText = name;
1510 item.lParam = i*5;
1512 }
1513
1517
1518 ZeroMemory(&item, sizeof(item));
1519 item.mask = HDI_FORMAT;
1520 item.fmt = HDF_OWNERDRAW;
1522 g_DrawItem.CtlID = 0;
1525 g_DrawItem.itemID = 1;
1529 ok(g_DrawItemReceived, "WM_DRAWITEM not received\n");
1531 hWndHeader = NULL;
1532 g_DrawItem.CtlType = 0;
1534}
1535
1536static void check_order(const int expected_id[], const int expected_order[],
1537 int count, const char *type)
1538{
1539 int i;
1540 HDITEMA hdi;
1541
1542 ok(getItemCount(hWndHeader) == count, "Invalid item count in order tests\n");
1543 for (i = 0; i < count; i++)
1544 {
1547 ok(hdi.lParam == expected_id[i],
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);
1551 }
1552}
1553
1554static void test_header_order (void)
1555{
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};
1562
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};
1570
1571 char buffer[20];
1572 HDITEMA hdi;
1573 int i;
1574
1576
1577 ZeroMemory(&hdi, sizeof(HDITEMA));
1578 hdi.mask = HDI_TEXT | HDI_LPARAM;
1579 hdi.pszText = buffer;
1580 strcpy(buffer, "test");
1581
1582 for (i = 0; i < 5; i++)
1583 {
1584 hdi.lParam = i;
1586 }
1587 check_order(ids1, ord1, 5, "insert without iOrder");
1588
1589 hdi.mask |= HDI_ORDER;
1590 for (i = 0; i < 5; i++)
1591 {
1592 hdi.lParam = i + 5;
1593 hdi.iOrder = rand2[i];
1595 }
1596 check_order(ids2, ord2, 10, "insert with order");
1597
1598 hdi.mask = HDI_ORDER;
1599 for (i=0; i<10; i++)
1600 {
1601 hdi.iOrder = rand5[i];
1602 SendMessageA(hWndHeader, HDM_SETITEMA, rand4[i], (LPARAM)&hdi);
1603 }
1604 check_order(ids2, ord3, 10, "setitems changing order");
1605
1606 for (i=0; i<5; i++)
1608 check_order(ids4, ord4, 5, "deleteitem");
1609
1611}
1612
1614{
1615 DRAWITEMSTRUCT *di;
1616 switch(msg) {
1617
1618 case WM_NOTIFY:
1619 {
1622 int i;
1623
1624 if (hdr->hdr.code == NM_CUSTOMDRAW)
1625 if (g_CustomDrawProc)
1627
1628 for (i=0; i<nUnexpectedNotify; i++)
1629 ok(hdr->hdr.code != unexpectedNotify[i], "Received invalid notify %d\n", hdr->hdr.code);
1630
1631 if (nReceivedNotify >= nExpectedNotify || hdr->hdr.hwndFrom != hWndHeader )
1632 break;
1633
1635 if (hdr->hdr.code != expected->iCode)
1636 break;
1637
1639 compare_items(hdr->hdr.code, &expected->hdItem, hdr->pitem, expected->fUnicode);
1640 break;
1641 }
1642
1643 case WM_DRAWITEM:
1644 di = (DRAWITEMSTRUCT *)lParam;
1645 ok(g_DrawItem.CtlType != 0, "Unexpected WM_DRAWITEM\n");
1646 if (g_DrawItem.CtlType == 0) return 0;
1648 compare(di->CtlType, g_DrawItem.CtlType, "%d");
1649 compare(di->CtlID, g_DrawItem.CtlID, "%d");
1650 compare(di->hwndItem, g_DrawItem.hwndItem, "%p");
1651 compare(di->itemID, g_DrawItem.itemID, "%d");
1654 compare(di->rcItem.top, g_DrawItem.rcItem.top, "%d");
1657 break;
1658
1659 case WM_DESTROY:
1660 PostQuitMessage(0);
1661 break;
1662
1663 default:
1664 return DefWindowProcA(hWnd, msg, wParam, lParam);
1665 }
1666
1667 return 0L;
1668}
1669
1670static void init_functions(void)
1671{
1672 HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
1673
1674#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
1677#undef X
1678}
1679
1680static BOOL init(void)
1681{
1682 WNDCLASSA wc;
1684 HFONT hOldFont;
1685 HDC hdc;
1686
1688 wc.cbClsExtra = 0;
1689 wc.cbWndExtra = 0;
1691 wc.hIcon = NULL;
1694 wc.lpszMenuName = NULL;
1695 wc.lpszClassName = "HeaderTestClass";
1697 RegisterClassA(&wc);
1698
1699 /* The height of the header control depends on the height of the system font.
1700 The height of the system font is dpi dependent */
1701 hdc = GetDC(0);
1704 /* 2 dot extra space are needed for the border */
1705 g_customheight = tm.tmHeight + 2;
1706 trace("customdraw height: %d (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY));
1707 SelectObject(hdc, hOldFont);
1708 ReleaseDC(0, hdc);
1709
1710 hHeaderParentWnd = CreateWindowExA(0, "HeaderTestClass", "Header test", WS_OVERLAPPEDWINDOW,
1714 ok(hHeaderParentWnd != NULL, "failed to create parent wnd\n");
1715
1717 return hHeaderParentWnd != NULL;
1718}
1719
1720/* maximum 8 items allowed */
1722 BOOL todo, int line)
1723{
1724 int count, i;
1725 INT order[8];
1726 DWORD ret, array = 0;
1727
1729
1730 /* initial order */
1731 for(i = 1; i<=count; i++)
1732 order[i-1] = start>>(4*(count-i)) & 0xf;
1733
1735 ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
1736
1737 /* new order */
1738 for(i = 1; i<=count; i++)
1739 order[i-1] = set>>(4*(count-i)) & 0xf;
1741 ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
1742
1743 /* check actual order */
1745 ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %d\n", ret);
1746 for(i = 1; i<=count; i++)
1747 array |= order[i-1]<<(4*(count-i));
1748
1750 ok_(__FILE__, line)(array == expected, "Expected %x, got %x\n", expected, array);
1751}
1752
1753static void test_hdm_orderarray(void)
1754{
1755 HWND hwnd;
1756 INT order[5];
1757 DWORD ret;
1758
1760
1761 /* three items */
1762 addItem(hwnd, 0, NULL);
1763 addItem(hwnd, 1, NULL);
1764 addItem(hwnd, 2, NULL);
1765
1767 if (!ret)
1768 {
1769 win_skip("HDM_GETORDERARRAY not implemented.\n");
1771 return;
1772 }
1773
1774 expect(0, order[0]);
1775 expect(1, order[1]);
1776 expect(2, order[2]);
1777
1778if (0)
1779{
1780 /* null pointer, crashes native */
1782 expect(FALSE, ret);
1783}
1784 /* count out of limits */
1786 expect(FALSE, ret);
1787 /* count out of limits */
1789 expect(FALSE, ret);
1790
1791 /* try with out of range item index */
1792 /* (0,1,2)->(1,0,3) => (1,0,2) */
1793 check_orderarray(hwnd, 0x120, 0x103, 0x102, FALSE, __LINE__);
1794 /* (1,0,2)->(3,0,1) => (0,2,1) */
1795 check_orderarray(hwnd, 0x102, 0x301, 0x021, TRUE, __LINE__);
1796 /* (0,2,1)->(2,3,1) => (2,0,1) */
1797 check_orderarray(hwnd, 0x021, 0x231, 0x201, FALSE, __LINE__);
1798
1799 /* (0,1,2)->(0,2,2) => (0,1,2) */
1800 check_orderarray(hwnd, 0x012, 0x022, 0x012, FALSE, __LINE__);
1801
1802 addItem(hwnd, 3, NULL);
1803
1804 /* (0,1,2,3)->(0,1,2,2) => (0,1,3,2) */
1805 check_orderarray(hwnd, 0x0123, 0x0122, 0x0132, FALSE, __LINE__);
1806 /* (0,1,2,3)->(0,1,3,3) => (0,1,2,3) */
1807 check_orderarray(hwnd, 0x0123, 0x0133, 0x0123, FALSE, __LINE__);
1808 /* (0,1,2,3)->(0,4,2,3) => (0,1,2,3) */
1809 check_orderarray(hwnd, 0x0123, 0x0423, 0x0123, FALSE, __LINE__);
1810 /* (0,1,2,3)->(4,0,1,2) => (0,1,3,2) */
1811 check_orderarray(hwnd, 0x0123, 0x4012, 0x0132, TRUE, __LINE__);
1812 /* (0,1,3,2)->(4,0,1,4) => (0,3,1,2) */
1813 check_orderarray(hwnd, 0x0132, 0x4014, 0x0312, TRUE, __LINE__);
1814 /* (0,1,2,3)->(4,1,0,2) => (1,0,3,2) */
1815 check_orderarray(hwnd, 0x0123, 0x4102, 0x1032, TRUE, __LINE__);
1816 /* (0,1,2,3)->(0,1,4,2) => (0,1,2,3) */
1817 check_orderarray(hwnd, 0x0123, 0x0142, 0x0132, FALSE, __LINE__);
1818 /* (0,1,2,3)->(4,4,4,4) => (0,1,2,3) */
1819 check_orderarray(hwnd, 0x0123, 0x4444, 0x0123, FALSE, __LINE__);
1820 /* (0,1,2,3)->(4,4,1,2) => (0,1,3,2) */
1821 check_orderarray(hwnd, 0x0123, 0x4412, 0x0132, TRUE, __LINE__);
1822 /* (0,1,2,3)->(4,4,4,1) => (0,2,3,1) */
1823 check_orderarray(hwnd, 0x0123, 0x4441, 0x0231, TRUE, __LINE__);
1824 /* (0,1,2,3)->(1,4,4,4) => (1,0,2,3) */
1825 check_orderarray(hwnd, 0x0123, 0x1444, 0x1023, FALSE, __LINE__);
1826 /* (0,1,2,3)->(4,2,4,1) => (0,2,3,1) */
1827 check_orderarray(hwnd, 0x0123, 0x4241, 0x0231, FALSE, __LINE__);
1828 /* (0,1,2,3)->(4,2,0,1) => (2,0,3,1) */
1829 check_orderarray(hwnd, 0x0123, 0x4201, 0x2031, TRUE, __LINE__);
1830 /* (3,2,1,0)->(4,2,0,1) => (3,2,0,1) */
1831 check_orderarray(hwnd, 0x3210, 0x4201, 0x3201, FALSE, __LINE__);
1832
1834}
1835
1837{
1838 HWND parent_hwnd;
1839 ULONG_PTR ctx_cookie;
1840 HANDLE hCtx;
1841
1844
1845 if (!init())
1846 return;
1847
1853
1855
1857 parent_hwnd = create_custom_parent_window();
1859
1860 test_hdm_index_messages(parent_hwnd);
1861 test_hdm_getitemrect(parent_hwnd);
1862 test_hdm_hittest(parent_hwnd);
1863 test_hdm_layout(parent_hwnd);
1864 test_hdm_ordertoindex(parent_hwnd);
1865 test_hdm_sethotdivider(parent_hwnd);
1866 test_hdm_imageMessages(parent_hwnd);
1867 test_hdm_filterMessages(parent_hwnd);
1868 test_hdm_unicodeformatMessages(parent_hwnd);
1869 test_hdm_bitmapmarginMessages(parent_hwnd);
1870
1871 if (!load_v6_module(&ctx_cookie, &hCtx))
1872 {
1873 DestroyWindow(parent_hwnd);
1874 return;
1875 }
1876
1878
1879 /* comctl32 version 6 tests start here */
1880 test_hdf_fixedwidth(parent_hwnd);
1881 test_hds_nosizing(parent_hwnd);
1882 test_item_auto_format(parent_hwnd);
1883
1884 unload_v6_module(ctx_cookie, hCtx);
1885
1886 DestroyWindow(parent_hwnd);
1887}
@ sent
Definition: SystemMenu.c:27
@ defwinproc
Definition: SystemMenu.c:32
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
@ optional
Definition: SystemMenu.c:34
#define add_message(msg)
Definition: SystemMenu.c:98
#define ok_sequence(exp, contx, todo)
Definition: SystemMenu.c:275
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define ARRAY_SIZE(A)
Definition: main.h:20
Definition: _set.h:50
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:393
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define CP_ACP
Definition: compat.h:109
#define CALLBACK
Definition: compat.h:35
#define WideCharToMultiByte
Definition: compat.h:111
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
const WCHAR * text
Definition: package.c:1794
#define pt(x, y)
Definition: drawing.c:79
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLuint start
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLenum GLint GLuint mask
Definition: glext.h:6028
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
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
static const struct newhuff ht[]
Definition: huffman.h:296
char hdr[14]
Definition: iptest.cpp:33
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static char * textBuffer
Definition: combo.c:58
static char pszFourthItem[]
Definition: header.c:383
static void header_item_getback(HWND hwnd, UINT mask, HDITEMA *item)
Definition: header.c:538
static void check_mask(void)
Definition: header.c:666
static void test_header_order(void)
Definition: header.c:1554
static const struct message filterMessages_seq_noninteractive[]
Definition: header.c:198
static CUSTOMDRAWPROC g_CustomDrawProc
Definition: header.c:41
static const struct message hittest_seq[]
Definition: header.c:155
static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText)
Definition: header.c:274
static void test_hdm_getitemrect(HWND hParent)
Definition: header.c:820
static void test_hds_nosizing(HWND hParent)
Definition: header.c:1293
static void test_hdm_unicodeformatMessages(HWND hParent)
Definition: header.c:1068
static const struct message imageMessages_seq[]
Definition: header.c:181
static const struct message unicodeformatMessages_seq[]
Definition: header.c:207
static HWND hWndHeader
Definition: header.c:54
static LONG addItem(HWND hdex, int idx, LPSTR text)
Definition: header.c:246
static const struct message filterMessages_seq_interactive[]
Definition: header.c:188
#define NUM_MSG_SEQUENCES
Definition: header.c:61
static void test_hdm_orderarray(void)
Definition: header.c:1753
static void test_hdm_index_messages(HWND hParent)
Definition: header.c:1111
static void test_hdm_sethotdivider(HWND hParent)
Definition: header.c:946
static void test_hdm_filterMessages(HWND hParent)
Definition: header.c:1009
static void run_customdraw_scenario(CUSTOMDRAWPROC proc)
Definition: header.c:1482
static void test_customdraw(void)
Definition: header.c:1492
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
Definition: header.c:1368
static const struct message add_header_to_parent_seq_interactive[]
Definition: header.c:75
static void check_order(const int expected_id[], const int expected_order[], int count, const char *type)
Definition: header.c:1536
#define X(f)
static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1397
#define compare(val, exp, fmt)
Definition: header.c:57
static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1378
static BOOL register_parent_wnd_class(void)
Definition: header.c:458
static DRAWITEMSTRUCT g_DrawItem
Definition: header.c:43
static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
Definition: header.c:303
static const struct message deleteItem_getItemCount_seq[]
Definition: header.c:116
static char pszThirdItem[]
Definition: header.c:382
static INT unexpectedNotify[10]
Definition: header.c:50
static void compare_items(INT iCode, HDITEMA *hdi1, HDITEMA *hdi2, BOOL fUnicode)
Definition: header.c:347
static void test_hdm_bitmapmarginMessages(HWND hParent)
Definition: header.c:1089
static EXPECTEDNOTIFY expectedNotify[10]
Definition: header.c:47
static void test_item_auto_format(HWND parent)
Definition: header.c:554
static void test_hdm_hittest(HWND hParent)
Definition: header.c:899
static BOOL init(void)
Definition: header.c:1680
static void dont_expect_notify(INT iCode)
Definition: header.c:231
static WCHAR pszUniTestW[]
Definition: header.c:391
static int
Definition: header.c:29
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:405
static void check_auto_fields(void)
Definition: header.c:613
static BOOL notifies_received(void)
Definition: header.c:238
struct tagEXPECTEDNOTIFY EXPECTEDNOTIFY
static LONG delItem(HWND hdex, int idx)
Definition: header.c:293
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:426
static char pszReplaceItem[]
Definition: header.c:384
static void test_hdm_imageMessages(HWND hParent)
Definition: header.c:977
static void test_hdm_ordertoindex(HWND hParent)
Definition: header.c:881
static HWND create_custom_parent_window(void)
Definition: header.c:475
static LONG getItemCount(HWND hdex)
Definition: header.c:298
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
Definition: header.c:256
static void test_hdf_fixedwidth(HWND hParent)
Definition: header.c:1225
static const struct message setItem_seq[]
Definition: header.c:132
static const struct message orderToIndex_seq[]
Definition: header.c:150
static const struct message bitmapmarginMessages_seq[]
Definition: header.c:213
#define MAX_CHARS
Definition: header.c:55
static HWND create_header_control(void)
Definition: header.c:321
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
static INT nUnexpectedNotify
Definition: header.c:51
static char * str_items[]
Definition: header.c:387
static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: header.c:1613
static int g_CustomDrawCount
Definition: header.c:42
static const struct message insertItem_seq[]
Definition: header.c:101
static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1455
static void test_hdm_layout(HWND hParent)
Definition: header.c:857
static const struct message getItem_seq[]
Definition: header.c:109
static HWND hHeaderParentWnd
Definition: header.c:53
#define expect(expected, got)
Definition: header.c:59
static const struct message setHotDivider_seq_interactive[]
Definition: header.c:162
#define PARENT_SEQ_INDEX
Definition: header.c:62
#define HEADER_SEQ_INDEX
Definition: header.c:63
static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
Definition: header.c:219
static const struct message layout_seq[]
Definition: header.c:145
static char pszUniTestA[]
Definition: header.c:390
static const struct message orderArray_seq[]
Definition: header.c:126
static INT nExpectedNotify
Definition: header.c:48
static const struct message getItemRect_seq[]
Definition: header.c:138
static char pszFirstItem[]
Definition: header.c:380
static void test_header_control(void)
Definition: header.c:721
LRESULT(* CUSTOMDRAWPROC)(int n, NMCUSTOMDRAW *nm)
Definition: header.c:39
static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected, BOOL todo, int line)
Definition: header.c:1721
static INT nReceivedNotify
Definition: header.c:49
static DWORD g_customheight
Definition: header.c:45
static const struct message create_parent_wnd_seq[]
Definition: header.c:67
static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
Definition: header.c:312
#define TEST_GET_ITEM(i, c)
Definition: header.c:394
#define TEST_GET_ITEMCOUNT(i)
Definition: header.c:400
static void init_functions(void)
Definition: header.c:1670
static BOOL g_DrawItemReceived
Definition: header.c:44
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
static const struct message setHotDivider_seq_noninteractive[]
Definition: header.c:174
static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1424
static char pszOutOfRangeItem[]
Definition: header.c:385
static char pszSecondItem[]
Definition: header.c:381
static UINT
Definition: header.c:29
static HDC
Definition: imagelist.c:88
static HTREEITEM hChild
Definition: treeview.c:383
BOOL todo
Definition: filedlg.c:313
BOOL expected
Definition: store.c:2063
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HRGN INT iCode
Definition: mapping.c:33
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define todo_wine
Definition: custom.c:89
static ATOM item
Definition: dde.c:856
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
#define L(x)
Definition: ntvdm.h:50
#define LRESULT
Definition: ole.h:14
static TCHAR * items[]
Definition: page1.c:45
static HANDLE proc()
Definition: pdb.c:34
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_BORDER
Definition: pedump.c:625
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define ODT_HEADER
Definition: commctrl.h:78
#define HDM_SETORDERARRAY
Definition: commctrl.h:809
#define HDS_BUTTONS
Definition: commctrl.h:629
#define HDF_LEFT
Definition: commctrl.h:713
#define CDRF_NOTIFYPOSTERASE
Definition: commctrl.h:277
#define HDM_EDITFILTER
Definition: commctrl.h:830
#define HDF_OWNERDRAW
Definition: commctrl.h:719
#define HDI_TEXT
Definition: commctrl.h:704
#define WC_HEADERA
Definition: commctrl.h:623
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285
#define HDF_CENTER
Definition: commctrl.h:715
#define HDN_ITEMCHANGEDW
Definition: commctrl.h:840
#define HDM_GETBITMAPMARGIN
Definition: commctrl.h:818
#define HDM_SETITEMA
Definition: commctrl.h:753
#define HDM_SETUNICODEFORMAT
Definition: commctrl.h:821
#define HDM_GETUNICODEFORMAT
Definition: commctrl.h:824
#define HDF_RIGHT
Definition: commctrl.h:714
#define HDM_INSERTITEMA
Definition: commctrl.h:736
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275
#define LPSTR_TEXTCALLBACKA
Definition: commctrl.h:2386
#define HDM_LAYOUT
Definition: commctrl.h:767
#define HDM_GETITEMCOUNT
Definition: commctrl.h:733
struct _IMAGELIST * HIMAGELIST
Definition: commctrl.h:324
#define HDF_IMAGE
Definition: commctrl.h:723
#define HDM_GETITEMA
Definition: commctrl.h:746
#define HDI_WIDTH
Definition: commctrl.h:702
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:274
#define HDI_BITMAP
Definition: commctrl.h:707
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:837
#define HDM_SETHOTDIVIDER
Definition: commctrl.h:812
#define HDM_HITTEST
Definition: commctrl.h:789
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define HDM_SETIMAGELIST
Definition: commctrl.h:794
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:838
#define HDF_STRING
Definition: commctrl.h:720
#define HDM_GETORDERARRAY
Definition: commctrl.h:806
#define HDI_FORMAT
Definition: commctrl.h:705
#define HDS_HORZ
Definition: commctrl.h:628
#define HDN_GETDISPINFOA
Definition: commctrl.h:853
#define HHT_ONDIVIDER
Definition: commctrl.h:772
#define HDN_GETDISPINFOW
Definition: commctrl.h:854
#define CDDS_PREPAINT
Definition: commctrl.h:280
#define HDM_GETITEMRECT
Definition: commctrl.h:791
#define HDI_LPARAM
Definition: commctrl.h:706
#define CDDS_POSTPAINT
Definition: commctrl.h:281
#define HDF_BITMAP
Definition: commctrl.h:721
#define HDM_ORDERTOINDEX
Definition: commctrl.h:800
#define HDM_SETFILTERCHANGETIMEOUT
Definition: commctrl.h:827
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:270
#define HDM_CREATEDRAGIMAGE
Definition: commctrl.h:803
#define HHT_BELOW
Definition: commctrl.h:777
#define HDI_IMAGE
Definition: commctrl.h:708
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:839
#define HDM_GETIMAGELIST
Definition: commctrl.h:797
#define HDM_CLEARFILTER
Definition: commctrl.h:833
#define HHT_ONHEADER
Definition: commctrl.h:771
#define HDM_DELETEITEM
Definition: commctrl.h:743
#define HDI_ORDER
Definition: commctrl.h:710
#define WM_NOTIFY
Definition: richedit.h:61
#define win_skip
Definition: test.h:163
int winetest_interactive
#define memset(x, y, z)
Definition: compat.h:39
& rect
Definition: startmenu.cpp:1413
HBITMAP hbm
Definition: commctrl.h:670
int iImage
Definition: commctrl.h:674
UINT mask
Definition: commctrl.h:667
int fmt
Definition: commctrl.h:672
LPSTR pszText
Definition: commctrl.h:669
LPARAM lParam
Definition: commctrl.h:673
int cchTextMax
Definition: commctrl.h:671
int cxy
Definition: commctrl.h:668
int iOrder
Definition: commctrl.h:675
UINT mask
Definition: commctrl.h:684
LPWSTR pszText
Definition: commctrl.h:686
WINDOWPOS * pwpos
Definition: commctrl.h:764
RECT * prc
Definition: commctrl.h:763
HWND hwndInsertAfter
Definition: winuser.h:3592
HBRUSH hbrBackground
Definition: winuser.h:3173
HICON hIcon
Definition: winuser.h:3171
HINSTANCE hInstance
Definition: winuser.h:3170
HCURSOR hCursor
Definition: winuser.h:3172
int cbWndExtra
Definition: winuser.h:3169
UINT style
Definition: winuser.h:3166
LPCSTR lpszMenuName
Definition: winuser.h:3174
LPCSTR lpszClassName
Definition: winuser.h:3175
WNDPROC lpfnWndProc
Definition: winuser.h:3167
int cbClsExtra
Definition: winuser.h:3168
Definition: parser.c:49
Definition: tftpd.h:60
UINT message
Definition: SystemMenu.c:42
Definition: name.c:39
HDITEMA hdItem
Definition: header.c:36
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
Definition: dhcpd.h:245
Definition: time.h:68
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:73
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:65
int ret
static LRESULT expected_id
Definition: win.c:4343
#define ZeroMemory
Definition: winbase.h:1712
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
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)
#define LOGPIXELSY
Definition: wingdi.h:719
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define WHITE_BRUSH
Definition: wingdi.h:902
#define SYSTEM_FONT
Definition: wingdi.h:911
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
#define WM_PAINT
Definition: winuser.h:1623
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1628
#define CS_VREDRAW
Definition: winuser.h:658
#define SetWindowLongPtrA
Definition: winuser.h:5357
#define SW_HIDE
Definition: winuser.h:771
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
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:921
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_IME_NOTIFY
Definition: winuser.h:1833
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1664
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define WM_CREATE
Definition: winuser.h:1611
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)
#define WM_SIZE
Definition: winuser.h:1614
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1743
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
#define WM_NCHITTEST
Definition: winuser.h:1689
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETFOCUS
Definition: winuser.h:1616
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define WM_GETTEXT
Definition: winuser.h:1621
#define GetWindowLongPtrA
Definition: winuser.h:4831
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_DEVICECHANGE
Definition: winuser.h:1814
#define NF_REQUERY
Definition: winuser.h:2464
#define WM_DRAWITEM
Definition: winuser.h:1648
#define WM_NCCREATE
Definition: winuser.h:1686
#define WM_ACTIVATE
Definition: winuser.h:1615
#define WM_SHOWWINDOW
Definition: winuser.h:1631
#define WM_IME_SETCONTEXT
Definition: winuser.h:1832
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_NCACTIVATE
Definition: winuser.h:1691
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define WM_GETMINMAXINFO
Definition: winuser.h:1643
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SM_CXSIZEFRAME
Definition: winuser.h:996
HDC WINAPI GetDC(_In_opt_ HWND)
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define CW_USEDEFAULT
Definition: winuser.h:225
#define WM_MOVE
Definition: winuser.h:1613
#define WM_ACTIVATEAPP
Definition: winuser.h:1635
#define SW_SHOW
Definition: winuser.h:778
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909
#define WM_PARENTNOTIFY
Definition: winuser.h:1806
#define WM_NCCALCSIZE
Definition: winuser.h:1688
#define GWL_STYLE
Definition: winuser.h:855
#define WM_CTLCOLOREDIT
Definition: winuser.h:1770
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1665
BOOL WINAPI DestroyWindow(_In_ HWND)
#define SM_CYCAPTION
Definition: winuser.h:966
#define SM_CYSIZEFRAME
Definition: winuser.h:998
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NF_QUERY
Definition: winuser.h:2463
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2134
#define WM_NCPAINT
Definition: winuser.h:1690
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175