ReactOS  0.4.13-dev-563-g0561610
combo.c
Go to the documentation of this file.
1 /* Unit test suite for ComboBox and ComboBoxEx32 controls.
2  *
3  * Copyright 2005 Jason Edmeades
4  * Copyright 2007 Mikolaj Zalewski
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include <limits.h>
22 #include <stdio.h>
23 #include <windows.h>
24 #include <commctrl.h>
25 
26 #include "wine/test.h"
27 #include "v6util.h"
28 #include "msg.h"
29 
30 #define EDITBOX_SEQ_INDEX 0
31 #define NUM_MSG_SEQUENCES 1
32 
33 #define EDITBOX_ID 0
34 #define COMBO_ID 1995
35 
36 #define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
37 
38 #define expect_rect(r, _left, _top, _right, _bottom) ok(r.left == _left && r.top == _top && \
39  r.bottom == _bottom && r.right == _right, "Invalid rect %s vs (%d,%d)-(%d,%d)\n", \
40  wine_dbgstr_rect(&r), _left, _top, _right, _bottom);
41 
42 
44 
47 static const char ComboExTestClass[] = "ComboExTestClass";
48 
49 static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR);
50 
51 #define MAX_CHARS 100
52 static char *textBuffer = NULL;
53 
55 
57 {
58  BOOL ret;
59 
60  info->cbSize = sizeof(*info);
62  ok(ret, "Failed to get combobox info structure, error %d\n", GetLastError());
63 }
64 
66  return CreateWindowExA(0, WC_COMBOBOXEXA, NULL, style, 0, 0, 300, 300,
68 }
69 
70 static LONG addItem(HWND cbex, int idx, const char *text) {
71  COMBOBOXEXITEMA cbexItem;
72  memset(&cbexItem, 0x00, sizeof(cbexItem));
73  cbexItem.mask = CBEIF_TEXT;
74  cbexItem.iItem = idx;
75  cbexItem.pszText = (char*)text;
76  cbexItem.cchTextMax = 0;
77  return SendMessageA(cbex, CBEM_INSERTITEMA, 0, (LPARAM)&cbexItem);
78 }
79 
80 static LONG setItem(HWND cbex, int idx, const char *text) {
81  COMBOBOXEXITEMA cbexItem;
82  memset(&cbexItem, 0x00, sizeof(cbexItem));
83  cbexItem.mask = CBEIF_TEXT;
84  cbexItem.iItem = idx;
85  cbexItem.pszText = (char*)text;
86  cbexItem.cchTextMax = 0;
87  return SendMessageA(cbex, CBEM_SETITEMA, 0, (LPARAM)&cbexItem);
88 }
89 
90 static LONG delItem(HWND cbex, int idx) {
91  return SendMessageA(cbex, CBEM_DELETEITEM, idx, 0);
92 }
93 
94 static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEMA *cbItem) {
95  memset(cbItem, 0x00, sizeof(COMBOBOXEXITEMA));
96  cbItem->mask = CBEIF_TEXT;
97  cbItem->pszText = textBuffer;
98  cbItem->iItem = idx;
99  cbItem->cchTextMax = 100;
100  return SendMessageA(cbex, CBEM_GETITEMA, 0, (LPARAM)cbItem);
101 }
102 
104 {
106  static LONG defwndproc_counter = 0;
107  struct message msg = { 0 };
108  LRESULT ret;
109 
110  msg.message = message;
111  msg.flags = sent|wparam|lparam;
112  if (defwndproc_counter) msg.flags |= defwinproc;
113  msg.wParam = wParam;
114  msg.lParam = lParam;
115  msg.id = EDITBOX_ID;
116 
117  if (message != WM_PAINT &&
118  message != WM_ERASEBKGND &&
119  message != WM_NCPAINT &&
120  message != WM_NCHITTEST &&
121  message != WM_GETTEXT &&
122  message != WM_GETICON &&
124  {
126  }
127 
128  defwndproc_counter++;
129  ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
130  defwndproc_counter--;
131  return ret;
132 }
133 
134 static HWND subclass_editbox(HWND hwndComboEx)
135 {
136  WNDPROC oldproc;
137  HWND hwnd;
138 
139  hwnd = (HWND)SendMessageA(hwndComboEx, CBEM_GETEDITCONTROL, 0, 0);
143 
144  return hwnd;
145 }
146 
147 static void test_comboex(void)
148 {
149  HWND myHwnd = 0;
150  LONG res;
151  COMBOBOXEXITEMA cbexItem;
152  static const char *first_item = "First Item",
153  *second_item = "Second Item",
154  *third_item = "Third Item",
155  *middle_item = "Between First and Second Items",
156  *replacement_item = "Between First and Second Items",
157  *out_of_range_item = "Out of Range Item";
158 
159  /* Allocate space for result */
161 
162  /* Basic comboboxex test */
164 
165  /* Add items onto the end of the combobox */
166  res = addItem(myHwnd, -1, first_item);
167  ok(res == 0, "Adding simple item failed (%d)\n", res);
168  res = addItem(myHwnd, -1, second_item);
169  ok(res == 1, "Adding simple item failed (%d)\n", res);
170  res = addItem(myHwnd, 2, third_item);
171  ok(res == 2, "Adding simple item failed (%d)\n", res);
172  res = addItem(myHwnd, 1, middle_item);
173  ok(res == 1, "Inserting simple item failed (%d)\n", res);
174 
175  /* Add an item completely out of range */
176  res = addItem(myHwnd, 99, out_of_range_item);
177  ok(res == -1, "Adding using out of range index worked unexpectedly (%d)\n", res);
178  res = addItem(myHwnd, 5, out_of_range_item);
179  ok(res == -1, "Adding using out of range index worked unexpectedly (%d)\n", res);
180  /* Removed: Causes traps on Windows XP
181  res = addItem(myHwnd, -2, "Out Of Range Item");
182  ok(res == -1, "Adding out of range worked unexpectedly (%ld)\n", res);
183  */
184 
185  /* Get an item completely out of range */
186  res = getItem(myHwnd, 99, &cbexItem);
187  ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText);
188  res = getItem(myHwnd, 4, &cbexItem);
189  ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText);
190  res = getItem(myHwnd, -2, &cbexItem);
191  ok(res == 0, "Getting item using out of range index worked unexpectedly (%d, %s)\n", res, cbexItem.pszText);
192 
193  /* Get an item in range */
194  res = getItem(myHwnd, 0, &cbexItem);
195  ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
196  ok(strcmp(first_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
197 
198  res = getItem(myHwnd, 1, &cbexItem);
199  ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
200  ok(strcmp(middle_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
201 
202  res = getItem(myHwnd, 2, &cbexItem);
203  ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
204  ok(strcmp(second_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
205 
206  res = getItem(myHwnd, 3, &cbexItem);
207  ok(res != 0, "Getting item using valid index failed unexpectedly (%d)\n", res);
208  ok(strcmp(third_item, cbexItem.pszText) == 0, "Getting item returned wrong string (%s)\n", cbexItem.pszText);
209 
210  /* Set an item completely out of range */
211  res = setItem(myHwnd, 99, replacement_item);
212  ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res);
213  res = setItem(myHwnd, 4, replacement_item);
214  ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res);
215  res = setItem(myHwnd, -2, replacement_item);
216  ok(res == 0, "Setting item using out of range index worked unexpectedly (%d)\n", res);
217 
218  /* Set an item in range */
219  res = setItem(myHwnd, 0, replacement_item);
220  ok(res != 0, "Setting first item failed (%d)\n", res);
221  res = setItem(myHwnd, 3, replacement_item);
222  ok(res != 0, "Setting last item failed (%d)\n", res);
223 
224  /* Remove items completely out of range (4 items in control at this point) */
225  res = delItem(myHwnd, -1);
226  ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res);
227  res = delItem(myHwnd, 4);
228  ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res);
229 
230  /* Remove items in range (4 items in control at this point) */
231  res = delItem(myHwnd, 3);
232  ok(res == 3, "Deleting using out of range index failed (%d)\n", res);
233  res = delItem(myHwnd, 0);
234  ok(res == 2, "Deleting using out of range index failed (%d)\n", res);
235  res = delItem(myHwnd, 0);
236  ok(res == 1, "Deleting using out of range index failed (%d)\n", res);
237  res = delItem(myHwnd, 0);
238  ok(res == 0, "Deleting using out of range index failed (%d)\n", res);
239 
240  /* Remove from an empty box */
241  res = delItem(myHwnd, 0);
242  ok(res == CB_ERR, "Deleting using out of range index worked unexpectedly (%d)\n", res);
243 
244 
245  /* Cleanup */
247  DestroyWindow(myHwnd);
248 }
249 
251 {
252  HWND hComboEx, hCombo, hEdit, hList;
253  COMBOBOXINFO cbInfo;
254  UINT x, y, item_height;
255  LRESULT result;
256  UINT i;
257  int idx;
258  RECT rect;
259  WCHAR buffer[3];
260  static const UINT choices[] = {8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
261  static const WCHAR stringFormat[] = {'%','2','d','\0'};
262 
263  hComboEx = CreateWindowExA(0, WC_COMBOBOXEXA, NULL,
264  WS_VISIBLE|WS_CHILD|CBS_DROPDOWN, 0, 0, 200, 150,
266 
267  for (i = 0; i < ARRAY_SIZE(choices); i++){
268  COMBOBOXEXITEMW cbexItem;
269  wsprintfW(buffer, stringFormat, choices[i]);
270 
271  memset(&cbexItem, 0x00, sizeof(cbexItem));
272  cbexItem.mask = CBEIF_TEXT;
273  cbexItem.iItem = i;
274  cbexItem.pszText = buffer;
275  cbexItem.cchTextMax = 0;
276  ok(SendMessageW(hComboEx, CBEM_INSERTITEMW, 0, (LPARAM)&cbexItem) >= 0,
277  "Failed to add item %d\n", i);
278  }
279 
280  hCombo = (HWND)SendMessageA(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
281  hEdit = (HWND)SendMessageA(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
282 
283  get_combobox_info(hCombo, &cbInfo);
284  hList = cbInfo.hwndList;
285 
287  "Focus not on Main Window, instead on %p\n", GetFocus());
288 
289  /* Click on the button to drop down the list */
290  x = cbInfo.rcButton.left + (cbInfo.rcButton.right-cbInfo.rcButton.left)/2;
291  y = cbInfo.rcButton.top + (cbInfo.rcButton.bottom-cbInfo.rcButton.top)/2;
292  result = SendMessageA(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
293  ok(result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
294  GetLastError());
295  ok(GetFocus() == hCombo ||
296  broken(GetFocus() != hCombo), /* win98 */
297  "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
298  GetFocus());
299  ok(SendMessageA(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
300  "The dropdown list should have appeared after clicking the button.\n");
301  idx = SendMessageA(hCombo, CB_GETTOPINDEX, 0, 0);
302  ok(idx == 0, "For TopIndex expected %d, got %d\n", 0, idx);
303 
304  result = SendMessageA(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
305  ok(result, "WM_LBUTTONUP was not processed. LastError=%d\n",
306  GetLastError());
307  ok(GetFocus() == hCombo ||
308  broken(GetFocus() != hCombo), /* win98 */
309  "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
310  GetFocus());
311 
312  /* Click on the 5th item in the list */
313  item_height = SendMessageA(hCombo, CB_GETITEMHEIGHT, 0, 0);
314  ok(GetClientRect(hList, &rect), "Failed to get list's client rect.\n");
315  x = rect.left + (rect.right-rect.left)/2;
316  y = item_height/2 + item_height*4;
318  ok(!result, "WM_MOUSEMOVE was not processed. LastError=%d\n",
319  GetLastError());
320  ok(GetFocus() == hCombo ||
321  broken(GetFocus() != hCombo), /* win98 */
322  "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
323  GetFocus());
324 
326  ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%d\n",
327  GetLastError());
328  ok(GetFocus() == hCombo ||
329  broken(GetFocus() != hCombo), /* win98 */
330  "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n",
331  GetFocus());
332  ok(SendMessageA(hComboEx, CB_GETDROPPEDSTATE, 0, 0),
333  "The dropdown list should still be visible.\n");
334 
336  ok(!result, "WM_LBUTTONUP was not processed. LastError=%d\n",
337  GetLastError());
338  todo_wine ok(GetFocus() == hEdit ||
339  broken(GetFocus() == hCombo), /* win98 */
340  "Focus not on ComboBoxEx's Edit Control, instead on %p\n",
341  GetFocus());
342 
343  result = SendMessageA(hCombo, CB_GETDROPPEDSTATE, 0, 0);
344  ok(!result ||
345  broken(result != 0), /* win98 */
346  "The dropdown list should have been rolled up.\n");
347  idx = SendMessageA(hComboEx, CB_GETCURSEL, 0, 0);
348  ok(idx == 4 ||
349  broken(idx == -1), /* win98 */
350  "Current Selection: expected %d, got %d\n", 4, idx);
351  ok(received_end_edit, "Expected to receive a CBEN_ENDEDIT message\n");
352 
354  ok( GetFocus() == hComboExParentWnd, "got %p\n", GetFocus() );
355  SetFocus( hComboEx );
356  ok( GetFocus() == hEdit, "got %p\n", GetFocus() );
357 
358  DestroyWindow(hComboEx);
359 }
360 
361 static void test_comboex_CB_GETLBTEXT(void)
362 {
363  HWND hCombo;
364  CHAR buff[1];
366  LRESULT ret;
367 
369 
370  /* set text to null */
371  addItem(hCombo, 0, NULL);
372 
373  buff[0] = 'a';
374  item.mask = CBEIF_TEXT;
375  item.iItem = 0;
376  item.pszText = buff;
377  item.cchTextMax = 1;
378  ret = SendMessageA(hCombo, CBEM_GETITEMA, 0, (LPARAM)&item);
379  ok(ret != 0, "CBEM_GETITEM failed\n");
380  ok(buff[0] == 0, "\n");
381 
382  ret = SendMessageA(hCombo, CB_GETLBTEXTLEN, 0, 0);
383  ok(ret == 0, "Expected zero length\n");
384 
385  ret = SendMessageA(hCombo, CB_GETLBTEXTLEN, 0, 0);
386  ok(ret == 0, "Expected zero length\n");
387 
388  buff[0] = 'a';
389  ret = SendMessageA(hCombo, CB_GETLBTEXT, 0, (LPARAM)buff);
390  ok(ret == 0, "Expected zero length\n");
391  ok(buff[0] == 0, "Expected null terminator as a string, got %s\n", buff);
392 
393  DestroyWindow(hCombo);
394 }
395 
397 {
398  HWND hCombo;
399  WINDOWPOS wp;
400  RECT rect;
401  int combo_height;
402  int ret;
403 
405  ok(hCombo != NULL, "createComboEx failed\n");
406  ret = GetWindowRect(hCombo, &rect);
407  ok(ret, "GetWindowRect failed\n");
408  combo_height = rect.bottom - rect.top;
409  ok(combo_height > 0, "wrong combo height\n");
410 
411  /* Test height > combo_height */
412  wp.x = rect.left;
413  wp.y = rect.top;
414  wp.cx = (rect.right - rect.left);
415  wp.cy = combo_height * 2;
416  wp.flags = 0;
417  wp.hwnd = hCombo;
418  wp.hwndInsertAfter = NULL;
419 
420  ret = SendMessageA(hCombo, WM_WINDOWPOSCHANGING, 0, (LPARAM)&wp);
421  ok(ret == 0, "expected 0, got %x\n", ret);
422  ok(wp.cy == combo_height,
423  "Expected height %d, got %d\n", combo_height, wp.cy);
424 
425  /* Test height < combo_height */
426  wp.x = rect.left;
427  wp.y = rect.top;
428  wp.cx = (rect.right - rect.left);
429  wp.cy = combo_height / 2;
430  wp.flags = 0;
431  wp.hwnd = hCombo;
432  wp.hwndInsertAfter = NULL;
433 
434  ret = SendMessageA(hCombo, WM_WINDOWPOSCHANGING, 0, (LPARAM)&wp);
435  ok(ret == 0, "expected 0, got %x\n", ret);
436  ok(wp.cy == combo_height,
437  "Expected height %d, got %d\n", combo_height, wp.cy);
438 
439  ret = DestroyWindow(hCombo);
440  ok(ret, "DestroyWindow failed\n");
441 }
442 
444 {
445  NMHDR *hdr = (NMHDR*)lParam;
446  switch(hdr->code){
447  case CBEN_ENDEDITA:
448  {
449  NMCBEENDEDITA *edit_info = (NMCBEENDEDITA*)hdr;
450  if(edit_info->iWhy==CBENF_DROPDOWN){
452  }
453  break;
454  }
455  case CBEN_ENDEDITW:
456  {
457  NMCBEENDEDITW *edit_info = (NMCBEENDEDITW*)hdr;
458  if(edit_info->iWhy==CBENF_DROPDOWN){
460  }
461  break;
462  }
463  }
464  return 0;
465 }
466 
468 {
469  switch(msg) {
470 
471  case WM_DESTROY:
472  PostQuitMessage(0);
473  break;
474  case WM_NOTIFY:
476  default:
477  return DefWindowProcA(hWnd, msg, wParam, lParam);
478  }
479 
480  return 0L;
481 }
482 
483 static void init_functions(void)
484 {
485  HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
486 
487 #define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
488 #define X2(f, ord) p##f = (void*)GetProcAddress(hComCtl32, (const char *)ord);
489  X2(SetWindowSubclass, 410);
490 #undef X
491 #undef X2
492 }
493 
494 static BOOL init(void)
495 {
496  WNDCLASSA wc;
497 
498  wc.style = CS_HREDRAW | CS_VREDRAW;
499  wc.cbClsExtra = 0;
500  wc.cbWndExtra = 0;
502  wc.hIcon = NULL;
505  wc.lpszMenuName = NULL;
508  RegisterClassA(&wc);
509 
510  hMainWnd = CreateWindowA(WC_STATICA, "Test", WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, NULL, NULL, NULL, 0);
512 
515  ok(hComboExParentWnd != NULL, "failed to create parent window\n");
516 
518 
519  return hComboExParentWnd != NULL;
520 }
521 
522 static void cleanup(void)
523 {
524  MSG msg;
525 
527  while (GetMessageA(&msg,0,0,0)) {
530  }
531 
534 
536 }
537 
538 static void test_comboex_subclass(void)
539 {
540  HWND hComboEx, hCombo, hEdit;
541 
543 
544  hCombo = (HWND)SendMessageA(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);
545  ok(hCombo != NULL, "Failed to get internal combo\n");
546  hEdit = (HWND)SendMessageA(hComboEx, CBEM_GETEDITCONTROL, 0, 0);
547  ok(hEdit != NULL, "Failed to get internal edit\n");
548 
549  if (pSetWindowSubclass)
550  {
551  ok(GetPropA(hCombo, "CC32SubclassInfo") != NULL, "Expected CC32SubclassInfo property\n");
552  ok(GetPropA(hEdit, "CC32SubclassInfo") != NULL, "Expected CC32SubclassInfo property\n");
553  }
554 
555  DestroyWindow(hComboEx);
556 }
557 
558 static const struct message test_setitem_edit_seq[] = {
559  { WM_SETTEXT, sent|id, 0, 0, EDITBOX_ID },
560  { EM_SETSEL, sent|id|wparam|lparam, 0, 0, EDITBOX_ID },
561  { EM_SETSEL, sent|id|wparam|lparam, 0, -1, EDITBOX_ID },
562  { 0 }
563 };
564 
565 static void test_comboex_get_set_item(void)
566 {
567  char textA[] = "test";
568  HWND hComboEx;
570  BOOL ret;
571 
573 
574  subclass_editbox(hComboEx);
575 
577 
578  memset(&item, 0, sizeof(item));
579  item.mask = CBEIF_TEXT;
580  item.pszText = textA;
581  item.iItem = -1;
582  ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
583  expect(TRUE, ret);
584 
585  ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE);
586 
587  /* get/set lParam */
588  item.mask = CBEIF_LPARAM;
589  item.iItem = -1;
590  item.lParam = 0xdeadbeef;
591  ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
592  expect(TRUE, ret);
593  ok(item.lParam == 0, "Expected zero, got %lx\n", item.lParam);
594 
595  item.lParam = 0x1abe11ed;
596  ret = SendMessageA(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item);
597  expect(TRUE, ret);
598 
599  item.lParam = 0;
600  ret = SendMessageA(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item);
601  expect(TRUE, ret);
602  ok(item.lParam == 0x1abe11ed, "Expected 0x1abe11ed, got %lx\n", item.lParam);
603 
604  DestroyWindow(hComboEx);
605 }
606 
608 {
609  return CreateWindowA(WC_COMBOBOXA, "Combo", WS_VISIBLE|WS_CHILD|style, 5, 5, 100, 100, hMainWnd, (HMENU)COMBO_ID, NULL, 0);
610 }
611 
613 {
614  TEXTMETRICA tm;
615  HFONT hFontOld;
616  HDC hDC;
617 
619  hFontOld = SelectObject(hDC, hFont);
621  SelectObject(hDC, hFontOld);
622  DeleteDC(hDC);
623 
624  return tm.tmHeight;
625 }
626 
628 {
629  HWND hCombo = create_combobox(style);
630  RECT r;
631  int i;
632 
633  GetClientRect(hCombo, &r);
637  todo_wine expect_rect(r, 5, 5, 105, 105);
638 
639  for (i = 1; i < 30; i++)
640  {
641  SendMessageA(hCombo, CB_SETITEMHEIGHT, -1, i);
642  GetClientRect(hCombo, &r);
643  ok((r.bottom - r.top) == (i + 6), "Unexpected client rect height.\n");
644  }
645 
646  DestroyWindow(hCombo);
647 }
648 
650 {
651  HFONT hFont1, hFont2;
652  HWND hCombo;
653  RECT r;
654  int i;
655 
656  hCombo = create_combobox(style);
659 
660  GetClientRect(hCombo, &r);
664  todo_wine expect_rect(r, 5, 5, 105, 105);
665 
666  /* The size of the dropped control is initially equal to the size
667  of the window when it was created. The size of the calculated
668  dropped area changes only by how much the selection area
669  changes, not by how much the list area changes. */
670  if (font_height(hFont1) == 10 && font_height(hFont2) == 8)
671  {
672  SendMessageA(hCombo, WM_SETFONT, (WPARAM)hFont1, FALSE);
673  GetClientRect(hCombo, &r);
674  expect_rect(r, 0, 0, 100, 18);
677  todo_wine expect_rect(r, 5, 5, 105, 105 - (font_height(GetStockObject(SYSTEM_FONT)) - font_height(hFont1)));
678 
679  SendMessageA(hCombo, WM_SETFONT, (WPARAM)hFont2, FALSE);
680  GetClientRect(hCombo, &r);
681  expect_rect(r, 0, 0, 100, 16);
684  todo_wine expect_rect(r, 5, 5, 105, 105 - (font_height(GetStockObject(SYSTEM_FONT)) - font_height(hFont2)));
685 
686  SendMessageA(hCombo, WM_SETFONT, (WPARAM)hFont1, FALSE);
687  GetClientRect(hCombo, &r);
688  expect_rect(r, 0, 0, 100, 18);
691  todo_wine expect_rect(r, 5, 5, 105, 105 - (font_height(GetStockObject(SYSTEM_FONT)) - font_height(hFont1)));
692  }
693  else
694  {
695  ok(0, "Expected Marlett font heights 10/8, got %d/%d\n",
696  font_height(hFont1), font_height(hFont2));
697  }
698 
699  for (i = 1; i < 30; i++)
700  {
702  int height = font_height(hFont);
703 
705  GetClientRect(hCombo, &r);
706  ok((r.bottom - r.top) == (height + 8), "Unexpected client rect height.\n");
707  SendMessageA(hCombo, WM_SETFONT, 0, FALSE);
709  }
710 
711  DestroyWindow(hCombo);
712  DeleteObject(hFont1);
713  DeleteObject(hFont2);
714 }
715 
716 static LRESULT (CALLBACK *old_parent_proc)(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
720 
722 {
723  switch (msg)
724  {
725  case WM_COMMAND:
726  switch (wparam)
727  {
729  {
730  HWND hCombo = (HWND)lparam;
731  char list[20], edit[20];
732  int idx;
733 
734  memset(list, 0, sizeof(list));
735  memset(edit, 0, sizeof(edit));
736 
737  idx = SendMessageA(hCombo, CB_GETCURSEL, 0, 0);
739  SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit);
740 
741  ok(!strcmp(edit, expected_edit_text), "edit: got %s, expected %s\n",
742  edit, expected_edit_text);
743  ok(!strcmp(list, expected_list_text), "list: got %s, expected %s\n",
745 
747  }
748  break;
749  }
750  break;
751  }
752 
753  return CallWindowProcA(old_parent_proc, hwnd, msg, wparam, lparam);
754 }
755 
756 static void test_selection(DWORD style, const char * const text[], const int *edit, const int *list)
757 {
758  HWND hCombo;
759  INT idx;
760 
761  hCombo = create_combobox(style);
762 
763  SendMessageA(hCombo, CB_ADDSTRING, 0, (LPARAM)text[0]);
764  SendMessageA(hCombo, CB_ADDSTRING, 0, (LPARAM)text[1]);
765  SendMessageA(hCombo, CB_SETCURSEL, -1, 0);
766 
767  old_parent_proc = (void *)SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)parent_wnd_proc);
768 
769  idx = SendMessageA(hCombo, CB_GETCURSEL, 0, 0);
770  ok(idx == -1, "expected selection -1, got %d\n", idx);
771 
772  /* keyboard navigation */
773 
775  expected_edit_text = text[edit[0]];
777  SendMessageA(hCombo, WM_KEYDOWN, VK_DOWN, 0);
778  ok(selchange_fired, "CBN_SELCHANGE not sent!\n");
779 
781  expected_edit_text = text[edit[1]];
783  SendMessageA(hCombo, WM_KEYDOWN, VK_DOWN, 0);
784  ok(selchange_fired, "CBN_SELCHANGE not sent!\n");
785 
787  expected_edit_text = text[edit[2]];
789  SendMessageA(hCombo, WM_KEYDOWN, VK_UP, 0);
790  ok(selchange_fired, "CBN_SELCHANGE not sent!\n");
791 
792  /* programmatic navigation */
793 
795  expected_edit_text = text[edit[3]];
797  SendMessageA(hCombo, CB_SETCURSEL, list[3], 0);
798  ok(!selchange_fired, "CBN_SELCHANGE sent!\n");
799 
801  expected_edit_text = text[edit[4]];
803  SendMessageA(hCombo, CB_SETCURSEL, list[4], 0);
804  ok(!selchange_fired, "CBN_SELCHANGE sent!\n");
805 
806  SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)old_parent_proc);
807  DestroyWindow(hCombo);
808 }
809 
810 static void test_combo_CBN_SELCHANGE(void)
811 {
812  static const char * const text[] = { "alpha", "beta", "" };
813  static const int sel_1[] = { 2, 0, 1, 0, 1 };
814  static const int sel_2[] = { 0, 1, 0, 0, 1 };
815 
816  test_selection(CBS_SIMPLE, text, sel_1, sel_2);
817  test_selection(CBS_DROPDOWN, text, sel_1, sel_2);
818  test_selection(CBS_DROPDOWNLIST, text, sel_2, sel_2);
819 }
820 
822 {
823  INT ddheight, clheight, ddwidth, clwidth;
824  HWND hCombo;
825  RECT rc;
826 
827  hCombo = create_combobox(style);
828 
829  /* get initial measurements */
830  GetClientRect( hCombo, &rc);
831  clheight = rc.bottom - rc.top;
832  clwidth = rc.right - rc.left;
833  SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rc);
834  ddheight = rc.bottom - rc.top;
835  ddwidth = rc.right - rc.left;
836  /* use MoveWindow to move & resize the combo */
837  /* first make it slightly smaller */
838  MoveWindow( hCombo, 10, 10, clwidth - 2, clheight - 2, TRUE);
839  GetClientRect( hCombo, &rc);
840  ok( rc.right - rc.left == clwidth - 2, "clientrect width is %d vs %d\n",
841  rc.right - rc.left, clwidth - 2);
842  ok( rc.bottom - rc.top == clheight, "clientrect height is %d vs %d\n",
843  rc.bottom - rc.top, clheight);
844  SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rc);
845  ok( rc.right - rc.left == clwidth - 2, "drop-down rect width is %d vs %d\n",
846  rc.right - rc.left, clwidth - 2);
847  ok( rc.bottom - rc.top == ddheight, "drop-down rect height is %d vs %d\n",
848  rc.bottom - rc.top, ddheight);
849  ok( rc.right - rc.left == ddwidth -2, "drop-down rect width is %d vs %d\n",
850  rc.right - rc.left, ddwidth - 2);
851  /* new cx, cy is slightly bigger than the initial values */
852  MoveWindow( hCombo, 10, 10, clwidth + 2, clheight + 2, TRUE);
853  GetClientRect( hCombo, &rc);
854  ok( rc.right - rc.left == clwidth + 2, "clientrect width is %d vs %d\n",
855  rc.right - rc.left, clwidth + 2);
856  ok( rc.bottom - rc.top == clheight, "clientrect height is %d vs %d\n",
857  rc.bottom - rc.top, clheight);
858  SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rc);
859  ok( rc.right - rc.left == clwidth + 2, "drop-down rect width is %d vs %d\n",
860  rc.right - rc.left, clwidth + 2);
861  todo_wine {
862  ok( rc.bottom - rc.top == clheight + 2, "drop-down rect height is %d vs %d\n",
863  rc.bottom - rc.top, clheight + 2);
864  }
865 
866  ddwidth = SendMessageA(hCombo, CB_SETDROPPEDWIDTH, -1, 0);
867  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
868  ddwidth = SendMessageA(hCombo, CB_GETDROPPEDWIDTH, 0, 0);
869  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
870 
871  ddwidth = SendMessageA(hCombo, CB_SETDROPPEDWIDTH, 0, 0);
872  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
873  ddwidth = SendMessageA(hCombo, CB_GETDROPPEDWIDTH, 0, 0);
874  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
875 
876  ddwidth = SendMessageA(hCombo, CB_SETDROPPEDWIDTH, clwidth - 1, 0);
877  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
878  ddwidth = SendMessageA(hCombo, CB_GETDROPPEDWIDTH, 0, 0);
879  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
880 
881  ddwidth = SendMessageA(hCombo, CB_SETDROPPEDWIDTH, clwidth << 1, 0);
882  ok( ddwidth == (clwidth << 1), "drop-width is %d vs %d\n", ddwidth, clwidth << 1);
883  ddwidth = SendMessageA(hCombo, CB_GETDROPPEDWIDTH, 0, 0);
884  ok( ddwidth == (clwidth << 1), "drop-width is %d vs %d\n", ddwidth, clwidth << 1);
885 
886  ddwidth = SendMessageA(hCombo, CB_SETDROPPEDWIDTH, 0, 0);
887  ok( ddwidth == (clwidth << 1), "drop-width is %d vs %d\n", ddwidth, clwidth << 1);
888  ddwidth = SendMessageA(hCombo, CB_GETDROPPEDWIDTH, 0, 0);
889  ok( ddwidth == (clwidth << 1), "drop-width is %d vs %d\n", ddwidth, clwidth << 1);
890 
891  ddwidth = SendMessageA(hCombo, CB_SETDROPPEDWIDTH, 1, 0);
892  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
893  ddwidth = SendMessageA(hCombo, CB_GETDROPPEDWIDTH, 0, 0);
894  ok( ddwidth == clwidth + 2, "drop-width is %d vs %d\n", ddwidth, clwidth + 2);
895 
896  DestroyWindow(hCombo);
897 }
898 
899 static void test_combo_editselection(void)
900 {
901  COMBOBOXINFO cbInfo;
902  INT start, end;
903  char edit[20];
904  HWND hCombo;
905  HWND hEdit;
906  DWORD len;
907 
908  /* Build a combo */
909  hCombo = create_combobox(CBS_SIMPLE);
910 
911  get_combobox_info(hCombo, &cbInfo);
912  hEdit = cbInfo.hwndItem;
913 
914  /* Initially combo selection is empty*/
915  len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0);
916  ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len));
917  ok(HIWORD(len)==0, "Unexpected end position for selection %d\n", HIWORD(len));
918 
919  /* Set some text, and press a key to replace it */
920  edit[0] = 0x00;
921  SendMessageA(hCombo, WM_SETTEXT, 0, (LPARAM)"Jason1");
922  SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit);
923  ok(strcmp(edit, "Jason1")==0, "Unexpected text retrieved %s\n", edit);
924 
925  /* Now what is the selection - still empty */
927  ok(start==0, "Unexpected start position for selection %d\n", start);
928  ok(end==0, "Unexpected end position for selection %d\n", end);
929  len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0);
930  ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len));
931  ok(HIWORD(len)==0, "Unexpected end position for selection %d\n", HIWORD(len));
932 
933  /* Give it focus, and it gets selected */
934  SendMessageA(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit);
936  ok(start==0, "Unexpected start position for selection %d\n", start);
937  ok(end==6, "Unexpected end position for selection %d\n", end);
938  len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0);
939  ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len));
940  ok(HIWORD(len)==6, "Unexpected end position for selection %d\n", HIWORD(len));
941 
942  /* Now emulate a key press */
943  edit[0] = 0x00;
944  SendMessageA(hCombo, WM_CHAR, 'A', 0x1c0001);
945  SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit);
946  ok(strcmp(edit, "A")==0, "Unexpected text retrieved %s\n", edit);
947 
948  len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0);
949  ok(LOWORD(len)==1, "Unexpected start position for selection %d\n", LOWORD(len));
950  ok(HIWORD(len)==1, "Unexpected end position for selection %d\n", HIWORD(len));
951 
952  /* Now what happens when it gets more focus a second time - it doesn't reselect */
953  SendMessageA(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit);
954  len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0);
955  ok(LOWORD(len)==1, "Unexpected start position for selection %d\n", LOWORD(len));
956  ok(HIWORD(len)==1, "Unexpected end position for selection %d\n", HIWORD(len));
957  DestroyWindow(hCombo);
958 
959  /* Start again - Build a combo */
960  hCombo = create_combobox(CBS_SIMPLE);
961  get_combobox_info(hCombo, &cbInfo);
962  hEdit = cbInfo.hwndItem;
963 
964  /* Set some text and give focus so it gets selected */
965  edit[0] = 0x00;
966  SendMessageA(hCombo, WM_SETTEXT, 0, (LPARAM)"Jason2");
967  SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit);
968  ok(strcmp(edit, "Jason2")==0, "Unexpected text retrieved %s\n", edit);
969 
970  SendMessageA(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit);
971 
972  /* Now what is the selection */
974  ok(start==0, "Unexpected start position for selection %d\n", start);
975  ok(end==6, "Unexpected end position for selection %d\n", end);
976  len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0);
977  ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len));
978  ok(HIWORD(len)==6, "Unexpected end position for selection %d\n", HIWORD(len));
979 
980  /* Now change the selection to the apparently invalid start -1, end -1 and
981  show it means no selection (ie start -1) but cursor at end */
982  SendMessageA(hCombo, CB_SETEDITSEL, 0, -1);
983  edit[0] = 0x00;
984  SendMessageA(hCombo, WM_CHAR, 'A', 0x1c0001);
985  SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit);
986  ok(strcmp(edit, "Jason2A")==0, "Unexpected text retrieved %s\n", edit);
987  DestroyWindow(hCombo);
988 }
989 
991 static long setsel_start = 1, setsel_end = 1;
993 
995 {
996  if (msg == EM_SETSEL)
997  {
999  setsel_end = lParam;
1000  }
1002 }
1003 
1005 {
1006  switch (msg)
1007  {
1008  case WM_COMMAND:
1009  switch (HIWORD(wParam))
1010  {
1011  case CBN_SETFOCUS:
1013  break;
1014  case CBN_KILLFOCUS:
1016  break;
1017  }
1018  break;
1019  case WM_NEXTDLGCTL:
1020  SetFocus((HWND)wParam);
1021  break;
1022  }
1023  return CallWindowProcA(old_parent_proc, hwnd, msg, wParam, lParam);
1024 }
1025 
1027 {
1028  static const char wine_test[] = "Wine Test";
1029  HWND hCombo, hEdit, hButton;
1030  char buffer[16] = {0};
1031  COMBOBOXINFO cbInfo;
1032  DWORD len;
1033 
1034  hCombo = create_combobox(style);
1035  get_combobox_info(hCombo, &cbInfo);
1036  hEdit = cbInfo.hwndItem;
1037 
1039  5, 50, 100, 20, hMainWnd, NULL,
1041 
1044 
1045  SendMessageA(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit);
1046  ok(setsel_start == 0, "Unexpected EM_SETSEL start value; got %ld\n", setsel_start);
1047  todo_wine ok(setsel_end == INT_MAX, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
1048  ok(hCBN_SetFocus == hCombo, "Wrong handle set by CBN_SETFOCUS; got %p\n", hCBN_SetFocus);
1049  ok(GetFocus() == hEdit, "hEdit should have keyboard focus\n");
1050 
1052  ok(setsel_start == 0, "Unexpected EM_SETSEL start value; got %ld\n", setsel_start);
1053  todo_wine ok(setsel_end == 0, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
1054  ok(hCBN_KillFocus == hCombo, "Wrong handle set by CBN_KILLFOCUS; got %p\n", hCBN_KillFocus);
1055  ok(GetFocus() == hButton, "hButton should have keyboard focus\n");
1056 
1057  SendMessageA(hCombo, WM_SETTEXT, 0, (LPARAM)wine_test);
1059  ok(setsel_start == 0, "Unexpected EM_SETSEL start value; got %ld\n", setsel_start);
1060  todo_wine ok(setsel_end == INT_MAX, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
1061  ok(hCBN_SetFocus == hCombo, "Wrong handle set by CBN_SETFOCUS; got %p\n", hCBN_SetFocus);
1062  ok(GetFocus() == hEdit, "hEdit should have keyboard focus\n");
1063  SendMessageA(hCombo, WM_GETTEXT, sizeof(buffer), (LPARAM)buffer);
1064  ok(!strcmp(buffer, wine_test), "Unexpected text in edit control; got '%s'\n", buffer);
1065 
1067  ok(setsel_start == 0, "Unexpected EM_SETSEL start value; got %ld\n", setsel_start);
1068  todo_wine ok(setsel_end == 0, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
1069  ok(hCBN_KillFocus == hCombo, "Wrong handle set by CBN_KILLFOCUS; got %p\n", hCBN_KillFocus);
1070  ok(GetFocus() == hButton, "hButton should have keyboard focus\n");
1071  len = SendMessageA(hCombo, CB_GETEDITSEL, 0, 0);
1072  ok(len == 0, "Unexpected text selection; start: %u, end: %u\n", LOWORD(len), HIWORD(len));
1073 
1074  SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)old_parent_proc);
1075  DestroyWindow(hButton);
1076  DestroyWindow(hCombo);
1077 }
1078 
1079 static void test_combo_listbox_styles(DWORD cb_style)
1080 {
1081  DWORD style, exstyle, expect_style, expect_exstyle;
1083  HWND combo;
1084 
1086  if (cb_style == CBS_SIMPLE)
1087  {
1089  expect_exstyle = WS_EX_CLIENTEDGE;
1090  }
1091  else
1092  {
1094  expect_exstyle = WS_EX_TOOLWINDOW;
1095  }
1096 
1097  combo = create_combobox(cb_style);
1098  get_combobox_info(combo, &info);
1099 
1100  style = GetWindowLongW( info.hwndList, GWL_STYLE );
1101  exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE );
1102  ok(style == expect_style, "%08x: got %08x\n", cb_style, style);
1103  ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle);
1104 
1105  if (cb_style != CBS_SIMPLE)
1106  expect_exstyle |= WS_EX_TOPMOST;
1107 
1108  SendMessageW(combo, CB_SHOWDROPDOWN, TRUE, 0 );
1109  style = GetWindowLongW( info.hwndList, GWL_STYLE );
1110  exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE );
1111  ok(style == (expect_style | WS_VISIBLE), "%08x: got %08x\n", cb_style, style);
1112  ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle);
1113 
1114  SendMessageW(combo, CB_SHOWDROPDOWN, FALSE, 0 );
1115  style = GetWindowLongW( info.hwndList, GWL_STYLE );
1116  exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE );
1117  ok(style == expect_style, "%08x: got %08x\n", cb_style, style);
1118  ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle);
1119 
1120  DestroyWindow(combo);
1121 }
1122 
1123 static void test_combo_WS_VSCROLL(void)
1124 {
1125  HWND hCombo, hList;
1127  DWORD style;
1128  int i;
1129 
1131 
1132  get_combobox_info(hCombo, &info);
1133  hList = info.hwndList;
1134 
1135  for (i = 0; i < 3; i++)
1136  {
1137  char buffer[2];
1138  sprintf(buffer, "%d", i);
1139  SendMessageA(hCombo, CB_ADDSTRING, 0, (LPARAM)buffer);
1140  }
1141 
1142  style = GetWindowLongA(info.hwndList, GWL_STYLE);
1144 
1145  SendMessageA(hCombo, CB_SHOWDROPDOWN, TRUE, 0);
1146  SendMessageA(hCombo, CB_SHOWDROPDOWN, FALSE, 0);
1147 
1149  ok((style & WS_VSCROLL) != 0, "Style does not include WS_VSCROLL\n");
1150 
1151  DestroyWindow(hCombo);
1152 }
1153 
1155 {
1156  static const char wine_test[] = "Wine Test";
1157  HWND hCombo, hList;
1158  COMBOBOXINFO cbInfo;
1159  int i, test, ret;
1160 
1161  static const struct list_size_info
1162  {
1163  int num_items;
1164  int height_combo;
1165  int limit;
1166  } info_height[] = {
1167  {33, 50, -1},
1168  {35, 100, 40},
1169  {15, 50, 3},
1170  };
1171 
1172  for (test = 0; test < ARRAY_SIZE(info_height); test++)
1173  {
1174  const struct list_size_info *info_test = &info_height[test];
1175  int height_item; /* Height of a list item */
1176  int height_list; /* Height of the list we got */
1177  int expected_height_list;
1178  RECT rect_list_client;
1179  int min_visible_expected;
1180 
1181  hCombo = CreateWindowA(WC_COMBOBOXA, "Combo", CBS_DROPDOWN | WS_VISIBLE | WS_CHILD | style, 5, 5, 100,
1182  info_test->height_combo, hMainWnd, (HMENU)COMBO_ID, NULL, 0);
1183 
1184  min_visible_expected = SendMessageA(hCombo, CB_GETMINVISIBLE, 0, 0);
1185  ok(min_visible_expected == 30, "Unexpected number of items %d.\n", min_visible_expected);
1186 
1187  cbInfo.cbSize = sizeof(COMBOBOXINFO);
1188  ret = SendMessageA(hCombo, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbInfo);
1189  ok(ret, "Failed to get combo info, %d\n", ret);
1190 
1191  hList = cbInfo.hwndList;
1192  for (i = 0; i < info_test->num_items; i++)
1193  {
1194  ret = SendMessageA(hCombo, CB_ADDSTRING, 0, (LPARAM) wine_test);
1195  ok(ret == i, "Failed to add string %d, returned %d.\n", i, ret);
1196  }
1197 
1198  if (info_test->limit != -1)
1199  {
1200  int min_visible_actual;
1201  min_visible_expected = info_test->limit;
1202 
1203  ret = SendMessageA(hCombo, CB_SETMINVISIBLE, min_visible_expected, 0);
1204  ok(ret, "Failed to set visible limit.\n");
1205  min_visible_actual = SendMessageA(hCombo, CB_GETMINVISIBLE, 0, 0);
1206  ok(min_visible_expected == min_visible_actual, "test %d: unexpected number of items %d.\n",
1207  test, min_visible_actual);
1208  }
1209 
1210  ret = SendMessageA(hCombo, CB_SHOWDROPDOWN, TRUE,0);
1211  ok(ret, "Failed to show dropdown.\n");
1212  ret = SendMessageA(hCombo, CB_GETDROPPEDSTATE, 0, 0);
1213  ok(ret, "Unexpected dropped state.\n");
1214 
1215  GetClientRect(hList, &rect_list_client);
1216  height_list = rect_list_client.bottom - rect_list_client.top;
1217  height_item = (int)SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0);
1218 
1220  {
1221  RECT rect_list_complete;
1222  int list_height_nonclient;
1223  int list_height_calculated;
1224  int edit_padding_size = cbInfo.rcItem.top; /* edit client rect top is the padding it has to its parent
1225  We assume it's the same on the bottom */
1226 
1227  GetWindowRect(hList, &rect_list_complete);
1228 
1229  list_height_nonclient = (rect_list_complete.bottom - rect_list_complete.top)
1230  - (rect_list_client.bottom - rect_list_client.top);
1231 
1232  /* Calculate the expected client size of the listbox popup from the size of the combobox. */
1233  list_height_calculated = info_test->height_combo /* Take height we created combobox with */
1234  - (cbInfo.rcItem.bottom - cbInfo.rcItem.top) /* Subtract size of edit control */
1235  - list_height_nonclient /* Subtract list nonclient area */
1236  - edit_padding_size * 2; /* subtract space around the edit control */
1237 
1238  expected_height_list = min(list_height_calculated, height_item * info_test->num_items);
1239  if (expected_height_list < 0)
1240  expected_height_list = 0;
1241 
1242  ok(expected_height_list == height_list, "Test %d, expected list height to be %d, got %d\n",
1243  test, expected_height_list, height_list);
1244  }
1245  else
1246  {
1247  expected_height_list = min(info_test->num_items, min_visible_expected) * height_item;
1248 
1249  ok(expected_height_list == height_list, "Test %d, expected list height to be %d, got %d\n",
1250  test, expected_height_list, height_list);
1251  }
1252 
1253  DestroyWindow(hCombo);
1254  }
1255 }
1256 
1258 {
1259  ULONG_PTR ctx_cookie;
1260  HANDLE hCtx;
1261 
1262  init_functions();
1263 
1264  if (!init())
1265  return;
1266 
1268 
1269  /* ComboBoxEx32 tests. */
1270  test_comboex();
1276 
1277  if (!load_v6_module(&ctx_cookie, &hCtx))
1278  {
1279  cleanup();
1280  return;
1281  }
1282 
1283  /* ComboBox control tests. */
1300 
1301  cleanup();
1302  unload_v6_module(ctx_cookie, hCtx);
1303 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define CB_GETTOPINDEX
Definition: winuser.h:1916
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
Definition: main.c:44
#define WC_STATICA
Definition: commctrl.h:4650
static void test_selection(DWORD style, const char *const text[], const int *edit, const int *list)
Definition: combo.c:756
#define CBN_SETFOCUS
Definition: winuser.h:1943
static void test_comboex_CB_GETLBTEXT(void)
Definition: combo.c:361
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void test_combo_listbox_styles(DWORD cb_style)
Definition: combo.c:1079
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
Definition: tftpd.h:59
static HWND hComboExParentWnd
Definition: combo.c:45
#define CB_GETLBTEXTLEN
Definition: winuser.h:1914
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
static void test_comboex_subclass(void)
Definition: combo.c:538
char hdr[14]
Definition: iptest.cpp:33
static LRESULT(CALLBACK *old_parent_proc)(HWND hwnd
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1906
static HWND create_combobox(DWORD style)
Definition: combo.c:607
static HWND hMainWnd
Definition: combo.c:45
#define DEFAULT_QUALITY
Definition: wingdi.h:435
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define WM_CHAR
Definition: winuser.h:1693
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
static void test_comboex_WM_LBUTTONDOWN(void)
Definition: combo.c:250
static HWND hCBN_SetFocus
Definition: combo.c:992
#define INT_MAX
Definition: limits.h:40
#define FF_DONTCARE
Definition: wingdi.h:447
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
#define WC_COMBOBOXA
Definition: commctrl.h:4687
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1923
static void test_comboex_WM_WINDOWPOSCHANGING(void)
Definition: combo.c:396
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_GETLBTEXT
Definition: winuser.h:1913
static BOOL(WINAPI *pSetWindowSubclass)(HWND
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
const WCHAR * text
Definition: package.c:1827
static void test_comboex(void)
Definition: combo.c:147
#define LBS_HASSTRINGS
Definition: pedump.c:684
char CHAR
Definition: xmlstorage.h:175
#define SYMBOL_CHARSET
Definition: wingdi.h:384
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WM_GETTEXT
Definition: winuser.h:1600
Definition: msg.h:39
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
static long setsel_start
Definition: combo.c:991
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
HWND hWnd
Definition: settings.c:17
static BOOL received_end_edit
Definition: combo.c:54
LONG top
Definition: windef.h:292
HANDLE HWND
Definition: compat.h:13
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define MAX_CHARS
Definition: combo.c:51
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
int cbClsExtra
Definition: winuser.h:3118
HWND hwndInsertAfter
Definition: winuser.h:3531
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3124
#define GWL_EXSTYLE
Definition: winuser.h:845
GLuint buffer
Definition: glext.h:5915
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
HWND WINAPI SetFocus(_In_opt_ HWND)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define LBS_COMBOBOX
Definition: winuser.h:324
static const struct message test_setitem_edit_seq[]
Definition: combo.c:558
#define WM_NCHITTEST
Definition: winuser.h:1668
#define test
Definition: rosglue.h:37
UINT_PTR WPARAM
Definition: windef.h:207
GLuint GLuint end
Definition: gl.h:1545
#define VK_DOWN
Definition: winuser.h:2181
HBRUSH hbrBackground
Definition: winuser.h:3123
#define WS_CHILD
Definition: pedump.c:617
LONG left
Definition: windef.h:291
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static void test_combo_setitemheight(DWORD style)
Definition: combo.c:627
#define COMBO_ID
Definition: combo.c:34
#define CBEM_INSERTITEMA
Definition: commctrl.h:3798
LONG right
Definition: windef.h:293
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define COLOR_WINDOW
Definition: winuser.h:908
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
static LPCSTR expected_list_text
Definition: combo.c:718
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
HFONT hFont
Definition: main.c:53
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static const char ComboExTestClass[]
Definition: combo.c:47
#define CB_SETITEMHEIGHT
Definition: winuser.h:1928
GLint limit
Definition: glext.h:10326
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: combo.c:721
struct _test_info info[]
Definition: SetCursorPos.c:19
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define CB_GETEDITSEL
Definition: winuser.h:1908
static LRESULT CALLBACK test_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:1004
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define WM_NCPAINT
Definition: winuser.h:1669
static void test_combo_editselection_focus(DWORD style)
Definition: combo.c:1026
static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
Definition: combo.c:56
static void cleanup(void)
Definition: combo.c:522
int cbWndExtra
Definition: winuser.h:3119
static void init_functions(void)
Definition: combo.c:483
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 LONG setItem(HWND cbex, int idx, const char *text)
Definition: combo.c:80
#define CB_GETDROPPEDWIDTH
Definition: winuser.h:1907
#define VK_UP
Definition: winuser.h:2179
static HWND hCBN_KillFocus
Definition: combo.c:992
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
static UINT msg
Definition: combo.c:716
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define CBEIF_TEXT
Definition: commctrl.h:3758
#define CB_SHOWDROPDOWN
Definition: winuser.h:1931
static LONG addItem(HWND cbex, int idx, const char *text)
Definition: combo.c:70
#define CBN_KILLFOCUS
Definition: winuser.h:1939
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
BOOL WINAPI GetComboBoxInfo(HWND hwndCombo, PCOMBOBOXINFO pcbi)
Definition: combo.c:2313
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:425
#define CBS_SIMPLE
Definition: winuser.h:291
#define ok(value,...)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
static LONG delItem(HWND cbex, int idx)
Definition: combo.c:90
HCURSOR hCursor
Definition: winuser.h:3122
unsigned int idx
Definition: utils.c:41
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GWLP_USERDATA
Definition: treelist.c:63
#define CBEM_DELETEITEM
Definition: commctrl.h:3803
#define CB_ADDSTRING
Definition: winuser.h:1897
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1902
smooth NULL
Definition: ftsmooth.c:416
#define WC_BUTTONA
Definition: commctrl.h:4594
#define SYSTEM_FONT
Definition: wingdi.h:910
#define WM_KEYDOWN
Definition: winuser.h:1691
LONG_PTR LPARAM
Definition: windef.h:208
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
static long setsel_end
Definition: combo.c:991
#define CB_SETMINVISIBLE
Definition: commctrl.h:4692
#define CBEM_GETEDITCONTROL
Definition: commctrl.h:3805
#define NUM_MSG_SEQUENCES
Definition: combo.c:31
UINT flags
Definition: winuser.h:3536
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
static void test_combo_editselection(void)
Definition: combo.c:899
#define WM_SETTEXT
Definition: winuser.h:1599
#define CB_ERR
Definition: winuser.h:2389
static void test_combo_CBN_SELCHANGE(void)
Definition: combo.c:810
#define WM_DESTROY
Definition: winuser.h:1591
#define CBEN_ENDEDITA
Definition: commctrl.h:3847
#define CBEN_ENDEDITW
Definition: commctrl.h:3848
#define GetWindowLongPtrA
Definition: winuser.h:4697
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1261
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: combo.c:43
#define CBEIF_LPARAM
Definition: commctrl.h:3763
#define CS_VREDRAW
Definition: winuser.h:653
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1905
#define DEFAULT_PITCH
Definition: wingdi.h:442
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const char textA[]
Definition: registrar.c:40
static HWND createComboEx(DWORD style)
Definition: combo.c:65
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define WM_CLOSE
Definition: winuser.h:1603
#define WINAPI
Definition: msvc.h:8
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
#define EM_SETSEL
Definition: winuser.h:1979
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:414
unsigned long DWORD
Definition: ntddk_ex.h:95
static void test_combo_setfont(DWORD style)
Definition: combo.c:649
static BOOL selchange_fired
Definition: combo.c:719
static const WCHAR stringFormat[]
Definition: wordpad.c:54
#define WM_PAINT
Definition: winuser.h:1602
#define EDITBOX_SEQ_INDEX
Definition: combo.c:30
int ret
static void test_combo_dropdown_size(DWORD style)
Definition: combo.c:1154
static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:467
#define CB_GETMINVISIBLE
Definition: commctrl.h:4693
Definition: msg.h:34
static const WCHAR L[]
Definition: oid.c:1250
#define todo_wine
Definition: test.h:154
static HINSTANCE hMainHinst
Definition: combo.c:46
GLenum GLsizei len
Definition: glext.h:6722
static int font_height(HFONT hFont)
Definition: combo.c:612
#define SetWindowLongPtrA
Definition: winuser.h:5214
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
#define WS_EX_TOPMOST
Definition: pedump.c:647
Definition: _list.h:228
static HWND hEdit
Definition: autocomplete.c:34
#define CB_SETCURSEL
Definition: winuser.h:1922
Definition: time.h:76
#define WM_COMMAND
Definition: winuser.h:1716
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPCSTR lpszClassName
Definition: winuser.h:3125
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define expect_rect(r, _left, _top, _right, _bottom)
Definition: combo.c:38
#define LB_GETITEMHEIGHT
Definition: winuser.h:2003
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
static LRESULT CALLBACK combobox_subclass_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:994
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define GWLP_WNDPROC
Definition: treelist.c:66
#define expect_style(window, style)
#define broken(x)
Definition: _sntprintf.h:21
HFONT WINAPI CreateFontA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR)
static HWND subclass_editbox(HWND hwndComboEx)
Definition: combo.c:134
static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEMA *cbItem)
Definition: combo.c:94
UINT style
Definition: winuser.h:3116
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
#define GWL_STYLE
Definition: winuser.h:846
HWND hList
Definition: livecd.c:10
static HDC hDC
Definition: 3dtext.c:33
#define WC_COMBOBOXEXA
Definition: commctrl.h:3754
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define FW_DONTCARE
Definition: wingdi.h:367
static BOOL init(void)
Definition: combo.c:494
#define WS_BORDER
Definition: pedump.c:625
#define LBS_NOTIFY
Definition: pedump.c:678
static ATOM item
Definition: dde.c:856
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define CBEM_INSERTITEMW
Definition: commctrl.h:3813
HANDLE WINAPI GetPropA(_In_ HWND, _In_ LPCSTR)
BOOL WINAPI DeleteDC(_In_ HDC)
HINSTANCE hInstance
Definition: winuser.h:3120
#define CB_SETEDITSEL
Definition: winuser.h:1924
GLuint start
Definition: gl.h:1545
#define add_message(msg)
Definition: msg.c:2142
#define ARRAY_SIZE(a)
Definition: main.h:24
static void test_combo_WS_VSCROLL(void)
Definition: combo.c:1123
#define CBS_DROPDOWN
Definition: winuser.h:283
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1753
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define CBEM_GETCOMBOCONTROL
Definition: commctrl.h:3804
static UINT_PTR
Definition: combo.c:49
#define EDITBOX_ID
Definition: combo.c:33
#define expect(expected, got)
Definition: combo.c:36
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HWND_DESKTOP
Definition: winuser.h:1195
#define CBENF_DROPDOWN
Definition: commctrl.h:3862
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1751
#define CBEM_GETITEMA
Definition: commctrl.h:3801
#define WS_VSCROLL
Definition: pedump.c:627
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define CBN_SELCHANGE
Definition: winuser.h:1940
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static char * textBuffer
Definition: combo.c:52
#define WM_SETFONT
Definition: winuser.h:1632
#define WM_DEVICECHANGE
Definition: winuser.h:1787
WNDPROC lpfnWndProc
Definition: winuser.h:3117
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HWND WINAPI GetFocus(void)
Definition: window.c:1875
#define IDC_ARROW
Definition: winuser.h:682
#define GWLP_HINSTANCE
Definition: winuser.h:850
static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: combo.c:103
GLuint res
Definition: glext.h:9613
#define CB_GETITEMHEIGHT
Definition: winuser.h:1912
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 WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
static void test_comboex_get_set_item(void)
Definition: combo.c:565
#define HIWORD(l)
Definition: typedefs.h:246
GLenum GLuint id
Definition: glext.h:5579
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
LONG bottom
Definition: windef.h:294
static void test_combo_changesize(DWORD style)
Definition: combo.c:821
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
static SUBCLASSPROC
Definition: combo.c:49
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
HWND hwnd
Definition: winuser.h:3530
LONG_PTR LRESULT
Definition: windef.h:209
#define X2(f, ord)
static __inline tree_data * first_item(tree *t)
Definition: treefuncs.c:316
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
HBRUSH WINAPI GetSysColorBrush(_In_ int)
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
static LRESULT ComboExTestOnNotify(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:443
struct tagCOMBOBOXINFO COMBOBOXINFO
#define CBEM_SETITEMA
Definition: commctrl.h:3802
START_TEST(combo)
Definition: combo.c:1257
#define CBS_NOINTEGRALHEIGHT
Definition: winuser.h:287
static WNDPROC edit_window_proc
Definition: combo.c:990
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static DWORD_PTR
Definition: combo.c:49
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static unsigned char buff[32768]
Definition: fatten.c:17
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_NOTIFY
Definition: richedit.h:61
static UINT WPARAM wparam
Definition: combo.c:716
static LPCSTR expected_edit_text
Definition: combo.c:717
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
HICON hIcon
Definition: winuser.h:3121