ReactOS  0.4.14-dev-583-g2a1ba2c
combo.c File Reference
#include <limits.h>
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
Include dependency graph for combo.c:

Go to the source code of this file.

Macros

#define EDITBOX_SEQ_INDEX   0
 
#define NUM_MSG_SEQUENCES   1
 
#define EDITBOX_ID   0
 
#define COMBO_ID   1995
 
#define expect(expected, got)   ok(got == expected, "Expected %d, got %d\n", expected, got)
 
#define expect_rect(r, _left, _top, _right, _bottom)
 
#define MAX_CHARS   100
 
#define X(f)   p##f = (void*)GetProcAddress(hComCtl32, #f);
 
#define X2(f, ord)   p##f = (void*)GetProcAddress(hComCtl32, (const char *)ord);
 

Functions

static BOOL (WINAPI *pSetWindowSubclass)(HWND
 
static void get_combobox_info (HWND hwnd, COMBOBOXINFO *info)
 
static HWND createComboEx (DWORD style)
 
static LONG addItem (HWND cbex, int idx, const char *text)
 
static LONG setItem (HWND cbex, int idx, const char *text)
 
static LONG delItem (HWND cbex, int idx)
 
static LONG getItem (HWND cbex, int idx, COMBOBOXEXITEMA *cbItem)
 
static LRESULT WINAPI editbox_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static HWND subclass_editbox (HWND hwndComboEx)
 
static void test_comboex (void)
 
static void test_comboex_WM_LBUTTONDOWN (void)
 
static void test_comboex_CB_GETLBTEXT (void)
 
static void test_comboex_WM_WINDOWPOSCHANGING (void)
 
static LRESULT ComboExTestOnNotify (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK ComboExTestWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void init_functions (void)
 
static BOOL init (void)
 
static void cleanup (void)
 
static void test_comboex_subclass (void)
 
static void test_comboex_get_set_item (void)
 
static HWND create_combobox (DWORD style)
 
static int font_height (HFONT hFont)
 
static void test_combo_setitemheight (DWORD style)
 
static void test_combo_setfont (DWORD style)
 
static LRESULT (CALLBACK *old_parent_proc)(HWND hwnd
 
static LRESULT CALLBACK parent_wnd_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_selection (DWORD style, const char *const text[], const int *edit, const int *list)
 
static void test_combo_CBN_SELCHANGE (void)
 
static void test_combo_changesize (DWORD style)
 
static void test_combo_editselection (void)
 
static LRESULT CALLBACK combobox_subclass_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK test_window_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_combo_editselection_focus (DWORD style)
 
static void test_combo_listbox_styles (DWORD cb_style)
 
static void test_combo_WS_VSCROLL (void)
 
static void test_combo_dropdown_size (DWORD style)
 
 START_TEST (combo)
 

Variables

static struct msg_sequencesequences [NUM_MSG_SEQUENCES]
 
static HWND hComboExParentWnd
 
static HWND hMainWnd
 
static HINSTANCE hMainHinst
 
static const char ComboExTestClass [] = "ComboExTestClass"
 
static SUBCLASSPROC
 
static UINT_PTR
 
static DWORD_PTR
 
static chartextBuffer = NULL
 
static BOOL received_end_edit = FALSE
 
static const struct message test_setitem_edit_seq []
 
static UINT msg
 
static UINT WPARAM wparam
 
static UINT WPARAM LPARAM lparam
 
static LPCSTR expected_edit_text
 
static LPCSTR expected_list_text
 
static BOOL selchange_fired
 
static WNDPROC edit_window_proc
 
static long setsel_start = 1
 
static long setsel_end = 1
 
static HWND hCBN_SetFocus
 
static HWND hCBN_KillFocus
 

Macro Definition Documentation

◆ COMBO_ID

#define COMBO_ID   1995

Definition at line 34 of file combo.c.

◆ EDITBOX_ID

#define EDITBOX_ID   0

Definition at line 33 of file combo.c.

◆ EDITBOX_SEQ_INDEX

#define EDITBOX_SEQ_INDEX   0

Definition at line 30 of file combo.c.

◆ expect

#define expect (   expected,
  got 
)    ok(got == expected, "Expected %d, got %d\n", expected, got)

Definition at line 36 of file combo.c.

◆ expect_rect

#define expect_rect (   r,
  _left,
  _top,
  _right,
  _bottom 
)
Value:
ok(r.left == _left && r.top == _top && \
r.bottom == _bottom && r.right == _right, "Invalid rect %s vs (%d,%d)-(%d,%d)\n", \
wine_dbgstr_rect(&r), _left, _top, _right, _bottom);
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
const char * wine_dbgstr_rect(const RECT *rect)
#define ok(value,...)
Definition: atltest.h:57

Definition at line 38 of file combo.c.

◆ MAX_CHARS

#define MAX_CHARS   100

Definition at line 51 of file combo.c.

◆ NUM_MSG_SEQUENCES

#define NUM_MSG_SEQUENCES   1

Definition at line 31 of file combo.c.

◆ X

#define X (   f)    p##f = (void*)GetProcAddress(hComCtl32, #f);

◆ X2

#define X2 (   f,
  ord 
)    p##f = (void*)GetProcAddress(hComCtl32, (const char *)ord);

Function Documentation

◆ addItem()

static LONG addItem ( HWND  cbex,
int  idx,
const char text 
)
static

Definition at line 70 of file combo.c.

70  {
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 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
#define CBEM_INSERTITEMA
Definition: commctrl.h:3822
#define CBEIF_TEXT
Definition: commctrl.h:3782
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_comboex(), and test_comboex_CB_GETLBTEXT().

◆ BOOL()

static BOOL ( WINAPI pSetWindowSubclass)
static

◆ cleanup()

static void cleanup ( void  )
static

Definition at line 522 of file combo.c.

523 {
524  MSG msg;
525 
527  while (GetMessageA(&msg,0,0,0)) {
530  }
531 
534 
536 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
static HWND hComboExParentWnd
Definition: combo.c:45
static HWND hMainWnd
Definition: combo.c:45
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyWindow(_In_ HWND)
static const char ComboExTestClass[]
Definition: combo.c:47
static UINT msg
Definition: combo.c:716
smooth NULL
Definition: ftsmooth.c:416
#define WM_CLOSE
Definition: winuser.h:1603
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)

Referenced by START_TEST().

◆ combobox_subclass_proc()

static LRESULT CALLBACK combobox_subclass_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 994 of file combo.c.

995 {
996  if (msg == EM_SETSEL)
997  {
999  setsel_end = lParam;
1000  }
1002 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static long setsel_start
Definition: combo.c:991
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT msg
Definition: combo.c:716
static long setsel_end
Definition: combo.c:991
#define EM_SETSEL
Definition: winuser.h:2000
static WNDPROC edit_window_proc
Definition: combo.c:990
LPARAM lParam
Definition: combotst.c:139

Referenced by test_combo_editselection_focus().

◆ ComboExTestOnNotify()

static LRESULT ComboExTestOnNotify ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 443 of file combo.c.

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 }
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
static BOOL received_end_edit
Definition: combo.c:54
#define CBEN_ENDEDITA
Definition: commctrl.h:3871
#define CBEN_ENDEDITW
Definition: commctrl.h:3872
#define CBENF_DROPDOWN
Definition: commctrl.h:3886
LPARAM lParam
Definition: combotst.c:139

Referenced by ComboExTestWndProc().

◆ ComboExTestWndProc()

static LRESULT CALLBACK ComboExTestWndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 467 of file combo.c.

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 }
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
static UINT msg
Definition: combo.c:716
#define WM_DESTROY
Definition: winuser.h:1591
static const WCHAR L[]
Definition: oid.c:1250
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static LRESULT ComboExTestOnNotify(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:443
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by init().

◆ create_combobox()

static HWND create_combobox ( DWORD  style)
static

Definition at line 607 of file combo.c.

608 {
609  return CreateWindowA(WC_COMBOBOXA, "Combo", WS_VISIBLE|WS_CHILD|style, 5, 5, 100, 100, hMainWnd, (HMENU)COMBO_ID, NULL, 0);
610 }
static HWND hMainWnd
Definition: combo.c:45
#define WC_COMBOBOXA
Definition: commctrl.h:4712
#define WS_CHILD
Definition: pedump.c:617
#define COMBO_ID
Definition: combo.c:34
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
smooth NULL
Definition: ftsmooth.c:416
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by test_combo_changesize(), test_combo_editselection(), test_combo_editselection_focus(), test_combo_listbox_styles(), test_combo_setfont(), test_combo_setitemheight(), test_combo_WS_VSCROLL(), and test_selection().

◆ createComboEx()

static HWND createComboEx ( DWORD  style)
static

Definition at line 65 of file combo.c.

65  {
66  return CreateWindowExA(0, WC_COMBOBOXEXA, NULL, style, 0, 0, 300, 300,
68 }
static HWND hComboExParentWnd
Definition: combo.c:45
smooth NULL
Definition: ftsmooth.c:416
static HINSTANCE hMainHinst
Definition: combo.c:46
#define WC_COMBOBOXEXA
Definition: commctrl.h:3778
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)
Arabic default style
Definition: afstyles.h:93

Referenced by test_comboex(), test_comboex_CB_GETLBTEXT(), test_comboex_get_set_item(), test_comboex_subclass(), and test_comboex_WM_WINDOWPOSCHANGING().

◆ delItem()

static LONG delItem ( HWND  cbex,
int  idx 
)
static

Definition at line 90 of file combo.c.

90  {
91  return SendMessageA(cbex, CBEM_DELETEITEM, idx, 0);
92 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int idx
Definition: utils.c:41
#define CBEM_DELETEITEM
Definition: commctrl.h:3827

Referenced by test_comboex().

◆ editbox_subclass_proc()

static LRESULT WINAPI editbox_subclass_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 103 of file combo.c.

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
#define WM_GETTEXT
Definition: winuser.h:1600
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define WM_NCHITTEST
Definition: winuser.h:1668
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT msg
Definition: combo.c:716
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define GWLP_USERDATA
Definition: treelist.c:63
#define GetWindowLongPtrA
Definition: winuser.h:4803
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: combo.c:43
#define WM_PAINT
Definition: winuser.h:1602
#define EDITBOX_SEQ_INDEX
Definition: combo.c:30
int ret
Definition: msg.h:34
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define add_message(msg)
Definition: msg.c:2113
#define EDITBOX_ID
Definition: combo.c:33
#define WM_DEVICECHANGE
Definition: winuser.h:1793
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by subclass_editbox().

◆ font_height()

static int font_height ( HFONT  hFont)
static

Definition at line 612 of file combo.c.

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 }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HFONT hFont
Definition: main.c:53
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
Definition: time.h:76
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)

Referenced by GdipGetFontHeight(), get_font_hfont(), OleCreatePropertyFrameIndirect(), test_combo_setfont(), test_combo_setitemheight(), test_font_height_scaling(), test_GetConsoleFontSize(), and test_GetTextMetrics2().

◆ get_combobox_info()

static void get_combobox_info ( HWND  hwnd,
COMBOBOXINFO info 
)
static

Definition at line 56 of file combo.c.

57 {
58  BOOL ret;
59 
60  info->cbSize = sizeof(*info);
62  ok(ret, "Failed to get combobox info structure, error %d\n", GetLastError());
63 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI GetComboBoxInfo(HWND hwndCombo, PCOMBOBOXINFO pcbi)
Definition: combo.c:2313
int ret
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_combo_editselection(), test_combo_editselection_focus(), test_combo_listbox_styles(), test_combo_WS_VSCROLL(), and test_comboex_WM_LBUTTONDOWN().

◆ getItem()

static LONG getItem ( HWND  cbex,
int  idx,
COMBOBOXEXITEMA cbItem 
)
static

Definition at line 94 of file combo.c.

94  {
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 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CBEIF_TEXT
Definition: commctrl.h:3782
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
#define CBEM_GETITEMA
Definition: commctrl.h:3825
static char * textBuffer
Definition: combo.c:52
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_comboex().

◆ init()

static BOOL init ( void  )
static

Definition at line 494 of file combo.c.

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 }
#define WC_STATICA
Definition: commctrl.h:4675
static HWND hComboExParentWnd
Definition: combo.c:45
static HWND hMainWnd
Definition: combo.c:45
int cbClsExtra
Definition: winuser.h:3140
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3146
HBRUSH hbrBackground
Definition: winuser.h:3145
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define COLOR_WINDOW
Definition: winuser.h:908
static const char ComboExTestClass[]
Definition: combo.c:47
int cbWndExtra
Definition: winuser.h:3141
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
HCURSOR hCursor
Definition: winuser.h:3144
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define SW_SHOW
Definition: winuser.h:769
#define CS_VREDRAW
Definition: winuser.h:653
static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:467
static HINSTANCE hMainHinst
Definition: combo.c:46
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LPCSTR lpszClassName
Definition: winuser.h:3147
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3138
HINSTANCE hInstance
Definition: winuser.h:3142
#define ok(value,...)
Definition: atltest.h:57
WNDPROC lpfnWndProc
Definition: winuser.h:3139
#define IDC_ARROW
Definition: winuser.h:682
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
#define WS_VISIBLE
Definition: pedump.c:620
HBRUSH WINAPI GetSysColorBrush(_In_ int)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3143

Referenced by START_TEST().

◆ init_functions()

static void init_functions ( void  )
static

Definition at line 483 of file combo.c.

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 }
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1261
#define X2(f, ord)

Referenced by START_TEST().

◆ LRESULT()

static LRESULT ( CALLBACK old_parent_proc)
static

◆ parent_wnd_proc()

static LRESULT CALLBACK parent_wnd_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 721 of file combo.c.

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
#define CB_GETLBTEXT
Definition: winuser.h:1934
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_GETTEXT
Definition: winuser.h:1600
HANDLE HWND
Definition: compat.h:13
#define COMBO_ID
Definition: combo.c:34
#define CB_GETCURSEL
Definition: winuser.h:1925
static LPCSTR expected_list_text
Definition: combo.c:718
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT msg
Definition: combo.c:716
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
static BOOL selchange_fired
Definition: combo.c:719
Definition: _list.h:228
#define WM_COMMAND
Definition: winuser.h:1722
#define ok(value,...)
Definition: atltest.h:57
#define CBN_SELCHANGE
Definition: winuser.h:1961
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define memset(x, y, z)
Definition: compat.h:39
static UINT WPARAM wparam
Definition: combo.c:716
static LPCSTR expected_edit_text
Definition: combo.c:717

Referenced by test_selection().

◆ setItem()

static LONG setItem ( HWND  cbex,
int  idx,
const char text 
)
static

Definition at line 80 of file combo.c.

80  {
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 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
#define CBEIF_TEXT
Definition: commctrl.h:3782
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
#define memset(x, y, z)
Definition: compat.h:39
#define CBEM_SETITEMA
Definition: commctrl.h:3826

Referenced by test_comboex().

◆ START_TEST()

START_TEST ( combo  )

Definition at line 1257 of file combo.c.

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 }
static void test_comboex_CB_GETLBTEXT(void)
Definition: combo.c:361
static void test_combo_listbox_styles(DWORD cb_style)
Definition: combo.c:1079
static void test_comboex_subclass(void)
Definition: combo.c:538
static void test_comboex_WM_LBUTTONDOWN(void)
Definition: combo.c:250
static void test_comboex_WM_WINDOWPOSCHANGING(void)
Definition: combo.c:396
static void test_comboex(void)
Definition: combo.c:147
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
static void test_combo_setitemheight(DWORD style)
Definition: combo.c:627
uint32_t ULONG_PTR
Definition: typedefs.h:63
static void test_combo_editselection_focus(DWORD style)
Definition: combo.c:1026
static void cleanup(void)
Definition: combo.c:522
static void init_functions(void)
Definition: combo.c:483
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
#define CBS_SIMPLE
Definition: winuser.h:291
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
#define NUM_MSG_SEQUENCES
Definition: combo.c:31
static void test_combo_editselection(void)
Definition: combo.c:899
static void test_combo_CBN_SELCHANGE(void)
Definition: combo.c:810
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: combo.c:43
static void test_combo_setfont(DWORD style)
Definition: combo.c:649
static void test_combo_dropdown_size(DWORD style)
Definition: combo.c:1154
static BOOL init(void)
Definition: combo.c:494
static void test_combo_WS_VSCROLL(void)
Definition: combo.c:1123
#define CBS_DROPDOWN
Definition: winuser.h:283
static void test_comboex_get_set_item(void)
Definition: combo.c:565
static void test_combo_changesize(DWORD style)
Definition: combo.c:821
#define CBS_NOINTEGRALHEIGHT
Definition: winuser.h:287

◆ subclass_editbox()

static HWND subclass_editbox ( HWND  hwndComboEx)
static

Definition at line 134 of file combo.c.

135 {
136  WNDPROC oldproc;
137  HWND hwnd;
138 
139  hwnd = (HWND)SendMessageA(hwndComboEx, CBEM_GETEDITCONTROL, 0, 0);
143 
144  return hwnd;
145 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE HWND
Definition: compat.h:13
#define GWLP_USERDATA
Definition: treelist.c:63
#define CBEM_GETEDITCONTROL
Definition: commctrl.h:3829
#define SetWindowLongPtrA
Definition: winuser.h:5320
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: combo.c:103

Referenced by test_comboex_get_set_item().

◆ test_combo_CBN_SELCHANGE()

static void test_combo_CBN_SELCHANGE ( void  )
static

Definition at line 810 of file combo.c.

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 }
static void test_selection(DWORD style, const char *const text[], const int *edit, const int *list)
Definition: combo.c:756
const WCHAR * text
Definition: package.c:1827
#define CBS_SIMPLE
Definition: winuser.h:291
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
#define CBS_DROPDOWN
Definition: winuser.h:283

Referenced by START_TEST().

◆ test_combo_changesize()

static void test_combo_changesize ( DWORD  style)
static

Definition at line 821 of file combo.c.

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 }
#define TRUE
Definition: types.h:120
static HWND create_combobox(DWORD style)
Definition: combo.c:607
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1944
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
#define CB_GETDROPPEDWIDTH
Definition: winuser.h:1928
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1926
#define todo_wine
Definition: test.h:163
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ok(value,...)
Definition: atltest.h:57
LONG bottom
Definition: windef.h:309
Arabic default style
Definition: afstyles.h:93

Referenced by START_TEST().

◆ test_combo_dropdown_size()

static void test_combo_dropdown_size ( DWORD  style)
static

Definition at line 1154 of file combo.c.

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 }
Definition: main.c:44
#define TRUE
Definition: types.h:120
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1927
static HWND hMainWnd
Definition: combo.c:45
#define WC_COMBOBOXA
Definition: commctrl.h:4712
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG top
Definition: windef.h:307
#define test
Definition: rosglue.h:37
#define WS_CHILD
Definition: pedump.c:617
#define COMBO_ID
Definition: combo.c:34
BOOL WINAPI DestroyWindow(_In_ HWND)
GLint limit
Definition: glext.h:10326
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 CB_SHOWDROPDOWN
Definition: winuser.h:1952
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
#define CB_ADDSTRING
Definition: winuser.h:1918
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1923
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_SETMINVISIBLE
Definition: commctrl.h:4717
int ret
#define CB_GETMINVISIBLE
Definition: commctrl.h:4718
#define LB_GETITEMHEIGHT
Definition: winuser.h:2024
HWND hList
Definition: livecd.c:10
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ARRAY_SIZE(a)
Definition: main.h:24
#define CBS_DROPDOWN
Definition: winuser.h:283
#define ok(value,...)
Definition: atltest.h:57
#define min(a, b)
Definition: monoChain.cc:55
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
struct tagCOMBOBOXINFO COMBOBOXINFO
#define CBS_NOINTEGRALHEIGHT
Definition: winuser.h:287
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by START_TEST().

◆ test_combo_editselection()

static void test_combo_editselection ( void  )
static

Definition at line 899 of file combo.c.

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 }
static HWND create_combobox(DWORD style)
Definition: combo.c:607
#define WM_CHAR
Definition: winuser.h:1699
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_GETTEXT
Definition: winuser.h:1600
UINT_PTR WPARAM
Definition: windef.h:207
GLuint GLuint end
Definition: gl.h:1545
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
#define CB_GETEDITSEL
Definition: winuser.h:1929
static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
Definition: combo.c:56
#define CBS_SIMPLE
Definition: winuser.h:291
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
static HWND hEdit
Definition: autocomplete.c:34
#define CB_SETEDITSEL
Definition: winuser.h:1945
GLuint start
Definition: gl.h:1545
#define ok(value,...)
Definition: atltest.h:57
#define HIWORD(l)
Definition: typedefs.h:246
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define WM_SETFOCUS
Definition: winuser.h:1595
#define LOWORD(l)
Definition: pedump.c:82

Referenced by START_TEST().

◆ test_combo_editselection_focus()

static void test_combo_editselection_focus ( DWORD  style)
static

Definition at line 1026 of file combo.c.

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 }
Definition: main.c:44
#define TRUE
Definition: types.h:120
static HWND hMainWnd
Definition: combo.c:45
static HWND create_combobox(DWORD style)
Definition: combo.c:607
static HWND hCBN_SetFocus
Definition: combo.c:992
#define INT_MAX
Definition: limits.h:40
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_GETTEXT
Definition: winuser.h:1600
static long setsel_start
Definition: combo.c:991
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
GLuint buffer
Definition: glext.h:5915
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define CB_GETEDITSEL
Definition: winuser.h:1929
static LRESULT CALLBACK test_window_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:1004
static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
Definition: combo.c:56
static HWND hCBN_KillFocus
Definition: combo.c:992
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
smooth NULL
Definition: ftsmooth.c:416
#define WC_BUTTONA
Definition: commctrl.h:4618
LONG_PTR LPARAM
Definition: windef.h:208
static long setsel_end
Definition: combo.c:991
#define WM_SETTEXT
Definition: winuser.h:1599
#define GetWindowLongPtrA
Definition: winuser.h:4803
unsigned long DWORD
Definition: ntddk_ex.h:95
#define todo_wine
Definition: test.h:163
GLenum GLsizei len
Definition: glext.h:6722
#define SetWindowLongPtrA
Definition: winuser.h:5320
static HWND hEdit
Definition: autocomplete.c:34
static LRESULT CALLBACK combobox_subclass_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: combo.c:994
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define ok(value,...)
Definition: atltest.h:57
HWND WINAPI GetFocus(void)
Definition: window.c:1905
#define GWLP_HINSTANCE
Definition: winuser.h:850
#define HIWORD(l)
Definition: typedefs.h:246
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define WM_SETFOCUS
Definition: winuser.h:1595
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
static WNDPROC edit_window_proc
Definition: combo.c:990
#define LOWORD(l)
Definition: pedump.c:82

Referenced by START_TEST().

◆ test_combo_listbox_styles()

static void test_combo_listbox_styles ( DWORD  cb_style)
static

Definition at line 1079 of file combo.c.

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 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define TRUE
Definition: types.h:120
static HWND create_combobox(DWORD style)
Definition: combo.c:607
#define LBS_HASSTRINGS
Definition: pedump.c:684
#define GWL_EXSTYLE
Definition: winuser.h:845
#define LBS_COMBOBOX
Definition: winuser.h:324
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
struct _test_info info[]
Definition: SetCursorPos.c:19
static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
Definition: combo.c:56
#define CB_SHOWDROPDOWN
Definition: winuser.h:1952
#define CBS_SIMPLE
Definition: winuser.h:291
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define expect_style(window, style)
#define GWL_STYLE
Definition: winuser.h:846
#define WS_BORDER
Definition: pedump.c:625
#define LBS_NOTIFY
Definition: pedump.c:678
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by START_TEST().

◆ test_combo_setfont()

static void test_combo_setfont ( DWORD  style)
static

Definition at line 649 of file combo.c.

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 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static HWND hMainWnd
Definition: combo.c:45
static HWND create_combobox(DWORD style)
Definition: combo.c:607
#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 FF_DONTCARE
Definition: wingdi.h:447
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define SYMBOL_CHARSET
Definition: wingdi.h:384
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI DestroyWindow(_In_ HWND)
HFONT hFont
Definition: main.c:53
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 CLIP_DEFAULT_PRECIS
Definition: wingdi.h:425
#define SYSTEM_FONT
Definition: wingdi.h:910
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1926
#define DEFAULT_PITCH
Definition: wingdi.h:442
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:414
#define todo_wine
Definition: test.h:163
static int font_height(HFONT hFont)
Definition: combo.c:612
#define expect_rect(r, _left, _top, _right, _bottom)
Definition: combo.c:38
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
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)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define FW_DONTCARE
Definition: wingdi.h:367
#define ok(value,...)
Definition: atltest.h:57
#define HWND_DESKTOP
Definition: winuser.h:1195
#define WM_SETFONT
Definition: winuser.h:1632
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Arabic default style
Definition: afstyles.h:93

Referenced by START_TEST().

◆ test_combo_setitemheight()

static void test_combo_setitemheight ( DWORD  style)
static

Definition at line 627 of file combo.c.

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 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static HWND hMainWnd
Definition: combo.c:45
static HWND create_combobox(DWORD style)
Definition: combo.c:607
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CB_SETITEMHEIGHT
Definition: winuser.h:1949
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 SYSTEM_FONT
Definition: wingdi.h:910
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1926
#define todo_wine
Definition: test.h:163
static int font_height(HFONT hFont)
Definition: combo.c:612
#define expect_rect(r, _left, _top, _right, _bottom)
Definition: combo.c:38
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ok(value,...)
Definition: atltest.h:57
#define HWND_DESKTOP
Definition: winuser.h:1195
Arabic default style
Definition: afstyles.h:93

Referenced by START_TEST().

◆ test_combo_WS_VSCROLL()

static void test_combo_WS_VSCROLL ( void  )
static

Definition at line 1123 of file combo.c.

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 }
#define TRUE
Definition: types.h:120
static HWND create_combobox(DWORD style)
Definition: combo.c:607
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLuint buffer
Definition: glext.h:5915
BOOL WINAPI DestroyWindow(_In_ HWND)
struct _test_info info[]
Definition: SetCursorPos.c:19
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
Definition: combo.c:56
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
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define CB_SHOWDROPDOWN
Definition: winuser.h:1952
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG_PTR LPARAM
Definition: windef.h:208
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GWL_STYLE
Definition: winuser.h:846
HWND hList
Definition: livecd.c:10
#define ok(value,...)
Definition: atltest.h:57
#define WS_VSCROLL
Definition: pedump.c:627
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
Arabic default style
Definition: afstyles.h:93

Referenced by START_TEST().

◆ test_comboex()

static void test_comboex ( void  )
static

Definition at line 147 of file combo.c.

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 }
#define MAX_CHARS
Definition: combo.c:51
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static LONG setItem(HWND cbex, int idx, const char *text)
Definition: combo.c:80
long LONG
Definition: pedump.c:60
static LONG addItem(HWND cbex, int idx, const char *text)
Definition: combo.c:70
static LONG delItem(HWND cbex, int idx)
Definition: combo.c:90
#define CB_ERR
Definition: winuser.h:2410
static HWND createComboEx(DWORD style)
Definition: combo.c:65
static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEMA *cbItem)
Definition: combo.c:94
#define WS_BORDER
Definition: pedump.c:625
#define CBS_DROPDOWN
Definition: winuser.h:283
#define ok(value,...)
Definition: atltest.h:57
static char * textBuffer
Definition: combo.c:52
GLuint res
Definition: glext.h:9613
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static __inline tree_data * first_item(tree *t)
Definition: treefuncs.c:316
#define WS_VISIBLE
Definition: pedump.c:620
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by START_TEST().

◆ test_comboex_CB_GETLBTEXT()

static void test_comboex_CB_GETLBTEXT ( void  )
static

Definition at line 361 of file combo.c.

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 }
#define CB_GETLBTEXTLEN
Definition: winuser.h:1935
#define CB_GETLBTEXT
Definition: winuser.h:1934
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
char CHAR
Definition: xmlstorage.h:175
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CBEIF_TEXT
Definition: commctrl.h:3782
static LONG addItem(HWND cbex, int idx, const char *text)
Definition: combo.c:70
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static HWND createComboEx(DWORD style)
Definition: combo.c:65
int ret
#define WS_BORDER
Definition: pedump.c:625
static ATOM item
Definition: dde.c:856
#define CBS_DROPDOWN
Definition: winuser.h:283
#define ok(value,...)
Definition: atltest.h:57
#define CBEM_GETITEMA
Definition: commctrl.h:3825
LONG_PTR LRESULT
Definition: windef.h:209
#define WS_VISIBLE
Definition: pedump.c:620
static unsigned char buff[32768]
Definition: fatten.c:17

Referenced by START_TEST().

◆ test_comboex_get_set_item()

static void test_comboex_get_set_item ( void  )
static

Definition at line 565 of file combo.c.

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 }
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const struct message test_setitem_edit_seq[]
Definition: combo.c:558
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CBEIF_TEXT
Definition: commctrl.h:3782
LONG_PTR LPARAM
Definition: windef.h:208
#define NUM_MSG_SEQUENCES
Definition: combo.c:31
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: combo.c:43
#define CBEIF_LPARAM
Definition: commctrl.h:3787
static const char textA[]
Definition: registrar.c:40
static HWND createComboEx(DWORD style)
Definition: combo.c:65
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
#define EDITBOX_SEQ_INDEX
Definition: combo.c:30
int ret
static HWND subclass_editbox(HWND hwndComboEx)
Definition: combo.c:134
#define WS_BORDER
Definition: pedump.c:625
static ATOM item
Definition: dde.c:856
#define CBS_DROPDOWN
Definition: winuser.h:283
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define expect(expected, got)
Definition: combo.c:36
#define CBEM_GETITEMA
Definition: commctrl.h:3825
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
#define CBEM_SETITEMA
Definition: commctrl.h:3826

Referenced by START_TEST().

◆ test_comboex_subclass()

static void test_comboex_subclass ( void  )
static

Definition at line 538 of file combo.c.

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 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE HWND
Definition: compat.h:13
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
smooth NULL
Definition: ftsmooth.c:416
#define CBEM_GETEDITCONTROL
Definition: commctrl.h:3829
static HWND createComboEx(DWORD style)
Definition: combo.c:65
static HWND hEdit
Definition: autocomplete.c:34
#define WS_BORDER
Definition: pedump.c:625
HANDLE WINAPI GetPropA(_In_ HWND, _In_ LPCSTR)
#define CBS_DROPDOWN
Definition: winuser.h:283
#define ok(value,...)
Definition: atltest.h:57
#define CBEM_GETCOMBOCONTROL
Definition: commctrl.h:3828
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by START_TEST().

◆ test_comboex_WM_LBUTTONDOWN()

static void test_comboex_WM_LBUTTONDOWN ( void  )
static

Definition at line 250 of file combo.c.

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 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define CB_GETTOPINDEX
Definition: winuser.h:1937
static HWND hComboExParentWnd
Definition: combo.c:45
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1927
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
static BOOL received_end_edit
Definition: combo.c:54
LONG top
Definition: windef.h:307
HANDLE HWND
Definition: compat.h:13
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLuint buffer
Definition: glext.h:5915
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WS_CHILD
Definition: pedump.c:617
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CB_GETCURSEL
Definition: winuser.h:1925
& rect
Definition: startmenu.cpp:1413
static void get_combobox_info(HWND hwnd, COMBOBOXINFO *info)
Definition: combo.c:56
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 CBEIF_TEXT
Definition: commctrl.h:3782
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CBEM_GETEDITCONTROL
Definition: commctrl.h:3829
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR stringFormat[]
Definition: wordpad.c:54
#define todo_wine
Definition: test.h:163
static HINSTANCE hMainHinst
Definition: combo.c:46
static HWND hEdit
Definition: autocomplete.c:34
#define broken(x)
Definition: _sntprintf.h:21
HWND hList
Definition: livecd.c:10
#define WC_COMBOBOXEXA
Definition: commctrl.h:3778
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CBEM_INSERTITEMW
Definition: commctrl.h:3837
#define ARRAY_SIZE(a)
Definition: main.h:24
#define CBS_DROPDOWN
Definition: winuser.h:283
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define CBEM_GETCOMBOCONTROL
Definition: commctrl.h:3828
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1757
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
HWND WINAPI GetFocus(void)
Definition: window.c:1905
#define CB_GETITEMHEIGHT
Definition: winuser.h:1933
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)
LONG bottom
Definition: windef.h:309
LONG_PTR LRESULT
Definition: windef.h:209
#define WS_VISIBLE
Definition: pedump.c:620
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_comboex_WM_WINDOWPOSCHANGING()

static void test_comboex_WM_WINDOWPOSCHANGING ( void  )
static

Definition at line 396 of file combo.c.

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 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndInsertAfter
Definition: winuser.h:3564
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3569
static HWND createComboEx(DWORD style)
Definition: combo.c:65
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
int ret
#define WS_BORDER
Definition: pedump.c:625
#define CBS_DROPDOWN
Definition: winuser.h:283
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
HWND hwnd
Definition: winuser.h:3563
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by START_TEST().

◆ test_selection()

static void test_selection ( DWORD  style,
const char *const  text[],
const int edit,
const int list 
)
static

Definition at line 756 of file combo.c.

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 }
static HWND hMainWnd
Definition: combo.c:45
static HWND create_combobox(DWORD style)
Definition: combo.c:607
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
#define VK_DOWN
Definition: winuser.h:2202
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1925
static LPCSTR expected_list_text
Definition: combo.c:718
static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: combo.c:721
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define VK_UP
Definition: winuser.h:2200
unsigned int idx
Definition: utils.c:41
#define CB_ADDSTRING
Definition: winuser.h:1918
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
static BOOL selchange_fired
Definition: combo.c:719
#define SetWindowLongPtrA
Definition: winuser.h:5320
Definition: _list.h:228
#define CB_SETCURSEL
Definition: winuser.h:1943
#define GWLP_WNDPROC
Definition: treelist.c:66
#define ok(value,...)
Definition: atltest.h:57
Arabic default style
Definition: afstyles.h:93
static LPCSTR expected_edit_text
Definition: combo.c:717

Referenced by test_combo_CBN_SELCHANGE().

◆ test_window_proc()

static LRESULT CALLBACK test_window_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1004 of file combo.c.

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 }
#define CBN_SETFOCUS
Definition: winuser.h:1964
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HWND hCBN_SetFocus
Definition: combo.c:992
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
HANDLE HWND
Definition: compat.h:13
HWND WINAPI SetFocus(_In_opt_ HWND)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HWND hCBN_KillFocus
Definition: combo.c:992
static UINT msg
Definition: combo.c:716
#define CBN_KILLFOCUS
Definition: winuser.h:1960
#define WM_COMMAND
Definition: winuser.h:1722
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139

Referenced by test_combo_editselection_focus().

Variable Documentation

◆ ComboExTestClass

const char ComboExTestClass[] = "ComboExTestClass"
static

Definition at line 47 of file combo.c.

Referenced by cleanup(), and init().

◆ DWORD_PTR

Definition at line 49 of file combo.c.

◆ edit_window_proc

WNDPROC edit_window_proc
static

Definition at line 990 of file combo.c.

Referenced by combobox_subclass_proc(), and test_combo_editselection_focus().

◆ expected_edit_text

LPCSTR expected_edit_text
static

Definition at line 717 of file combo.c.

Referenced by parent_wnd_proc(), and test_selection().

◆ expected_list_text

LPCSTR expected_list_text
static

Definition at line 718 of file combo.c.

Referenced by parent_wnd_proc(), and test_selection().

◆ hCBN_KillFocus

HWND hCBN_KillFocus
static

Definition at line 992 of file combo.c.

Referenced by test_combo_editselection_focus(), and test_window_proc().

◆ hCBN_SetFocus

HWND hCBN_SetFocus
static

Definition at line 992 of file combo.c.

Referenced by test_combo_editselection_focus(), and test_window_proc().

◆ hComboExParentWnd

HWND hComboExParentWnd
static

Definition at line 45 of file combo.c.

Referenced by cleanup(), createComboEx(), init(), and test_comboex_WM_LBUTTONDOWN().

◆ hMainHinst

HINSTANCE hMainHinst
static

Definition at line 46 of file combo.c.

Referenced by createComboEx(), init(), and test_comboex_WM_LBUTTONDOWN().

◆ hMainWnd

◆ lparam

UINT WPARAM LPARAM lparam

Definition at line 716 of file combo.c.

Referenced by ToolTip::add(), button_hook_proc(), button_subclass_proc(), callwndproc_proc(), CBTProc(), cd_wndproc(), child_proc(), ChildWndProc(), clipbrd_wndproc(), CommonPropertySheetUIA(), CommonPropertySheetUIW(), connections_dlgproc(), connections_on_notify(), content_dlgproc(), DesktopBar::ControlResize(), cowait_window_proc(), ctrl_container_wndproc(), CtxMenu_HandleMenuMsg(), datetime_subclass_proc(), dde_msg_client_wndproc(), dde_server_wndproc(), dde_server_wndprocA(), dde_server_wndprocW(), DECLARE_INTERFACE_(), def_window_procA(), def_window_procW(), DestinationDlgProc(), destroy_dialog_owner_proc(), device_process_message(), Window::DialogProc(), PropSheetPageDlg::DialogProc(), dinput_mouse_hook(), dlgproc_addport(), dlgproc_lptconfig(), drop_window_proc(), dropdown_subclass_proc(), edit_dialog_proc(), edit_singleline_dialog_proc(), edit_subclass_proc(), edit_wantreturn_dialog_proc(), editbox_subclass_proc(), empty_dlg_proc2(), enum_all_fonts_proc(), enum_fonts_proc(), File::enum_lines(), enum_locale_ex_proc(), enum_with_magic_retval_proc(), EnumResourceLanguagesA(), EnumResourceLanguagesW(), EnumResourceNamesA(), EnumResourceNamesW(), EnumResourceTypesA(), EnumResourceTypesW(), EnumSystemLocalesEx(), TaskBar::EnumWndProc(), EnumWndProc(), FilterDialogDlgProc(), find_window_callback(), fnTextSrv_TxSendMessage(), font_enum_proc(), FrameWndProc(), general_dlgproc(), general_on_notify(), get_available_monitors_proc(), GetWindowModulePathCopyData(), handle_internal_message(), CtxMenuInterfaces::HandleMenuMsg(), header_subclass_proc(), hook_dde_client_wndprocA(), hook_dde_client_wndprocW(), hyperlink_dlgproc(), ICInstall(), icm_choose_compressor_dlgproc(), ie_dialog_open_proc(), ie_window_proc(), iewnd_OnCommand(), iewnd_OnNotify(), imm_wnd_proc(), init_test_message(), itemdlg_dlgproc(), KeyboardCallback(), FindProgramDlg::LaunchSelected(), LCMapStringEx(), linedda_callback(), listbox_wnd_proc(), listview_subclass_proc(), LL_hook_proc(), long_enum_proc(), main_window_proc(), main_window_procA(), main_window_procW(), mdi_child_wnd_proc_1(), mdi_child_wnd_proc_2(), mdi_main_wnd_procA(), Window::MDICBTHookProc(), menu_cancelmode_wnd_proc(), menu_check_wnd_proc(), menu_fill_in_init(), menu_ownerdraw_wnd_proc(), menu_track_again_wnd_proc(), MinimizeDesktopEnumFct(), NotifyHook::ModulePathCopyData(), monitor_enum_proc(), monthcal_subclass_proc(), mstsc_mousewheel(), mstsc_WndProc(), multi_edit_dialog_proc(), nav_page_proc(), nccalcsize_proc(), MainFrameBase::Notify(), NotifyHookProc(), notifysink_on_tvn_dropdown(), notifysink_on_wm_notify(), notifysink_proc(), on_command_filetype(), on_command_opendropdown(), on_wm_command(), on_wm_getminmaxinfo(), page_dlg_proc(), pager_subclass_proc(), pagesetup_margin_editproc(), parent_dlg_proc(), parent_wnd_proc(), parentdc_window_procA(), post_quit_dialog_owner_proc(), Window::PostParent(), proc_window(), MainFrameBase::ProcessMessage(), prompt_dlgproc(), PropertiesDialogDlgProc(), property_sheet_proc(), propsheet_callback(), Window::PropSheetCBTHookProc(), radiobuttonlist_on_wm_command(), radiobuttonlist_proc(), redraw_window_procA(), reparent_dialog_owner_proc(), reparent_dlg_proc(), reparent_owned_dlg_proc(), run_test(), run_test_(), save_message(), ScreenSaverProc(), scroll_init_proc(), security_dlgproc(), security_on_notify(), Window::SendParent(), sheet_callback(), SIC_CompareEntries(), smresult_wndproc(), StyleCheckProc(), subclass_proc(), SubclassedWindow::SubclassedWndProc(), subpopuplocked_wnd_proc(), SwitchDesktopEnumFct(), syslink_subclass_proc(), tab_subclass_proc(), taskdialog_notify(), test_aw_conversion_dlgproc3(), test_aw_conversion_dlgprocA(), test_aw_conversion_dlgprocW(), test_aw_conversion_wndproc(), test_control_procA(), test_customize_dlgproc(), test_getset_item(), test_msg_client(), test_PackDDElParam(), test_parent_wndproc(), test_TCS_OWNERDRAWFIXED(), test_thick_child_size_winproc(), test_window_proc(), testwindow_wndproc(), tool_window_procA(), trackbar_subclass_proc(), TreeviewWndProc(), TreeWndProc(), unpack_dde_message(), update_addrbar(), updown_subclass_proc(), userselect_dlgproc(), warning_proc(), window_proc(), Window::WindowWndProc(), wined3d_wndproc(), winproc(), winproc_convA(), winproc_convW(), BackgroundWindow::WndProc(), WndProc(), QuickLaunchBar::WndProc(), MainFrameBase::WndProc(), DesktopWindow::WndProc(), TaskBar::WndProc(), FileChildWindow::WndProc(), FindProgramDlg::WndProc(), StartMenuButton::WndProc(), DesktopBar::WndProc(), Pane::WndProc(), Window::WndProc(), MDIMainFrame::WndProc(), ExecuteDialog::WndProc(), StartButton::WndProc(), NotifyArea::WndProc(), SDIMainFrame::WndProc(), DesktopShellView::WndProc(), SubclassedWindow::WndProc(), ShellBrowserChildT< MainFrameBase >::WndProc(), StartMenu::WndProc(), TrayNotifyDlg::WndProc(), ClockWindow::WndProc(), MDIShellBrowserChild::WndProc(), ChildWindow::WndProc(), IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc(), StartMenuRoot::WndProc(), ResizeController< Dialog >::WndProc(), CtlColorParent< OwnerDrawParent< Dialog > >::WndProc(), OwnerDrawParent< Dialog >::WndProc(), OwnerdrawnButton::WndProc(), FlatButton::WndProc(), ColorStatic::WndProc(), HyperlinkCtrl::WndProc(), ExplorerAboutDlg::WndProc(), WebChildWindow::WndProc(), TrayIconControllerTemplate< BASE >::WndProc(), EditController::WndProc(), ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::WndProc(), and ws2_test_WndProc().

◆ msg

◆ received_end_edit

BOOL received_end_edit = FALSE
static

Definition at line 54 of file combo.c.

Referenced by ComboExTestOnNotify(), and test_comboex_WM_LBUTTONDOWN().

◆ selchange_fired

BOOL selchange_fired
static

Definition at line 719 of file combo.c.

Referenced by parent_wnd_proc(), and test_selection().

◆ sequences

Definition at line 43 of file combo.c.

Referenced by editbox_subclass_proc(), START_TEST(), and test_comboex_get_set_item().

◆ setsel_end

long setsel_end = 1
static

Definition at line 991 of file combo.c.

Referenced by combobox_subclass_proc(), and test_combo_editselection_focus().

◆ setsel_start

long setsel_start = 1
static

Definition at line 991 of file combo.c.

Referenced by combobox_subclass_proc(), and test_combo_editselection_focus().

◆ SUBCLASSPROC

SUBCLASSPROC

Definition at line 49 of file combo.c.

◆ test_setitem_edit_seq

const struct message test_setitem_edit_seq[]
static
Initial value:
= {
{ 0 }
}
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_SETTEXT
Definition: winuser.h:1599
#define EM_SETSEL
Definition: winuser.h:2000
Definition: msg.h:34
#define EDITBOX_ID
Definition: combo.c:33
GLenum GLuint id
Definition: glext.h:5579
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 558 of file combo.c.

Referenced by test_comboex_get_set_item().

◆ textBuffer

char* textBuffer = NULL
static

Definition at line 52 of file combo.c.

Referenced by CDockSite::Exec(), getItem(), CDockSite::Initialize(), and test_comboex().

◆ UINT_PTR

Definition at line 49 of file combo.c.

◆ wparam

UINT WPARAM wparam

Definition at line 716 of file combo.c.

Referenced by AboutProc(), button_hook_proc(), button_subclass_proc(), callwndproc_proc(), CBTProc(), cd_wndproc(), child_proc(), ChildWndProc(), clipbrd_wndproc(), connections_dlgproc(), connections_on_command(), content_dlgproc(), DesktopBar::ControlResize(), cowait_window_proc(), ctrl_container_wndproc(), CtxMenu_HandleMenuMsg(), d3drm_device_win_HandleActivate(), datetime_subclass_proc(), dde_msg_client_wndproc(), dde_server_wndproc(), dde_server_wndprocA(), dde_server_wndprocW(), DECLARE_INTERFACE_(), def_window_procA(), def_window_procW(), delhist_dlgproc(), delhist_on_command(), DestinationDlgProc(), destroy_dialog_owner_proc(), device_process_message(), Window::DialogProc(), PropSheetPageDlg::DialogProc(), dinput_mouse_hook(), dlgproc_addport(), dlgproc_lptconfig(), drop_window_proc(), dropdown_subclass_proc(), edit_dialog_proc(), edit_singleline_dialog_proc(), edit_subclass_proc(), edit_wantreturn_dialog_proc(), editbox_subclass_proc(), FilterDialogDlgProc(), fnTextSrv_TxSendMessage(), FrameWndProc(), general_dlgproc(), general_on_command(), general_on_notify(), handle_internal_message(), CtxMenuInterfaces::HandleMenuMsg(), header_subclass_proc(), hook_dde_client_wndprocA(), hook_dde_client_wndprocW(), hyperlink_dlgproc(), icm_choose_compressor_dlgproc(), ie_dialog_open_proc(), ie_window_proc(), iewnd_OnCommand(), imm_wnd_proc(), init_test_message(), itemdlg_dlgproc(), KeyboardCallback(), listbox_wnd_proc(), listview_subclass_proc(), LL_hook_proc(), main_window_proc(), main_window_procA(), main_window_procW(), map_wparam_AtoW(), mdi_child_wnd_proc_1(), mdi_child_wnd_proc_2(), mdi_main_wnd_procA(), Window::MDICBTHookProc(), menu_cancelmode_wnd_proc(), menu_check_wnd_proc(), menu_fill_in_init(), menu_ownerdraw_wnd_proc(), menu_track_again_wnd_proc(), monthcal_subclass_proc(), mstsc_WndProc(), multi_edit_dialog_proc(), NC_HandleNCCalcSize(), nccalcsize_proc(), NotifyHookProc(), notifysink_on_bn_clicked(), notifysink_on_cbn_selchange(), notifysink_on_wm_command(), notifysink_proc(), on_command_filetype(), on_command_opendropdown(), on_wm_command(), page_with_custom_default_button_dlg_proc(), pager_subclass_proc(), pagesetup_margin_editproc(), parent_wnd_proc(), parentdc_window_procA(), post_quit_dialog_owner_proc(), Window::PostParent(), proc_window(), MainFrameBase::ProcessMessage(), prompt_dlgproc(), PropertiesDialogDlgProc(), Window::PropSheetCBTHookProc(), radiobuttonlist_on_wm_command(), radiobuttonlist_proc(), redraw_window_procA(), reparent_dialog_owner_proc(), run_test(), run_test_(), save_message(), ScreenSaverConfigureDialog(), ScreenSaverProc(), scroll_init_proc(), security_dlgproc(), security_on_notify(), Window::SendParent(), ShutdownGuiProc(), smresult_wndproc(), StyleCheckProc(), subclass_proc(), SubclassedWindow::SubclassedWndProc(), subpopuplocked_wnd_proc(), syslink_subclass_proc(), tab_subclass_proc(), taskdialog_notify(), test_aw_conversion_dlgprocA(), test_aw_conversion_dlgprocW(), test_aw_conversion_wndproc(), test_control_procA(), test_customize_dlgproc(), test_parent_wndproc(), test_thick_child_size_winproc(), test_window_proc(), testwindow_wndproc(), timer_message_dlg_proc(), tool_window_procA(), trackbar_subclass_proc(), TreeviewWndProc(), TreeWndProc(), updown_subclass_proc(), userselect_dlgproc(), warning_proc(), window_proc(), Window::WindowWndProc(), wined3d_wndproc(), winproc_convA(), winproc_convW(), BackgroundWindow::WndProc(), WndProc(), QuickLaunchBar::WndProc(), MainFrameBase::WndProc(), DesktopWindow::WndProc(), TaskBar::WndProc(), FindProgramDlg::WndProc(), FileChildWindow::WndProc(), StartMenuButton::WndProc(), DesktopBar::WndProc(), Pane::WndProc(), Window::WndProc(), MDIMainFrame::WndProc(), ExecuteDialog::WndProc(), StartButton::WndProc(), NotifyArea::WndProc(), SDIMainFrame::WndProc(), DesktopShellView::WndProc(), SubclassedWindow::WndProc(), ShellBrowserChildT< MainFrameBase >::WndProc(), StartMenu::WndProc(), TrayNotifyDlg::WndProc(), ClockWindow::WndProc(), MDIShellBrowserChild::WndProc(), ChildWindow::WndProc(), IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc(), StartMenuRoot::WndProc(), ResizeController< Dialog >::WndProc(), CtlColorParent< OwnerDrawParent< Dialog > >::WndProc(), OwnerDrawParent< Dialog >::WndProc(), OwnerdrawnButton::WndProc(), FlatButton::WndProc(), ColorStatic::WndProc(), HyperlinkCtrl::WndProc(), ExplorerAboutDlg::WndProc(), WebChildWindow::WndProc(), TrayIconControllerTemplate< BASE >::WndProc(), EditController::WndProc(), ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::WndProc(), and ws2_test_WndProc().