ReactOS  0.4.14-dev-614-gbfd8a84
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 
29 static HIMAGELIST (WINAPI *pImageList_Create)(int, int, UINT, int, int);
30 static BOOL (WINAPI *pImageList_Destroy)(HIMAGELIST);
31 
32 typedef struct tagEXPECTEDNOTIFY
33 {
38 
39 typedef LRESULT (*CUSTOMDRAWPROC)(int n, NMCUSTOMDRAW *nm);
40 
42 static int g_CustomDrawCount;
46 
48 static INT nExpectedNotify = 0;
49 static INT nReceivedNotify = 0;
50 static INT unexpectedNotify[10];
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 
67 static const struct message create_parent_wnd_seq[] = {
69  { WM_NCCREATE, sent },
70  { WM_NCCALCSIZE, sent|wparam, 0 },
71  { WM_CREATE, sent },
72  { 0 }
73 };
74 
76  { WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
77  { WM_QUERYUISTATE, sent },
78  { WM_PARENTNOTIFY, sent|wparam, 1 },
79  { WM_SHOWWINDOW, sent|wparam, 1 },
82  { WM_ACTIVATEAPP, sent|wparam, 1 },
83  { WM_NCACTIVATE, sent|wparam, 1 },
84  { WM_ACTIVATE, sent|wparam, 1 },
89  { WM_SIZE, sent|wparam, 0 },
90  { WM_MOVE, sent|wparam, 0 },
91  { 0 }
92 };
93 
94 static const struct message add_header_to_parent_seq[] = {
95  { WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
96  { WM_QUERYUISTATE, sent|optional },
97  { WM_PARENTNOTIFY, sent },
98  { 0 }
99 };
100 
101 static const struct message insertItem_seq[] = {
102  { HDM_INSERTITEMA, sent|wparam, 0 },
103  { HDM_INSERTITEMA, sent|wparam, 1 },
104  { HDM_INSERTITEMA, sent|wparam, 2 },
105  { HDM_INSERTITEMA, sent|wparam, 3 },
106  { 0 }
107 };
108 
109 static const struct message getItem_seq[] = {
110  { HDM_GETITEMA, sent|wparam, 3 },
111  { HDM_GETITEMA, sent|wparam, 0 },
112  { 0 }
113 };
114 
115 
116 static const struct message deleteItem_getItemCount_seq[] = {
117  { HDM_DELETEITEM, sent|wparam, 3 },
118  { HDM_GETITEMCOUNT, sent },
119  { HDM_DELETEITEM, sent|wparam, 3 },
120  { HDM_GETITEMCOUNT, sent },
121  { HDM_DELETEITEM, sent|wparam, 2 },
122  { HDM_GETITEMCOUNT, sent },
123  { 0 }
124 };
125 
126 static const struct message orderArray_seq[] = {
127  { HDM_SETORDERARRAY, sent|wparam, 2 },
128  { HDM_GETORDERARRAY, sent|wparam, 2 },
129  { 0 }
130 };
131 
132 static const struct message setItem_seq[] = {
133  { HDM_SETITEMA, sent|wparam, 0 },
134  { HDM_SETITEMA, sent|wparam, 1 },
135  { 0 }
136 };
137 
138 static const struct message getItemRect_seq[] = {
139  { HDM_GETITEMRECT, sent|wparam, 1 },
140  { HDM_GETITEMRECT, sent|wparam, 0 },
141  { HDM_GETITEMRECT, sent|wparam, 10 },
142  { 0 }
143 };
144 
145 static const struct message layout_seq[] = {
146  { HDM_LAYOUT, sent },
147  { 0 }
148 };
149 
150 static const struct message orderToIndex_seq[] = {
151  { HDM_ORDERTOINDEX, sent|wparam, 1 },
152  { 0 }
153 };
154 
155 static const struct message hittest_seq[] = {
156  { HDM_HITTEST, sent },
157  { HDM_HITTEST, sent },
158  { HDM_HITTEST, sent },
159  { 0 }
160 };
161 
162 static const struct message setHotDivider_seq_interactive[] = {
171  { 0 }
172 };
173 
174 static const struct message setHotDivider_seq_noninteractive[] = {
178  { 0 }
179 };
180 
181 static const struct message imageMessages_seq[] = {
182  { HDM_SETIMAGELIST, sent },
183  { HDM_GETIMAGELIST, sent },
185  { 0 }
186 };
187 
188 static const struct message filterMessages_seq_interactive[] = {
190  { HDM_CLEARFILTER, sent|wparam|lparam, 0, 1 },
191  { HDM_EDITFILTER, sent|wparam|lparam, 1, 0 },
195  { 0 }
196 };
197 
200  { HDM_CLEARFILTER, sent|wparam|lparam, 0, 1 },
201  { HDM_EDITFILTER, sent|wparam|lparam, 1, 0 },
204  { 0 }
205 };
206 
207 static const struct message unicodeformatMessages_seq[] = {
210  { 0 }
211 };
212 
213 static const struct message bitmapmarginMessages_seq[] = {
215  { 0 }
216 };
217 
218 
219 static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
220 {
221  ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify);
222  if (nExpectedNotify < 10)
223  {
227  nExpectedNotify++;
228  }
229 }
230 
232 {
233  ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify);
234  if (nExpectedNotify < 10)
236 }
237 
239 {
242  nUnexpectedNotify = 0;
243  return fRet;
244 }
245 
246 static 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 
256 static 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  {
266  expect_notify(HDN_ITEMCHANGEDA, FALSE, &hdexItem);
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 
274 static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText)
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 
286  expect_notify(HDN_ITEMCHANGINGW, TRUE, (HDITEMA*)&hdexNotify);
287  expect_notify(HDN_ITEMCHANGEDW, TRUE, (HDITEMA*)&hdexNotify);
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 
293 static LONG delItem(HWND hdex, int idx)
294 {
295  return SendMessageA(hdex, HDM_DELETEITEM, idx, 0);
296 }
297 
298 static LONG getItemCount(HWND hdex)
299 {
300  return SendMessageA(hdex, HDM_GETITEMCOUNT, 0, 0);
301 }
302 
303 static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
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 
312 static 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 
347 static 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 
380 static char pszFirstItem[] = "First Item";
381 static char pszSecondItem[] = "Second Item";
382 static char pszThirdItem[] = "Third Item";
383 static char pszFourthItem[] = "Fourth Item";
384 static char pszReplaceItem[] = "Replace Item";
385 static char pszOutOfRangeItem[] = "Out Of Range Item";
386 
387 static char *str_items[] =
389 
390 static char pszUniTestA[] = "TST";
391 static 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++;
420  ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
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 &&
434  message != WM_ERASEBKGND &&
435  message != WM_NCPAINT &&
436  message != WM_NCHITTEST &&
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;
468  cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
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 
487 static 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 
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";
557  HDITEMA item;
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 */
566  item.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
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 */
580  item.mask = HDI_BITMAP | HDI_WIDTH | HDI_FORMAT;
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);
585  DeleteObject(hbm);
586 
587  item.mask = HDI_BITMAP | HDI_WIDTH | HDI_FORMAT;
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 */
599  item.mask = HDI_IMAGE | HDI_WIDTH | HDI_FORMAT;
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 
613 static 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 
666 static 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 
721 static 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  {
732  res = addItem(hWndHeader, 0, str_items[i]);
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 
779  setItem(hWndHeader, 3, str_items[4], TRUE);
780 
784  setItem(hWndHeader, 0, str_items[4], TRUE);
785  /* unexpected notifies cleared by notifies_received in setItem */
789  /* unexpected notifies cleared by notifies_received in setItem */
790  delItem(hWndHeader, 0);
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 
821 {
822 
823  HWND hChild;
824  RECT rect;
825  int retVal;
826 
830  "adder header control to parent", FALSE);
831 
832  retVal = SendMessageA(hChild, HDM_GETITEMRECT, 1, (LPARAM) &rect);
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 
840  retVal = SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
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 
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 
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 
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 
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 
963  retVal = SendMessageA(hChild, HDM_SETHOTDIVIDER, FALSE, 100);
964  expect(100, retVal);
966  expect(1, retVal);
969  "setHotDivider sequence testing", TRUE);
970  else
972  "setHotDivider sequence testing", FALSE);
973 
975 }
976 
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 
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 
1041  retVal = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, 100);
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 
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 
1226 {
1227  HWND hChild;
1228  HDITEMA hdItem;
1229  DWORD ret;
1230  RECT rect;
1231  HDHITTESTINFO ht;
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 
1294 {
1295  HWND hChild;
1296  HDITEMA hdItem;
1297  DWORD ret;
1298  RECT rect;
1299  HDHITTESTINFO ht;
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 */
1389  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
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:
1407  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
1408  return CDRF_NOTIFYITEMDRAW;
1409  case 1:
1411  return 0;
1412  case 2:
1414  return 0;
1415  case 3:
1416  TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
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:
1434  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
1436  case 1:
1438  return 0;
1439  case 2:
1441  return 0;
1442  case 3:
1443  TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
1444  return 0;
1445  case 4:
1446  TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight);
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:
1465  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
1467  case 1:
1469  return 0;
1470  case 2:
1471  TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
1472  return 0;
1473  case 3:
1474  TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight);
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 {
1485  g_CustomDrawCount = 0;
1490 }
1491 
1492 static 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;
1526  g_DrawItem.itemState = 0;
1529  ok(g_DrawItemReceived, "WM_DRAWITEM not received\n");
1531  hWndHeader = NULL;
1532  g_DrawItem.CtlType = 0;
1534 }
1535 
1536 static 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  {
1545  hdi.mask = HDI_LPARAM|HDI_ORDER;
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 
1554 static 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;
1585  SendMessageA(hWndHeader, HDM_INSERTITEMA, rand1[i], (LPARAM)&hdi);
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];
1594  SendMessageA(hWndHeader, HDM_INSERTITEMA, rand3[i], (LPARAM)&hdi);
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++)
1607  SendMessageA(hWndHeader, HDM_DELETEITEM, rand6[i], 0);
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 
1638  nReceivedNotify++;
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");
1652  compare(di->itemState, g_DrawItem.itemState, "%d");
1653  compare(di->rcItem.left, g_DrawItem.rcItem.left, "%d");
1654  compare(di->rcItem.top, g_DrawItem.rcItem.top, "%d");
1655  compare(di->rcItem.right, g_DrawItem.rcItem.right, "%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 
1670 static 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 
1680 static BOOL init(void)
1681 {
1682  WNDCLASSA wc;
1683  TEXTMETRICA tm;
1684  HFONT hOldFont;
1685  HDC hdc;
1686 
1687  wc.style = CS_HREDRAW | CS_VREDRAW;
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);
1703  GetTextMetricsA(hdc, &tm);
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,
1713  NULL, NULL, GetModuleHandleA(NULL), 0);
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 
1753 static 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 
1778 if (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 
1842  init_functions();
1844 
1845  if (!init())
1846  return;
1847 
1852  test_customdraw();
1853 
1855 
1857  parent_hwnd = create_custom_parent_window();
1858  ok_sequence(sequences, PARENT_SEQ_INDEX, create_parent_wnd_seq, "create parent windows", FALSE);
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 
1877  init_functions();
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 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static HWND hHeaderParentWnd
Definition: header.c:53
#define HDN_GETDISPINFOA
Definition: commctrl.h:849
#define NUM_MSG_SEQUENCES
Definition: header.c:61
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_IME_NOTIFY
Definition: winuser.h:1812
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
static UINT
Definition: header.c:29
Definition: tftpd.h:59
static void test_item_auto_format(HWND parent)
Definition: header.c:554
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define HDM_SETITEMA
Definition: commctrl.h:749
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
#define HDF_RIGHT
Definition: commctrl.h:710
static const struct message bitmapmarginMessages_seq[]
Definition: header.c:213
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
HBITMAP hbm
Definition: commctrl.h:666
#define HDM_ORDERTOINDEX
Definition: commctrl.h:796
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define WideCharToMultiByte
Definition: compat.h:101
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:833
static void test_hdm_unicodeformatMessages(HWND hParent)
Definition: header.c:1068
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define HDM_SETFILTERCHANGETIMEOUT
Definition: commctrl.h:823
#define HDM_CLEARFILTER
Definition: commctrl.h:829
#define HDM_SETHOTDIVIDER
Definition: commctrl.h:808
int cchTextMax
Definition: commctrl.h:667
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:270
static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected, BOOL todo, int line)
Definition: header.c:1721
HDC WINAPI GetDC(_In_opt_ HWND)
static const struct message filterMessages_seq_noninteractive[]
Definition: header.c:198
static const struct message hittest_seq[]
Definition: header.c:155
static void test_hdf_fixedwidth(HWND hParent)
Definition: header.c:1225
static HTREEITEM hChild
Definition: treeview.c:381
#define TEST_GET_ITEM(i, c)
Definition: header.c:394
#define pt(x, y)
Definition: drawing.c:79
#define SW_HIDE
Definition: winuser.h:762
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
#define WM_NCCALCSIZE
Definition: winuser.h:1667
#define CP_ACP
Definition: compat.h:99
#define HDI_BITMAP
Definition: commctrl.h:703
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define HDM_INSERTITEMA
Definition: commctrl.h:732
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:835
int fmt
Definition: commctrl.h:668
static void test_hdm_filterMessages(HWND hParent)
Definition: header.c:1009
char CHAR
Definition: xmlstorage.h:175
#define WM_GETTEXT
Definition: winuser.h:1600
#define expect(expected, got)
Definition: header.c:59
Definition: msg.h:39
#define MAX_CHARS
Definition: header.c:55
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define HDM_EDITFILTER
Definition: commctrl.h:826
LPWSTR pszText
Definition: commctrl.h:682
static HDC
Definition: imagelist.c:92
static HRGN INT iCode
Definition: mapping.c:33
#define CALLBACK
Definition: compat.h:27
#define HDM_GETIMAGELIST
Definition: commctrl.h:793
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
BOOL todo
Definition: filedlg.c:313
GLdouble n
Definition: glext.h:7729
LONG top
Definition: windef.h:307
static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
Definition: header.c:303
static void check_mask(void)
Definition: header.c:666
#define CDDS_POSTPAINT
Definition: commctrl.h:277
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
int cbClsExtra
Definition: winuser.h:3140
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define WM_SHOWWINDOW
Definition: winuser.h:1610
HWND hwndInsertAfter
Definition: winuser.h:3564
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:281
#define ZeroMemory
Definition: winbase.h:1642
#define CS_HREDRAW
Definition: winuser.h:648
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define WM_MOVE
Definition: winuser.h:1592
LPCSTR lpszMenuName
Definition: winuser.h:3146
GLuint buffer
Definition: glext.h:5915
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
#define WHITE_BRUSH
Definition: wingdi.h:901
#define HDM_GETITEMRECT
Definition: commctrl.h:787
static BOOL notifies_received(void)
Definition: header.c:238
#define WM_NCHITTEST
Definition: winuser.h:1668
Definition: dhcpd.h:245
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
#define HDM_DELETEITEM
Definition: commctrl.h:739
LRESULT(* CUSTOMDRAWPROC)(int n, NMCUSTOMDRAW *nm)
Definition: header.c:39
UINT_PTR WPARAM
Definition: windef.h:207
HBRUSH hbrBackground
Definition: winuser.h:3145
static HANDLE proc()
Definition: pdb.c:32
#define WS_CHILD
Definition: pedump.c:617
static void run_customdraw_scenario(CUSTOMDRAWPROC proc)
Definition: header.c:1482
int winetest_interactive
LONG left
Definition: windef.h:306
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static BOOL g_DrawItemReceived
Definition: header.c:44
static void compare_items(INT iCode, HDITEMA *hdi1, HDITEMA *hdi2, BOOL fUnicode)
Definition: header.c:347
char * LPSTR
Definition: xmlstorage.h:182
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:266
#define HDI_TEXT
Definition: commctrl.h:700
static const struct message create_parent_wnd_seq[]
Definition: header.c:67
LONG right
Definition: windef.h:308
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:405
#define WM_NCCREATE
Definition: winuser.h:1665
BOOL WINAPI DestroyWindow(_In_ HWND)
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:834
#define COLOR_WINDOW
Definition: winuser.h:908
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:426
int32_t INT
Definition: typedefs.h:56
#define PARENT_SEQ_INDEX
Definition: header.c:62
GLbitfield GLuint64 timeout
Definition: glext.h:7164
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
static void test_hdm_bitmapmarginMessages(HWND hParent)
Definition: header.c:1089
START_TEST(header)
Definition: header.c:1836
static const struct message orderToIndex_seq[]
Definition: header.c:150
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define HDS_HORZ
Definition: commctrl.h:624
#define HDF_CENTER
Definition: commctrl.h:711
static LRESULT expected_id
Definition: win.c:4344
#define WM_NCPAINT
Definition: winuser.h:1669
int cbWndExtra
Definition: winuser.h:3141
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 HDF_STRING
Definition: commctrl.h:716
GLenum GLint GLuint mask
Definition: glext.h:6028
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define HDM_GETITEMCOUNT
Definition: commctrl.h:729
#define HDM_HITTEST
Definition: commctrl.h:785
static const struct message getItem_seq[]
Definition: header.c:109
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_NCACTIVATE
Definition: winuser.h:1670
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
static char pszFirstItem[]
Definition: header.c:380
#define HHT_ONHEADER
Definition: commctrl.h:767
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
#define WM_PARENTNOTIFY
Definition: winuser.h:1785
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static const struct message setHotDivider_seq_interactive[]
Definition: header.c:162
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define HDI_FORMAT
Definition: commctrl.h:701
#define ODT_HEADER
Definition: commctrl.h:78
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define HDM_LAYOUT
Definition: commctrl.h:763
#define HDN_GETDISPINFOW
Definition: commctrl.h:850
HCURSOR hCursor
Definition: winuser.h:3144
unsigned int idx
Definition: utils.c:41
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
LPSTR pszText
Definition: commctrl.h:665
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GWLP_USERDATA
Definition: treelist.c:63
#define HDF_OWNERDRAW
Definition: commctrl.h:715
smooth NULL
Definition: ftsmooth.c:416
static void test_header_order(void)
Definition: header.c:1554
#define SM_CYSIZEFRAME
Definition: winuser.h:985
#define SYSTEM_FONT
Definition: wingdi.h:910
LONG_PTR LPARAM
Definition: windef.h:208
Definition: parser.c:48
#define HDM_CREATEDRAGIMAGE
Definition: commctrl.h:799
int cxy
Definition: commctrl.h:664
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:271
HDITEMA hdItem
Definition: header.c:36
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
const char * LPCSTR
Definition: xmlstorage.h:183
#define SW_SHOW
Definition: winuser.h:769
Definition: msg.h:41
#define HHT_ONDIVIDER
Definition: commctrl.h:768
#define HHT_BELOW
Definition: commctrl.h:773
#define WM_DESTROY
Definition: winuser.h:1591
static void test_hdm_sethotdivider(HWND hParent)
Definition: header.c:946
static void test_hdm_hittest(HWND hParent)
Definition: header.c:899
static CUSTOMDRAWPROC g_CustomDrawProc
Definition: header.c:41
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define HDF_BITMAP
Definition: commctrl.h:717
#define GetWindowLongPtrA
Definition: winuser.h:4803
#define todo_wine_if(is_todo)
Definition: test.h:164
#define CS_VREDRAW
Definition: winuser.h:653
#define HDM_SETORDERARRAY
Definition: commctrl.h:805
#define SM_CYCAPTION
Definition: winuser.h:953
#define trace
Definition: atltest.h:70
static WCHAR pszUniTestW[]
Definition: header.c:391
r parent
Definition: btrfs.c:2869
static BOOL init(void)
Definition: header.c:1680
__wchar_t WCHAR
Definition: xmlstorage.h:180
static char pszFourthItem[]
Definition: header.c:383
static void check_auto_fields(void)
Definition: header.c:613
static const struct message insertItem_seq[]
Definition: header.c:101
#define WM_SIZE
Definition: winuser.h:1593
static HWND create_header_control(void)
Definition: header.c:321
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
static void init_functions(void)
Definition: header.c:1670
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
Definition: header.c:1368
#define NF_REQUERY
Definition: winuser.h:2436
static void dont_expect_notify(INT iCode)
Definition: header.c:231
static char pszOutOfRangeItem[]
Definition: header.c:385
#define WINAPI
Definition: msvc.h:6
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1378
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
static char pszThirdItem[]
Definition: header.c:382
#define HDM_GETORDERARRAY
Definition: commctrl.h:802
static const struct message add_header_to_parent_seq_interactive[]
Definition: header.c:75
static const struct message imageMessages_seq[]
Definition: header.c:181
static HIMAGELIST(WINAPI *pImageList_Create)(int
#define HDI_IMAGE
Definition: commctrl.h:704
static void test_hdm_layout(HWND hParent)
Definition: header.c:857
#define WM_PAINT
Definition: winuser.h:1602
static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText)
Definition: header.c:274
static BOOL register_parent_wnd_class(void)
Definition: header.c:458
static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
Definition: header.c:219
int ret
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define CDDS_PREPAINT
Definition: commctrl.h:276
Definition: msg.h:34
static const WCHAR L[]
Definition: oid.c:1250
#define todo_wine
Definition: test.h:163
static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1424
static BOOL(WINAPI *pImageList_Destroy)(HIMAGELIST)
HDC hdc
Definition: main.c:9
static void test_hdm_orderarray(void)
Definition: header.c:1753
#define TEST_GET_ITEMCOUNT(i)
Definition: header.c:400
static HWND hWndHeader
Definition: header.c:54
static void test_header_control(void)
Definition: header.c:721
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static LONG getItemCount(HWND hdex)
Definition: header.c:298
static char pszSecondItem[]
Definition: header.c:381
#define SetWindowLongPtrA
Definition: winuser.h:5320
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
static void test_hds_nosizing(HWND hParent)
Definition: header.c:1293
#define LRESULT
Definition: ole.h:14
static void header_item_getback(HWND hwnd, UINT mask, HDITEMA *item)
Definition: header.c:538
int iImage
Definition: commctrl.h:670
Definition: time.h:76
int iOrder
Definition: commctrl.h:671
#define WM_COMMAND
Definition: winuser.h:1722
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPCSTR lpszClassName
Definition: winuser.h:3147
static const struct message unicodeformatMessages_seq[]
Definition: header.c:207
static void test_hdm_index_messages(HWND hParent)
Definition: header.c:1111
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
static const struct message setHotDivider_seq_noninteractive[]
Definition: header.c:174
#define GWLP_WNDPROC
Definition: treelist.c:66
#define NF_QUERY
Definition: winuser.h:2435
#define HDS_BUTTONS
Definition: commctrl.h:625
static void check_order(const int expected_id[], const int expected_order[], int count, const char *type)
Definition: header.c:1536
#define HDF_LEFT
Definition: commctrl.h:709
static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
Definition: header.c:312
UINT style
Definition: winuser.h:3138
#define HDI_ORDER
Definition: commctrl.h:706
static char pszReplaceItem[]
Definition: header.c:384
static void test_customdraw(void)
Definition: header.c:1492
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define GWL_STYLE
Definition: winuser.h:846
struct tagEXPECTEDNOTIFY EXPECTEDNOTIFY
static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
Definition: header.c:256
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HDM_GETUNICODEFORMAT
Definition: commctrl.h:820
#define WS_BORDER
Definition: pedump.c:625
static const struct message setItem_seq[]
Definition: header.c:132
#define WM_ACTIVATEAPP
Definition: winuser.h:1614
static ATOM item
Definition: dde.c:856
#define WM_ACTIVATE
Definition: winuser.h:1594
HINSTANCE hInstance
Definition: winuser.h:3142
#define X(f)
static INT nReceivedNotify
Definition: header.c:49
GLuint start
Definition: gl.h:1545
#define add_message(msg)
Definition: msg.c:2113
#define ARRAY_SIZE(a)
Definition: main.h:24
#define WM_CTLCOLOREDIT
Definition: winuser.h:1749
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
#define ok(value,...)
Definition: atltest.h:57
#define WM_LBUTTONUP
Definition: winuser.h:1759
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static const struct newhuff ht[]
Definition: huffman.h:296
static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: header.c:1613
RECT * prc
Definition: commctrl.h:759
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define compare(val, exp, fmt)
Definition: header.c:57
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1757
static DWORD g_customheight
Definition: header.c:45
#define HDM_SETIMAGELIST
Definition: commctrl.h:790
static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1455
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define CDRF_NOTIFYPOSTERASE
Definition: commctrl.h:273
static char * textBuffer
Definition: combo.c:52
#define HDM_GETBITMAPMARGIN
Definition: commctrl.h:814
#define WM_DEVICECHANGE
Definition: winuser.h:1793
WINDOWPOS * pwpos
Definition: commctrl.h:760
static void test_hdm_imageMessages(HWND hParent)
Definition: header.c:977
WNDPROC lpfnWndProc
Definition: winuser.h:3139
static const struct message getItemRect_seq[]
Definition: header.c:138
#define WM_DRAWITEM
Definition: winuser.h:1627
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
UINT mask
Definition: commctrl.h:680
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define HDI_LPARAM
Definition: commctrl.h:702
static LONG delItem(HWND hdex, int idx)
Definition: header.c:293
Definition: name.c:38
#define WM_CREATE
Definition: winuser.h:1590
GLuint res
Definition: glext.h:9613
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
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)
static INT nExpectedNotify
Definition: header.c:48
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
LONG bottom
Definition: windef.h:309
#define LOGPIXELSY
Definition: wingdi.h:718
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LPARAM lParam
Definition: commctrl.h:669
static HBITMAP
Definition: button.c:44
static int
Definition: header.c:29
#define HDM_GETITEMA
Definition: commctrl.h:742
static LONG addItem(HWND hdex, int idx, LPSTR text)
Definition: header.c:246
static EXPECTEDNOTIFY expectedNotify[10]
Definition: header.c:47
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
UINT mask
Definition: commctrl.h:663
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HDF_IMAGE
Definition: commctrl.h:719
LONG_PTR LRESULT
Definition: windef.h:209
static void test_hdm_ordertoindex(HWND hParent)
Definition: header.c:881
static const struct message deleteItem_getItemCount_seq[]
Definition: header.c:116
#define HDI_WIDTH
Definition: commctrl.h:698
static TCHAR * items[]
Definition: page1.c:45
static char pszUniTestA[]
Definition: header.c:390
#define WS_VISIBLE
Definition: pedump.c:620
HBRUSH WINAPI GetSysColorBrush(_In_ int)
Definition: _set.h:46
#define memset(x, y, z)
Definition: compat.h:39
static void test_hdm_getitemrect(HWND hParent)
Definition: header.c:820
static const struct message layout_seq[]
Definition: header.c:145
#define win_skip
Definition: test.h:150
static INT unexpectedNotify[10]
Definition: header.c:50
LPARAM lParam
Definition: combotst.c:139
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
static DRAWITEMSTRUCT g_DrawItem
Definition: header.c:43
static INT nUnexpectedNotify
Definition: header.c:51
static const struct message filterMessages_seq_interactive[]
Definition: header.c:188
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define HDM_SETUNICODEFORMAT
Definition: commctrl.h:817
static char * str_items[]
Definition: header.c:387
#define WM_NOTIFY
Definition: richedit.h:61
BOOL expected
Definition: store.c:2063
#define HEADER_SEQ_INDEX
Definition: header.c:63
static const struct message orderArray_seq[]
Definition: header.c:126
static UINT WPARAM wparam
Definition: combo.c:716
#define LPSTR_TEXTCALLBACKA
Definition: commctrl.h:2377
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 GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320
static HWND create_custom_parent_window(void)
Definition: header.c:475
#define HDN_ITEMCHANGEDW
Definition: commctrl.h:836
#define WC_HEADERA
Definition: commctrl.h:619
static int g_CustomDrawCount
Definition: header.c:42
#define ok_(x1, x2)
Definition: atltest.h:61
HICON hIcon
Definition: winuser.h:3143
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1397
GLuint const GLchar * name
Definition: glext.h:6031