ReactOS  0.4.15-dev-1054-gd029a62
listview.c File Reference
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
Include dependency graph for listview.c:

Go to the source code of this file.

Macros

#define LISTVIEW_ID   0
 
#define HEADER_ID   1
 
#define expect(expected, got)   ok(got == expected, "Expected %d, got %d\n", expected, got)
 
#define expect2(expected1, expected2, got1, got2)
 
#define X(f)   p##f = (void*)GetProcAddress(hComCtl32, #f);
 
#define test_lvm_hittest(a, b, c, d, e, f, g, h)   test_lvm_hittest_(a,b,c,d,e,f,g,h,__LINE__)
 
#define test_lvm_subitemhittest(a, b, c, d, e, f, g, h, i)   test_lvm_subitemhittest_(a,b,c,d,e,f,g,h,i,__LINE__)
 
#define TEST_NO_HEADER(a)   test_header_presence_(a, FALSE, __LINE__)
 
#define TEST_HEADER_EXPECTED(a)   test_header_presence_(a, TRUE, __LINE__)
 
#define TEST_NO_HEADER2(a, b)   test_header_presence_(a, b, __LINE__)
 

Enumerations

enum  seq_index {
  COMBINED_SEQ_INDEX = 0, NUM_MSG_SEQUENCES, LB_SEQ_INDEX, PARENT_SEQ_INDEX,
  NUM_MSG_SEQUENCES, PARENT_SEQ_INDEX, PARENT_FULL_SEQ_INDEX, PARENT_CD_SEQ_INDEX,
  LISTVIEW_SEQ_INDEX, EDITBOX_SEQ_INDEX, COMBINED_SEQ_INDEX, NUM_MSG_SEQUENCES,
  PARENT_SEQ_INDEX = 0, NUM_MSG_SEQUENCES
}
 

Functions

static HIMAGELIST (WINAPI *pImageList_Create)(int
 
static BOOL (WINAPI *pImageList_Destroy)(HIMAGELIST)
 
static int (WINAPI *pImageList_Add)(HIMAGELIST
 
static HWND subclass_editbox (HWND hwndListview)
 
static void init_functions (void)
 
static LRESULT WINAPI parent_wnd_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL register_parent_wnd_class (BOOL Unicode)
 
static HWND create_parent_window (BOOL Unicode)
 
static LRESULT WINAPI listview_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static HWND create_listview_control (DWORD style)
 
static HWND create_listview_controlW (DWORD style, HWND parent)
 
static BOOL is_win_xp (void)
 
static LRESULT WINAPI header_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static HWND subclass_header (HWND hwndListview)
 
static LRESULT WINAPI editbox_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_lvm_hittest_ (HWND hwnd, INT x, INT y, INT item, UINT flags, UINT broken_flags, BOOL todo_item, BOOL todo_flags, int line)
 
static void test_lvm_subitemhittest_ (HWND hwnd, INT x, INT y, INT item, INT subitem, UINT flags, BOOL todo_item, BOOL todo_subitem, BOOL todo_flags, int line)
 
static void test_images (void)
 
static void test_checkboxes (void)
 
static void insert_column (HWND hwnd, int idx)
 
static void insert_item (HWND hwnd, int idx)
 
static void test_items (void)
 
static void test_columns (void)
 
static LRESULT CALLBACK create_test_wndproc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static void test_header_presence_ (HWND hwnd, BOOL present, int line)
 
static void test_create (BOOL is_version_6)
 
static void test_redraw (void)
 
static LRESULT WINAPI cd_wndproc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_customdraw (void)
 
static void test_icon_spacing (void)
 
static void test_color (void)
 
static void test_item_count (void)
 
static void test_item_position (void)
 
static void test_getorigin (void)
 
static void test_multiselect (void)
 
static void test_subitem_rect (void)
 
static INT WINAPI test_CallBackCompare (LPARAM first, LPARAM second, LPARAM lParam)
 
static void test_sorting (void)
 
static void test_ownerdata (void)
 
static void test_norecompute (void)
 
static void test_nosortheader (void)
 
static void test_setredraw (void)
 
static void test_hittest (void)
 
static void test_getviewrect (void)
 
static void test_getitemposition (void)
 
static void test_columnscreation (void)
 
static void test_getitemrect (void)
 
static void test_editbox (void)
 
static void test_notifyformat (void)
 
static void test_indentation (void)
 
static INT CALLBACK DummyCompareEx (LPARAM first, LPARAM second, LPARAM param)
 
static BOOL is_below_comctl_5 (void)
 
static void test_get_set_view (void)
 
static void test_canceleditlabel (void)
 
static void test_mapidindex (void)
 
static void test_getitemspacing (void)
 
static INT get_current_font_height (HWND listview)
 
static void test_getcolumnwidth (void)
 
static void test_scrollnotify (void)
 
static void test_LVS_EX_TRANSPARENTBKGND (void)
 
static void test_approximate_viewrect (void)
 
static void test_finditem (void)
 
static void test_LVS_EX_HEADERINALLVIEWS (void)
 
static void test_hover (void)
 
static void test_destroynotify (void)
 
static void test_header_notification (void)
 
static void test_header_notification2 (void)
 
static void test_createdragimage (void)
 
static void test_dispinfo (void)
 
static void test_LVM_SETITEMTEXT (void)
 
static void test_LVM_REDRAWITEMS (void)
 
static void test_imagelists (void)
 
static void test_deleteitem (void)
 
static void test_insertitem (void)
 
static void test_header_proc (void)
 
static void flush_events (void)
 
static void test_oneclickactivate (void)
 
static void test_callback_mask (void)
 
static void test_state_image (void)
 
static void test_LVSCW_AUTOSIZE (void)
 
static void test_LVN_ENDLABELEDIT (void)
 
static LRESULT CALLBACK create_item_height_wndproc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_LVM_GETCOUNTPERPAGE (void)
 
static void test_item_state_change (void)
 
 START_TEST (listview)
 

Variables

static int
 
static UINT
 
static HBITMAP
 
static const WCHAR testparentclassW []
 
static HWND hwndparent
 
static HWND hwndparentW
 
static BOOL blockEdit
 
static BOOL g_block_hover
 
static NMLISTVIEW g_nmlistview
 
static NMLISTVIEW g_nmlistview_changing
 
static INT notifyFormat
 
static BOOL g_is_below_5
 
static LVITEMA g_itema
 
static BOOL g_disp_A_to_W
 
static NMLVDISPINFOA g_editbox_disp_info
 
static BOOL g_focus_test_LVN_DELETEITEM
 
static BOOL g_WM_KILLFOCUS_on_LVN_ENDLABELEDIT
 
static struct msg_sequencesequences [NUM_MSG_SEQUENCES]
 
static const struct message create_ownerdrawfixed_parent_seq []
 
static const struct message redraw_listview_seq []
 
static const struct message listview_icon_spacing_seq []
 
static const struct message listview_color_seq []
 
static const struct message listview_item_count_seq []
 
static const struct message listview_itempos_seq []
 
static const struct message listview_ownerdata_switchto_seq []
 
static const struct message listview_getorderarray_seq []
 
static const struct message listview_setorderarray_seq []
 
static const struct message empty_seq []
 
static const struct message parent_focus_change_ownerdata_seq []
 
static const struct message forward_erasebkgnd_parent_seq []
 
static const struct message ownerdata_select_focus_parent_seq []
 
static const struct message ownerdata_setstate_all_parent_seq []
 
static const struct message ownerdata_defocus_all_parent_seq []
 
static const struct message ownerdata_deselect_all_parent_seq []
 
static const struct message change_all_parent_seq []
 
static const struct message changing_all_parent_seq []
 
static const struct message textcallback_set_again_parent_seq []
 
static const struct message single_getdispinfo_parent_seq []
 
static const struct message getitemposition_seq1 []
 
static const struct message getitemposition_seq2 []
 
static const struct message getsubitemrect_seq []
 
static const struct message editbox_create_pos []
 
static const struct message scroll_parent_seq []
 
static const struct message setredraw_seq []
 
static const struct message lvs_ex_transparentbkgnd_seq []
 
static const struct message edit_end_nochange []
 
static const struct message hover_parent []
 
static const struct message listview_destroy []
 
static const struct message listview_ownerdata_destroy []
 
static const struct message listview_ownerdata_deleteall []
 
static const struct message listview_header_changed_seq []
 
static const struct message parent_header_click_seq []
 
static const struct message parent_header_divider_dclick_seq []
 
static const struct message listview_set_imagelist []
 
static const struct message listview_header_set_imagelist []
 
static const struct message parent_insert_focused_seq []
 
static const struct message parent_report_cd_seq []
 
static const struct message parent_list_cd_seq []
 
static const struct message listview_end_label_edit []
 
static const struct message listview_end_label_edit_kill_focus []
 
static WNDPROC listviewWndProc
 
static HIMAGELIST test_create_imagelist
 

Macro Definition Documentation

◆ expect

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

Definition at line 49 of file listview.c.

◆ expect2

#define expect2 (   expected1,
  expected2,
  got1,
  got2 
)
Value:
ok(expected1 == got1 && expected2 == got2, \
"expected (%d,%d), got (%d,%d)\n", expected1, expected2, got1, got2)
static const WCHAR expected2[]
Definition: dir.c:143
static const WCHAR expected1[]
Definition: dir.c:142
#define ok(value,...)
Definition: atltest.h:57

Definition at line 50 of file listview.c.

◆ HEADER_ID

#define HEADER_ID   1

Definition at line 47 of file listview.c.

◆ LISTVIEW_ID

#define LISTVIEW_ID   0

Definition at line 46 of file listview.c.

◆ TEST_HEADER_EXPECTED

#define TEST_HEADER_EXPECTED (   a)    test_header_presence_(a, TRUE, __LINE__)

Definition at line 1571 of file listview.c.

◆ test_lvm_hittest

#define test_lvm_hittest (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h 
)    test_lvm_hittest_(a,b,c,d,e,f,g,h,__LINE__)

Definition at line 859 of file listview.c.

◆ test_lvm_subitemhittest

#define test_lvm_subitemhittest (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i 
)    test_lvm_subitemhittest_(a,b,c,d,e,f,g,h,i,__LINE__)

Definition at line 886 of file listview.c.

◆ TEST_NO_HEADER

#define TEST_NO_HEADER (   a)    test_header_presence_(a, FALSE, __LINE__)

Definition at line 1570 of file listview.c.

◆ TEST_NO_HEADER2

#define TEST_NO_HEADER2 (   a,
  b 
)    test_header_presence_(a, b, __LINE__)

Definition at line 1572 of file listview.c.

◆ X

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

Enumeration Type Documentation

◆ seq_index

Enumerator
COMBINED_SEQ_INDEX 
NUM_MSG_SEQUENCES 
LB_SEQ_INDEX 
PARENT_SEQ_INDEX 
NUM_MSG_SEQUENCES 
PARENT_SEQ_INDEX 
PARENT_FULL_SEQ_INDEX 
PARENT_CD_SEQ_INDEX 
LISTVIEW_SEQ_INDEX 
EDITBOX_SEQ_INDEX 
COMBINED_SEQ_INDEX 
NUM_MSG_SEQUENCES 
PARENT_SEQ_INDEX 
NUM_MSG_SEQUENCES 

Definition at line 36 of file listview.c.

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pImageList_Destroy)
static

◆ cd_wndproc()

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

Definition at line 1867 of file listview.c.

1868 {
1869  COLORREF clr, c0ffee = RGB(0xc0, 0xff, 0xee);
1870 
1871  if(message == WM_NOTIFY) {
1872  NMHDR *nmhdr = (NMHDR*)lParam;
1873  if(nmhdr->code == NM_CUSTOMDRAW) {
1874  NMLVCUSTOMDRAW *nmlvcd = (NMLVCUSTOMDRAW*)nmhdr;
1875  struct message msg;
1876 
1877  msg.message = message;
1878  msg.flags = sent|wparam|lparam|custdraw;
1879  msg.wParam = wParam;
1880  msg.lParam = lParam;
1881  msg.id = nmhdr->code;
1882  msg.stage = nmlvcd->nmcd.dwDrawStage;
1884 
1885  switch(nmlvcd->nmcd.dwDrawStage) {
1886  case CDDS_PREPAINT:
1887  SetBkColor(nmlvcd->nmcd.hdc, c0ffee);
1889  case CDDS_ITEMPREPAINT:
1890  nmlvcd->clrTextBk = CLR_DEFAULT;
1891  nmlvcd->clrText = RGB(0, 255, 0);
1894  clr = GetBkColor(nmlvcd->nmcd.hdc);
1895  ok(nmlvcd->clrTextBk == CLR_DEFAULT, "got 0x%x\n", nmlvcd->clrTextBk);
1896  ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText);
1898  {
1899  todo_wine_if(nmlvcd->iSubItem)
1900  ok(clr == c0ffee, "clr=%.8x\n", clr);
1901  }
1904  clr = GetBkColor(nmlvcd->nmcd.hdc);
1905  if (!(GetWindowLongW(nmhdr->hwndFrom, GWL_STYLE) & LVS_SHOWSELALWAYS))
1906  todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
1907  ok(nmlvcd->clrTextBk == CLR_DEFAULT, "got 0x%x\n", nmlvcd->clrTextBk);
1908  ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText);
1910  }
1912  }
1913  }
1914 
1916 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
COLORREF WINAPI GetBkColor(_In_ HDC)
Definition: dc.c:956
return
Definition: dirsup.c:529
#define CDDS_SUBITEM
Definition: commctrl.h:285
Definition: tftpd.h:59
#define RGB(r, g, b)
Definition: precomp.h:62
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:270
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2263
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
GLdouble n
Definition: glext.h:7729
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:281
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define CDRF_NOTIFYSUBITEMDRAW
Definition: commctrl.h:272
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3134
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:977
COLORREF clrText
Definition: commctrl.h:3059
NMCUSTOMDRAW nmcd
Definition: commctrl.h:3058
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:45
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:271
#define todo_wine_if(is_todo)
Definition: test.h:163
if(!(yy_init))
Definition: macro.lex.yy.c:714
DWORD COLORREF
Definition: windef.h:300
#define CDRF_DODEFAULT
Definition: commctrl.h:264
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define CDDS_PREPAINT
Definition: commctrl.h:276
Definition: msg.h:34
#define todo_wine
Definition: test.h:162
HDC hdc
Definition: main.c:9
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndFrom
Definition: winuser.h:3132
#define GWL_STYLE
Definition: winuser.h:846
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define add_message(msg)
Definition: msg.c:2108
#define ok(value,...)
Definition: atltest.h:57
#define CLR_DEFAULT
Definition: commctrl.h:316
#define msg(x)
Definition: auth_time.c:54
COLORREF clrTextBk
Definition: commctrl.h:3060
#define CDDS_ITEMPOSTPAINT
Definition: commctrl.h:282
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by test_customdraw().

◆ create_item_height_wndproc()

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

Definition at line 6408 of file listview.c.

6409 {
6410  if (msg == WM_CREATE)
6411  return 0;
6412 
6414 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static WNDPROC listviewWndProc
Definition: listview.c:1552
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
LPARAM lParam
Definition: combotst.c:139

Referenced by test_LVM_GETCOUNTPERPAGE().

◆ create_listview_control()

static HWND create_listview_control ( DWORD  style)
static

Definition at line 690 of file listview.c.

691 {
692  WNDPROC oldproc;
693  HWND hwnd;
694  RECT rect;
695 
697  hwnd = CreateWindowExA(0, WC_LISTVIEWA, "foo",
699  0, 0, rect.right, rect.bottom,
701  ok(hwnd != NULL, "gle=%d\n", GetLastError());
702 
703  if (!hwnd) return NULL;
704 
708 
709  return hwnd;
710 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HWND hwndparent
Definition: listview.c:56
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define WS_CHILD
Definition: pedump.c:617
#define WC_LISTVIEWA
Definition: commctrl.h:2252
& rect
Definition: startmenu.cpp:1413
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: listview.c:668
#define SetWindowLongPtrA
Definition: winuser.h:5320
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WS_BORDER
Definition: pedump.c:625
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
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
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by is_below_comctl_5(), is_win_xp(), test_approximate_viewrect(), test_callback_mask(), test_canceleditlabel(), test_color(), test_columns(), test_columnscreation(), test_create(), test_createdragimage(), test_customdraw(), test_deleteitem(), test_destroynotify(), test_dispinfo(), test_editbox(), test_finditem(), test_get_set_view(), test_getcolumnwidth(), test_getitemposition(), test_getitemrect(), test_getitemspacing(), test_getorigin(), test_getviewrect(), test_header_notification(), test_header_notification2(), test_header_proc(), test_hittest(), test_hover(), test_icon_spacing(), test_imagelists(), test_indentation(), test_insertitem(), test_item_count(), test_item_position(), test_item_state_change(), test_LVM_GETCOUNTPERPAGE(), test_LVM_REDRAWITEMS(), test_LVM_SETITEMTEXT(), test_LVN_ENDLABELEDIT(), test_LVS_EX_HEADERINALLVIEWS(), test_LVS_EX_TRANSPARENTBKGND(), test_LVSCW_AUTOSIZE(), test_mapidindex(), test_multiselect(), test_norecompute(), test_nosortheader(), test_notifyformat(), test_ownerdata(), test_redraw(), test_scrollnotify(), test_setredraw(), test_sorting(), test_state_image(), and test_subitem_rect().

◆ create_listview_controlW()

static HWND create_listview_controlW ( DWORD  style,
HWND  parent 
)
static

Definition at line 713 of file listview.c.

714 {
715  WNDPROC oldproc;
716  HWND hwnd;
717  RECT rect;
718  static const WCHAR nameW[] = {'f','o','o',0};
719 
723  0, 0, rect.right, rect.bottom,
725  ok(hwnd != NULL, "gle=%d\n", GetLastError());
726 
727  if (!hwnd) return NULL;
728 
732 
733  return hwnd;
734 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WC_LISTVIEWW
Definition: commctrl.h:2253
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define WS_CHILD
Definition: pedump.c:617
& rect
Definition: startmenu.cpp:1413
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR nameW[]
Definition: main.c:46
r parent
Definition: btrfs.c:2944
__wchar_t WCHAR
Definition: xmlstorage.h:180
static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: listview.c:668
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR 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 GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WS_BORDER
Definition: pedump.c:625
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define SetWindowLongPtrW
Definition: winuser.h:5321
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by test_notifyformat().

◆ create_parent_window()

static HWND create_parent_window ( BOOL  Unicode)
static

Definition at line 640 of file listview.c.

641 {
642  static const WCHAR nameW[] = {'t','e','s','t','p','a','r','e','n','t','n','a','m','e','W',0};
643  HWND hwnd;
644 
645  if (!register_parent_wnd_class(Unicode))
646  return NULL;
647 
648  blockEdit = FALSE;
649  notifyFormat = -1;
650 
651  if (Unicode)
655  0, 0, 100, 100,
657  else
658  hwnd = CreateWindowExA(0, "Listview test parent class",
659  "Listview test parent window",
662  0, 0, 100, 100,
665  return hwnd;
666 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static BOOL register_parent_wnd_class(BOOL Unicode)
Definition: listview.c:605
static INT notifyFormat
Definition: listview.c:67
static BOOL blockEdit
Definition: listview.c:58
static const WCHAR testparentclassW[]
Definition: listview.c:53
#define HWND_TOPMOST
Definition: winuser.h:1194
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
static const WCHAR nameW[]
Definition: main.c:46
#define WS_CAPTION
Definition: pedump.c:624
__wchar_t WCHAR
Definition: xmlstorage.h:180
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR 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)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define SWP_NOSIZE
Definition: winuser.h:1230
#define WS_MINIMIZEBOX
Definition: pedump.c:631
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)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629

Referenced by START_TEST(), and test_notifyformat().

◆ create_test_wndproc()

static LRESULT CALLBACK create_test_wndproc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1555 of file listview.c.

1556 {
1557  LRESULT ret;
1558 
1559  if (uMsg == WM_CREATE)
1560  {
1562  lpcs->style |= LVS_REPORT;
1563  }
1566  return ret;
1567 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVS_REPORT
Definition: commctrl.h:2258
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG_PTR LPARAM
Definition: windef.h:208
static HIMAGELIST test_create_imagelist
Definition: listview.c:1553
static WNDPROC listviewWndProc
Definition: listview.c:1552
int ret
#define LVM_SETIMAGELIST
Definition: commctrl.h:2299
#define WM_CREATE
Definition: winuser.h:1590
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

Referenced by test_create().

◆ DummyCompareEx()

static INT CALLBACK DummyCompareEx ( LPARAM  first,
LPARAM  second,
LPARAM  param 
)
static

Definition at line 4580 of file listview.c.

4581 {
4582  return 0;
4583 }

Referenced by is_below_comctl_5().

◆ editbox_subclass_proc()

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

Definition at line 785 of file listview.c.

786 {
788  static LONG defwndproc_counter = 0;
789  struct message msg = { 0 };
790  LRESULT ret;
791 
792  msg.message = message;
793  msg.flags = sent|wparam|lparam;
794  if (defwndproc_counter) msg.flags |= defwinproc;
795  msg.wParam = wParam;
796  msg.lParam = lParam;
797 
798  /* all we need is sizing */
799  if (message == WM_WINDOWPOSCHANGING ||
800  message == WM_NCCALCSIZE ||
802  message == WM_MOVE ||
803  message == WM_SIZE)
804  {
806  }
807 
808  defwndproc_counter++;
809  ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
810  defwndproc_counter--;
811  return ret;
812 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
#define WM_NCCALCSIZE
Definition: winuser.h:1667
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define WM_MOVE
Definition: winuser.h:1592
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
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
#define WM_SIZE
Definition: winuser.h:1593
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
int ret
Definition: msg.h:34
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define add_message(msg)
Definition: msg.c:2108
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define msg(x)
Definition: auth_time.c:54
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().

◆ flush_events()

static void flush_events ( void  )
static

Definition at line 5993 of file listview.c.

5994 {
5995  MSG msg;
5996  int diff = 200;
5997  int min_timeout = 100;
5998  DWORD time = GetTickCount() + diff;
5999 
6000  while (diff > 0)
6001  {
6002  if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
6003  while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
6004  diff = time - GetTickCount();
6005  }
6006 }
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
__u16 time
Definition: mkdosfs.c:366
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_TIMEOUT
Definition: dderror.h:14
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define QS_ALLINPUT
Definition: winuser.h:874
#define msg(x)
Definition: auth_time.c:54
#define PM_REMOVE
Definition: winuser.h:1182

Referenced by test_oneclickactivate().

◆ get_current_font_height()

static INT get_current_font_height ( HWND  listview)
static

Definition at line 4882 of file listview.c.

4883 {
4884  TEXTMETRICA tm;
4885  HFONT hfont;
4886  HWND hwnd;
4887  HDC hdc;
4888 
4889  hwnd = (HWND)SendMessageA(listview, LVM_GETHEADER, 0, 0);
4890  if (!hwnd)
4891  hwnd = listview;
4892 
4893  hfont = (HFONT)SendMessageA(hwnd, WM_GETFONT, 0, 0);
4894  if (!hfont) {
4895  hdc = GetDC(hwnd);
4896  GetTextMetricsA(hdc, &tm);
4897  ReleaseDC(hwnd, hdc);
4898  }
4899  else {
4900  HFONT oldfont;
4901 
4902  hdc = GetDC(0);
4903  oldfont = SelectObject(hdc, hfont);
4904  GetTextMetricsA(hdc, &tm);
4905  SelectObject(hdc, oldfont);
4906  ReleaseDC(0, hdc);
4907  }
4908 
4909  return tm.tmHeight;
4910 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HDC WINAPI GetDC(_In_opt_ HWND)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HDC
Definition: imagelist.c:92
HANDLE HWND
Definition: compat.h:19
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_GETFONT
Definition: winuser.h:1633
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
static HFONT hfont
HDC hdc
Definition: main.c:9
Definition: time.h:76
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define LVM_GETHEADER
Definition: commctrl.h:2646

Referenced by test_getcolumnwidth().

◆ header_subclass_proc()

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

Definition at line 751 of file listview.c.

752 {
754  static LONG defwndproc_counter = 0;
755  struct message msg = { 0 };
756  LRESULT ret;
757 
758  msg.message = message;
759  msg.flags = sent|wparam|lparam;
760  if (defwndproc_counter) msg.flags |= defwinproc;
761  msg.wParam = wParam;
762  msg.lParam = lParam;
763  msg.id = HEADER_ID;
765 
766  defwndproc_counter++;
767  ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
768  defwndproc_counter--;
769  return ret;
770 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
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
int ret
Definition: msg.h:34
#define HEADER_ID
Definition: listview.c:47
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define add_message(msg)
Definition: msg.c:2108
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by subclass_header().

◆ HIMAGELIST()

static HIMAGELIST ( WINAPI pImageList_Create)
static

◆ init_functions()

static void init_functions ( void  )
static

Definition at line 83 of file listview.c.

84 {
85  HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
86 
87 #define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
92 #undef X
93 }
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define X(f)
BOOL WINAPI _TrackMouseEvent(TRACKMOUSEEVENT *ptme)
Definition: commctrl.c:1207

Referenced by START_TEST().

◆ insert_column()

static void insert_column ( HWND  hwnd,
int  idx 
)
static

Definition at line 1158 of file listview.c.

1159 {
1160  LVCOLUMNA column;
1161  INT rc;
1162 
1163  memset(&column, 0xcc, sizeof(column));
1164  column.mask = LVCF_SUBITEM;
1165  column.iSubItem = idx;
1166 
1168  expect(idx, rc);
1169 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define expect(expected, got)
Definition: listview.c:49
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int32_t INT
Definition: typedefs.h:58
#define LVCF_SUBITEM
Definition: commctrl.h:2585
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define memset(x, y, z)
Definition: compat.h:39
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2627

Referenced by test_customdraw(), test_editbox(), test_getitemposition(), test_getitemrect(), test_getviewrect(), test_hittest(), test_items(), test_LVN_ENDLABELEDIT(), test_LVSCW_AUTOSIZE(), test_scrollnotify(), and test_state_image().

◆ insert_item()

static void insert_item ( HWND  hwnd,
int  idx 
)
static

Definition at line 1171 of file listview.c.

1172 {
1173  static CHAR text[] = "foo";
1174 
1175  LVITEMA item;
1176  INT rc;
1177 
1178  memset(&item, 0xcc, sizeof (item));
1179  item.mask = LVIF_TEXT;
1180  item.iItem = idx;
1181  item.iSubItem = 0;
1182  item.pszText = text;
1183 
1185  expect(idx, rc);
1186 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define expect(expected, got)
Definition: listview.c:49
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
char CHAR
Definition: xmlstorage.h:175
int32_t INT
Definition: typedefs.h:58
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVM_INSERTITEMA
Definition: commctrl.h:2399
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
static ATOM item
Definition: dde.c:856
#define memset(x, y, z)
Definition: compat.h:39

Referenced by is_below_comctl_5(), test_canceleditlabel(), test_columns(), test_columnscreation(), test_createdragimage(), test_customdraw(), test_deleteitem(), test_dispinfo(), test_finditem(), test_getitemposition(), test_hittest(), test_item_state_change(), test_LVM_REDRAWITEMS(), test_LVM_SETITEMTEXT(), test_LVSCW_AUTOSIZE(), test_mapidindex(), test_multiselect(), test_scrollnotify(), and test_subitem_rect().

◆ int()

static int ( WINAPI pImageList_Add)
static

◆ is_below_comctl_5()

static BOOL is_below_comctl_5 ( void  )
static

Definition at line 4585 of file listview.c.

4586 {
4587  HWND hwnd;
4588  BOOL ret;
4589 
4591  ok(hwnd != NULL, "failed to create a listview window\n");
4592  insert_item(hwnd, 0);
4593 
4595 
4597 
4598  return !ret;
4599 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVS_REPORT
Definition: commctrl.h:2258
BOOL WINAPI DestroyWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LVM_SORTITEMSEX
Definition: commctrl.h:2796
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
int ret
static INT CALLBACK DummyCompareEx(LPARAM first, LPARAM second, LPARAM param)
Definition: listview.c:4580
#define ok(value,...)
Definition: atltest.h:57
static void insert_item(HWND hwnd, int idx)
Definition: listview.c:1171

Referenced by START_TEST().

◆ is_win_xp()

static BOOL is_win_xp ( void  )
static

Definition at line 736 of file listview.c.

737 {
738  HWND hwnd, header;
739  BOOL ret;
740 
742  SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_HEADERINALLVIEWS, LVS_EX_HEADERINALLVIEWS);
744  ret = !IsWindow(header);
745 
747 
748  return ret;
749 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI IsWindow(_In_opt_ HWND)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE HWND
Definition: compat.h:19
BOOL WINAPI DestroyWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2720
#define LVS_ICON
Definition: commctrl.h:2257
int ret
#define LVM_GETHEADER
Definition: commctrl.h:2646
struct CFHEADER header
Definition: fdi.c:101

Referenced by test_create().

◆ listview_subclass_proc()

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

Definition at line 668 of file listview.c.

669 {
671  static LONG defwndproc_counter = 0;
672  LRESULT ret;
673  struct message msg;
674 
675  msg.message = message;
676  msg.flags = sent|wparam|lparam;
677  if (defwndproc_counter) msg.flags |= defwinproc;
678  msg.wParam = wParam;
679  msg.lParam = lParam;
680  msg.id = LISTVIEW_ID;
683 
684  defwndproc_counter++;
685  ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
686  defwndproc_counter--;
687  return ret;
688 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
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
int ret
Definition: msg.h:34
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define add_message(msg)
Definition: msg.c:2108
#define msg(x)
Definition: auth_time.c:54
#define LISTVIEW_ID
Definition: listview.c:46
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by create_listview_control(), and create_listview_controlW().

◆ parent_wnd_proc()

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

Definition at line 469 of file listview.c.

470 {
471  static LONG defwndproc_counter = 0;
472  LRESULT ret;
473  struct message msg;
474 
475  msg.message = message;
476  msg.flags = sent|wparam|lparam;
477  if (defwndproc_counter) msg.flags |= defwinproc;
478  msg.wParam = wParam;
479  msg.lParam = lParam;
480  if (message == WM_NOTIFY && lParam) msg.id = ((NMHDR*)lParam)->code;
481  if (message == WM_COMMAND) msg.id = HIWORD(wParam);
482 
483  /* log system messages, except for painting */
484  if (message < WM_USER &&
485  message != WM_PAINT &&
486  message != WM_ERASEBKGND &&
487  message != WM_NCPAINT &&
488  message != WM_NCHITTEST &&
489  message != WM_GETTEXT &&
490  message != WM_GETICON &&
492  {
495  }
497 
498  switch (message)
499  {
500  case WM_NOTIFY:
501  {
502  switch (((NMHDR*)lParam)->code)
503  {
504  case LVN_BEGINLABELEDITA:
505  {
506  HWND edit = NULL;
507 
508  /* subclass edit box */
509  if (!blockEdit)
510  edit = subclass_editbox(((NMHDR*)lParam)->hwndFrom);
511 
512  if (edit)
513  {
514  INT len = SendMessageA(edit, EM_GETLIMITTEXT, 0, 0);
515  ok(len == 259 || broken(len == 260) /* includes NULL in NT4 */,
516  "text limit %d, expected 259\n", len);
517  }
518 
519  return blockEdit;
520  }
521  case LVN_ENDLABELEDITA:
522  {
523  HWND edit;
524 
525  /* always accept new item text */
527  g_editbox_disp_info = *di;
528 
529  /* edit control still available from this notification */
530  edit = (HWND)SendMessageA(((NMHDR*)lParam)->hwndFrom, LVM_GETEDITCONTROL, 0, 0);
531  ok(IsWindow(edit), "expected valid edit control handle\n");
532  ok((GetWindowLongA(edit, GWL_STYLE) & ES_MULTILINE) == 0, "edit is multiline\n");
533 
535  SendMessageA(edit, WM_KILLFOCUS, 0, 0);
536 
537  return TRUE;
538  }
539  case LVN_ITEMCHANGING:
540  {
541  NMLISTVIEW *nmlv = (NMLISTVIEW*)lParam;
542  g_nmlistview_changing = *nmlv;
543  }
544  break;
545  case LVN_ITEMCHANGED:
546  {
547  NMLISTVIEW *nmlv = (NMLISTVIEW*)lParam;
548  g_nmlistview = *nmlv;
549  }
550  break;
551  case LVN_GETDISPINFOA:
552  {
553  NMLVDISPINFOA *dispinfo = (NMLVDISPINFOA*)lParam;
554  g_itema = dispinfo->item;
555 
556  if (g_disp_A_to_W && (dispinfo->item.mask & LVIF_TEXT))
557  {
558  static const WCHAR testW[] = {'T','E','S','T',0};
559  dispinfo->hdr.code = LVN_GETDISPINFOW;
560  memcpy(dispinfo->item.pszText, testW, sizeof(testW));
561  }
562 
563  /* test control buffer size for text, 10 used to mask cases when control
564  is using caller buffer to process LVM_GETITEM for example */
565  if (dispinfo->item.mask & LVIF_TEXT && dispinfo->item.cchTextMax > 10)
566  ok(dispinfo->item.cchTextMax == 260 ||
567  broken(dispinfo->item.cchTextMax == 264) /* NT4 reports aligned size */,
568  "buffer size %d\n", dispinfo->item.cchTextMax);
569  }
570  break;
571  case LVN_DELETEITEM:
573  {
574  NMLISTVIEW *nmlv = (NMLISTVIEW*)lParam;
575  UINT state;
576 
578  ok(state == 0, "got state %x\n", state);
579  }
580  break;
581  case NM_HOVER:
582  if (g_block_hover) return 1;
583  break;
584  }
585  break;
586  }
587  case WM_NOTIFYFORMAT:
588  {
589  /* force to return format */
590  if (lParam == NF_QUERY && notifyFormat != -1) return notifyFormat;
591  break;
592  }
593  }
594 
595  defwndproc_counter++;
596  if (IsWindowUnicode(hwnd))
598  else
600  defwndproc_counter--;
601 
602  return ret;
603 }
static BOOL g_block_hover
Definition: listview.c:60
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVM_GETITEMSTATE
Definition: commctrl.h:2671
Definition: tftpd.h:59
static NMLVDISPINFOA g_editbox_disp_info
Definition: listview.c:75
#define LVM_GETEDITCONTROL
Definition: commctrl.h:2538
BOOL WINAPI IsWindow(_In_opt_ HWND)
static INT notifyFormat
Definition: listview.c:67
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NM_HOVER
Definition: commctrl.h:138
static BOOL blockEdit
Definition: listview.c:58
#define LVN_GETDISPINFOA
Definition: commctrl.h:3149
static LVITEMA g_itema
Definition: listview.c:71
#define WM_GETTEXT
Definition: winuser.h:1600
Definition: msg.h:39
#define LVN_ITEMCHANGED
Definition: commctrl.h:3127
#define ES_MULTILINE
Definition: pedump.c:667
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define LVN_GETDISPINFOW
Definition: commctrl.h:3150
HANDLE HWND
Definition: compat.h:19
static BOOL g_focus_test_LVN_DELETEITEM
Definition: listview.c:77
#define WM_NCHITTEST
Definition: winuser.h:1668
static NMLISTVIEW g_nmlistview
Definition: listview.c:62
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
static BOOL g_WM_KILLFOCUS_on_LVN_ENDLABELEDIT
Definition: listview.c:79
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVN_ITEMCHANGING
Definition: commctrl.h:3126
#define LVIF_TEXT
Definition: commctrl.h:2305
UINT code
Definition: winuser.h:3134
#define WM_NCPAINT
Definition: winuser.h:1669
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_KILLFOCUS
Definition: winuser.h:1596
LPSTR pszText
Definition: commctrl.h:2344
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EM_GETLIMITTEXT
Definition: richedit.h:74
#define LVN_DELETEITEM
Definition: commctrl.h:3129
#define WM_PAINT
Definition: winuser.h:1602
int ret
Definition: msg.h:34
int cchTextMax
Definition: commctrl.h:2345
static int state
Definition: maze.c:121
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define WM_COMMAND
Definition: winuser.h:1722
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: inflate.c:139
static NMLISTVIEW g_nmlistview_changing
Definition: listview.c:64
#define WM_USER
Definition: winuser.h:1877
#define broken(x)
Definition: _sntprintf.h:21
#define NF_QUERY
Definition: winuser.h:2435
UINT mask
Definition: commctrl.h:2339
#define GWL_STYLE
Definition: winuser.h:846
static BOOL g_disp_A_to_W
Definition: listview.c:73
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define add_message(msg)
Definition: msg.c:2108
#define ok(value,...)
Definition: atltest.h:57
#define LVN_ENDLABELEDITA
Definition: commctrl.h:3133
unsigned int UINT
Definition: ndis.h:50
#define LVN_BEGINLABELEDITA
Definition: commctrl.h:3131
#define WM_DEVICECHANGE
Definition: winuser.h:1793
#define msg(x)
Definition: auth_time.c:54
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static HWND subclass_editbox(HWND hwndListview)
Definition: listview.c:814
#define LVIS_FOCUSED
Definition: commctrl.h:2314
#define WM_NOTIFY
Definition: richedit.h:61
static const WCHAR testW[]
Definition: jsregexp.c:44
static UINT WPARAM wparam
Definition: combo.c:716
LVITEMA item
Definition: commctrl.h:3170

Referenced by register_parent_wnd_class().

◆ register_parent_wnd_class()

static BOOL register_parent_wnd_class ( BOOL  Unicode)
static

Definition at line 605 of file listview.c.

606 {
607  WNDCLASSA clsA;
608  WNDCLASSW clsW;
609 
610  if (Unicode)
611  {
612  clsW.style = 0;
614  clsW.cbClsExtra = 0;
615  clsW.cbWndExtra = 0;
617  clsW.hIcon = 0;
618  clsW.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
620  clsW.lpszMenuName = NULL;
622  }
623  else
624  {
625  clsA.style = 0;
627  clsA.cbClsExtra = 0;
628  clsA.cbWndExtra = 0;
630  clsA.hIcon = 0;
631  clsA.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
633  clsA.lpszMenuName = NULL;
634  clsA.lpszClassName = "Listview test parent class";
635  }
636 
637  return Unicode ? RegisterClassW(&clsW) : RegisterClassA(&clsA);
638 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
UINT style
Definition: winuser.h:3151
LPCWSTR lpszMenuName
Definition: winuser.h:3159
static const WCHAR testparentclassW[]
Definition: listview.c:53
int cbClsExtra
Definition: winuser.h:3140
LPCSTR lpszMenuName
Definition: winuser.h:3146
int cbClsExtra
Definition: winuser.h:3153
#define WHITE_BRUSH
Definition: wingdi.h:901
HBRUSH hbrBackground
Definition: winuser.h:3145
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
int cbWndExtra
Definition: winuser.h:3141
WNDPROC lpfnWndProc
Definition: winuser.h:3152
HCURSOR hCursor
Definition: winuser.h:3144
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3160
const char * LPCSTR
Definition: xmlstorage.h:183
int cbWndExtra
Definition: winuser.h:3154
HICON hIcon
Definition: winuser.h:3156
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
LPCSTR lpszClassName
Definition: winuser.h:3147
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3138
HCURSOR hCursor
Definition: winuser.h:3157
HINSTANCE hInstance
Definition: winuser.h:3142
HBRUSH hbrBackground
Definition: winuser.h:3158
WNDPROC lpfnWndProc
Definition: winuser.h:3139
HINSTANCE hInstance
Definition: winuser.h:3155
#define IDC_ARROW
Definition: winuser.h:682
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: listview.c:469
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3143

Referenced by create_parent_window().

◆ START_TEST()

START_TEST ( listview  )

Definition at line 6558 of file listview.c.

6559 {
6560  ULONG_PTR ctx_cookie;
6561  HANDLE hCtx;
6562 
6563  init_functions();
6564 
6566 
6569 
6571 
6574  test_images();
6575  test_checkboxes();
6576  test_items();
6577  test_create(FALSE);
6578  test_redraw();
6579  test_customdraw();
6581  test_color();
6582  test_item_count();
6584  test_columns();
6585  test_getorigin();
6586  test_multiselect();
6587  test_getitemrect();
6589  test_sorting();
6590  test_ownerdata();
6591  test_norecompute();
6593  test_setredraw();
6594  test_hittest();
6595  test_getviewrect();
6598  test_editbox();
6600  test_indentation();
6604  test_finditem();
6605  test_hover();
6608  test_dispinfo();
6611  test_imagelists();
6612  test_deleteitem();
6613  test_insertitem();
6614  test_header_proc();
6617  test_state_image();
6622 
6623  if (!load_v6_module(&ctx_cookie, &hCtx))
6624  {
6626  return;
6627  }
6628 
6629  init_functions();
6630 
6631  /* comctl32 version 6 tests start here */
6634  test_mapidindex();
6638  test_deleteitem();
6639  test_multiselect();
6640  test_insertitem();
6641  test_header_proc();
6642  test_images();
6643  test_checkboxes();
6644  test_items();
6645  test_create(TRUE);
6646  test_color();
6647  test_columns();
6648  test_sorting();
6649  test_ownerdata();
6650  test_norecompute();
6653  test_indentation();
6654  test_finditem();
6655  test_hover();
6658  test_dispinfo();
6662  test_state_image();
6667 
6668  unload_v6_module(ctx_cookie, hCtx);
6669 
6671 }
static void test_dispinfo(void)
Definition: listview.c:5673
static void test_scrollnotify(void)
Definition: listview.c:4949
static HWND hwndparent
Definition: listview.c:56
static void test_ownerdata(void)
Definition: listview.c:3075
static void test_deleteitem(void)
Definition: listview.c:5862
static void test_get_set_view(void)
Definition: listview.c:4601
static void test_create(BOOL is_version_6)
Definition: listview.c:1590
#define TRUE
Definition: types.h:120
static void test_imagelists(void)
Definition: listview.c:5777
static void test_multiselect(void)
Definition: listview.c:2305
static void test_checkboxes(void)
Definition: listview.c:961
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
static void test_destroynotify(void)
Definition: listview.c:5407
static void test_getcolumnwidth(void)
Definition: listview.c:4912
static void test_item_position(void)
Definition: listview.c:2190
BOOL WINAPI DestroyWindow(_In_ HWND)
static void test_header_proc(void)
Definition: listview.c:5969
static void test_getviewrect(void)
Definition: listview.c:3866
static void test_LVS_EX_TRANSPARENTBKGND(void)
Definition: listview.c:4988
static void test_items(void)
Definition: listview.c:1188
static void test_icon_spacing(void)
Definition: listview.c:1971
uint32_t ULONG_PTR
Definition: typedefs.h:65
static void test_LVM_GETCOUNTPERPAGE(void)
Definition: listview.c:6416
static void test_columnscreation(void)
Definition: listview.c:3959
static void test_LVSCW_AUTOSIZE(void)
Definition: listview.c:6313
static void test_getorigin(void)
Definition: listview.c:2258
#define FALSE
Definition: types.h:117
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
static void test_getitemspacing(void)
Definition: listview.c:4759
static void test_finditem(void)
Definition: listview.c:5227
static void test_columns(void)
Definition: listview.c:1445
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
static void test_norecompute(void)
Definition: listview.c:3493
static void test_item_state_change(void)
Definition: listview.c:6478
static BOOL g_is_below_5
Definition: listview.c:69
static void test_customdraw(void)
Definition: listview.c:1918
static void test_header_notification(void)
Definition: listview.c:5437
static void test_hover(void)
Definition: listview.c:5372
static void test_mapidindex(void)
Definition: listview.c:4705
static void test_LVM_SETITEMTEXT(void)
Definition: listview.c:5704
static void test_header_notification2(void)
Definition: listview.c:5496
static void test_setredraw(void)
Definition: listview.c:3607
static void test_getitemposition(void)
Definition: listview.c:3917
static void test_item_count(void)
Definition: listview.c:2085
static void init_functions(void)
Definition: listview.c:83
static void test_approximate_viewrect(void)
Definition: listview.c:5032
static void test_LVM_REDRAWITEMS(void)
Definition: listview.c:5740
static void test_LVN_ENDLABELEDIT(void)
Definition: listview.c:6357
static void test_sorting(void)
Definition: listview.c:2897
static void test_images(void)
Definition: listview.c:888
static void test_state_image(void)
Definition: listview.c:6201
static void test_canceleditlabel(void)
Definition: listview.c:4653
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
static void test_LVS_EX_HEADERINALLVIEWS(void)
Definition: listview.c:5312
static void test_hittest(void)
Definition: listview.c:3687
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static void test_color(void)
Definition: listview.c:2013
static BOOL is_below_comctl_5(void)
Definition: listview.c:4585
static void test_createdragimage(void)
Definition: listview.c:5651
static void test_insertitem(void)
Definition: listview.c:5917
static void test_getitemrect(void)
Definition: listview.c:3978
static void test_redraw(void)
Definition: listview.c:1793
static void test_nosortheader(void)
Definition: listview.c:3566
static void test_indentation(void)
Definition: listview.c:4551
static void test_subitem_rect(void)
Definition: listview.c:2701
static void test_notifyformat(void)
Definition: listview.c:4433
static void test_callback_mask(void)
Definition: listview.c:6066
static void test_oneclickactivate(void)
Definition: listview.c:6008
static HWND create_parent_window(BOOL Unicode)
Definition: listview.c:640
static void test_editbox(void)
Definition: listview.c:4214

◆ subclass_editbox()

static HWND subclass_editbox ( HWND  hwndListview)
static

Definition at line 814 of file listview.c.

815 {
816  WNDPROC oldproc;
817  HWND hwnd;
818 
819  hwnd = (HWND)SendMessageA(hwndListview, LVM_GETEDITCONTROL, 0, 0);
823 
824  return hwnd;
825 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVM_GETEDITCONTROL
Definition: commctrl.h:2538
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE HWND
Definition: compat.h:19
#define GWLP_USERDATA
Definition: treelist.c:63
#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: listview.c:785

Referenced by parent_wnd_proc().

◆ subclass_header()

static HWND subclass_header ( HWND  hwndListview)
static

Definition at line 772 of file listview.c.

773 {
774  WNDPROC oldproc;
775  HWND hwnd;
776 
777  hwnd = (HWND)SendMessageA(hwndListview, LVM_GETHEADER, 0, 0);
781 
782  return hwnd;
783 }
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:19
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: listview.c:751
#define GWLP_USERDATA
Definition: treelist.c:63
#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
#define LVM_GETHEADER
Definition: commctrl.h:2646

Referenced by test_columns(), test_getitemposition(), test_header_notification(), test_imagelists(), test_redraw(), test_setredraw(), and test_subitem_rect().

◆ test_approximate_viewrect()

static void test_approximate_viewrect ( void  )
static

Definition at line 5032 of file listview.c.

5033 {
5034  static CHAR test[] = "abracadabra, a very long item label";
5035  DWORD item_width, item_height, header_height;
5036  static CHAR column_header[] = "Header";
5037  unsigned const column_width = 100;
5038  DWORD ret, item_count;
5039  HIMAGELIST himl;
5040  LVITEMA itema;
5041  LVCOLUMNA col;
5042  HBITMAP hbmp;
5043  HWND hwnd;
5044 
5045  /* LVS_ICON */
5047  himl = pImageList_Create(40, 40, 0, 4, 4);
5048  ok(himl != NULL, "failed to create imagelist\n");
5049  hbmp = CreateBitmap(40, 40, 1, 1, NULL);
5050  ok(hbmp != NULL, "failed to create bitmap\n");
5051  ret = pImageList_Add(himl, hbmp, 0);
5052  expect(0, ret);
5054  expect(0, ret);
5055 
5056  itema.mask = LVIF_IMAGE;
5057  itema.iImage = 0;
5058  itema.iItem = 0;
5059  itema.iSubItem = 0;
5060  ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&itema);
5061  expect(0, ret);
5062 
5064  ok(ret != 0, "Unexpected return value %#x.\n", ret);
5065 
5067  expect(MAKELONG(77,827), ret);
5068 
5070  ok(ret != 0, "got 0\n");
5071 
5073  expect(MAKELONG(102,302), ret);
5074 
5076  expect(MAKELONG(52,52), ret);
5077 
5078  itema.pszText = test;
5079  ret = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&itema);
5080  expect(TRUE, ret);
5082  expect(MAKELONG(52,52), ret);
5083 
5085  expect(MAKELONG(52,2), ret);
5087  expect(MAKELONG(52,52), ret);
5089  expect(MAKELONG(102,52), ret);
5091  expect(MAKELONG(102,102), ret);
5093  expect(MAKELONG(102,102), ret);
5095  expect(MAKELONG(102,152), ret);
5097  expect(MAKELONG(102,152), ret);
5099  expect(MAKELONG(152,152), ret);
5100 
5102 
5103  /* LVS_REPORT */
5105 
5106  /* Empty control without columns */
5108 todo_wine
5109  ok(LOWORD(ret) == 0, "Unexpected width %d.\n", LOWORD(ret));
5110  ok(HIWORD(ret) != 0, "Unexpected height %d.\n", HIWORD(ret));
5111 
5113  ok(LOWORD(ret) == 0, "Unexpected width %d.\n", LOWORD(ret));
5114 todo_wine
5115  ok(HIWORD(ret) != 0, "Unexpected height %d.\n", HIWORD(ret));
5116 
5117  header_height = HIWORD(ret);
5118 
5120  ok(LOWORD(ret) == 0, "Unexpected width %d.\n", LOWORD(ret));
5121 todo_wine
5122  ok(HIWORD(ret) > header_height, "Unexpected height %d.\n", HIWORD(ret));
5123 
5124  item_height = HIWORD(ret) - header_height;
5125 
5127  ok(LOWORD(ret) == 0, "Unexpected width %d.\n", LOWORD(ret));
5128  ok(HIWORD(ret) == (header_height - 2 * item_height), "Unexpected height %d.\n", HIWORD(ret)) ;
5129 
5131  ok(LOWORD(ret) == 0, "Unexpected width %d.\n", LOWORD(ret));
5132  ok(HIWORD(ret) == header_height, "Unexpected height.\n");
5134  ok(LOWORD(ret) == 0, "Unexpected width %d.\n", LOWORD(ret));
5135  ok(HIWORD(ret) == header_height + 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5136 
5137  /* Insert column */
5138  col.mask = LVCF_TEXT | LVCF_WIDTH;
5139  col.pszText = column_header;
5140  col.cx = column_width;
5142  ok(ret == 0, "Unexpected return value %d.\n", ret);
5143 
5144  /* Empty control with column */
5146 todo_wine {
5147  ok(LOWORD(ret) >= column_width, "Unexpected width %d.\n", LOWORD(ret));
5148  ok(HIWORD(ret) != 0, "Unexpected height %d.\n", HIWORD(ret));
5149 }
5150  header_height = HIWORD(ret);
5151  item_width = LOWORD(ret);
5152 
5154  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5155 todo_wine
5156  ok(HIWORD(ret) > header_height, "Unexpected height %d.\n", HIWORD(ret));
5157 
5158  item_height = HIWORD(ret) - header_height;
5159 
5161  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5162  ok(HIWORD(ret) == header_height - 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5163 
5165  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5166  ok(HIWORD(ret) == header_height, "Unexpected height %d.\n", HIWORD(ret));
5167 
5169  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5170  ok(HIWORD(ret) == header_height + 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5171 
5172  for (item_count = 1; item_count <= 2; ++item_count)
5173  {
5174  itema.mask = LVIF_TEXT;
5175  itema.iItem = 0;
5176  itema.iSubItem = 0;
5177  itema.pszText = test;
5178  ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&itema);
5179  ok(ret == 0, "Unexpected return value %d.\n", ret);
5180 
5182  ok(LOWORD(ret) >= column_width, "Unexpected width %d.\n", LOWORD(ret));
5183  todo_wine
5184  ok(HIWORD(ret) != 0, "Unexpected height %d.\n", HIWORD(ret));
5185 
5186  header_height = HIWORD(ret);
5187  item_width = LOWORD(ret);
5188 
5190  ok(LOWORD(ret) == item_width, "Unexpected width %d, item %d\n", LOWORD(ret), item_count - 1);
5191  ok(HIWORD(ret) > header_height, "Unexpected height %d. item %d.\n", HIWORD(ret), item_count - 1);
5192 
5193  item_height = HIWORD(ret) - header_height;
5194 
5196  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5197  todo_wine
5198  ok(HIWORD(ret) == header_height - 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5199 
5201  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5202  ok(HIWORD(ret) == header_height + item_count * item_height, "Unexpected height %d.\n", HIWORD(ret));
5203 
5205  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5206  ok(HIWORD(ret) == header_height + 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5207 
5208  ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, 2, MAKELONG(item_width * 2, header_height + 3 * item_height));
5209  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5210  ok(HIWORD(ret) == header_height + 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5211 
5212  ret = SendMessageA(hwnd, LVM_APPROXIMATEVIEWRECT, -2, MAKELONG(item_width * 2, 0));
5213  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5214  todo_wine
5215  ok(HIWORD(ret) == header_height - 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5216 
5218  ok(LOWORD(ret) == item_width, "Unexpected width %d.\n", LOWORD(ret));
5219  todo_wine
5220  ok(HIWORD(ret) == header_height - 2 * item_height, "Unexpected height %d.\n", HIWORD(ret));
5221  }
5222 
5224 
5225 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define expect(expected, got)
Definition: listview.c:49
#define LVCF_WIDTH
Definition: commctrl.h:2583
#define LVCF_TEXT
Definition: commctrl.h:2584
int iImage
Definition: commctrl.h:2346
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVS_REPORT
Definition: commctrl.h:2258
char CHAR
Definition: xmlstorage.h:175
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
int iSubItem
Definition: commctrl.h:2341
#define LVM_APPROXIMATEVIEWRECT
Definition: commctrl.h:2774
#define test
Definition: rosglue.h:37
#define LVM_SETICONSPACING
Definition: commctrl.h:2717
#define LVM_SETITEMTEXTA
Definition: commctrl.h:2682
HIMAGELIST himl
BOOL WINAPI DestroyWindow(_In_ HWND)
LPSTR pszText
Definition: commctrl.h:2552
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVM_INSERTITEMA
Definition: commctrl.h:2399
#define MAKELONG(a, b)
Definition: typedefs.h:249
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static HBITMAP
Definition: listview.c:33
HBITMAP hbmp
LPSTR pszText
Definition: commctrl.h:2344
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
#define LVIF_IMAGE
Definition: commctrl.h:2306
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVS_ICON
Definition: commctrl.h:2257
int ret
#define todo_wine
Definition: test.h:162
UINT mask
Definition: commctrl.h:2339
#define LVM_SETIMAGELIST
Definition: commctrl.h:2299
#define ok(value,...)
Definition: atltest.h:57
#define HIWORD(l)
Definition: typedefs.h:247
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2627
#define LOWORD(l)
Definition: pedump.c:82
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

Referenced by START_TEST().

◆ test_callback_mask()

static void test_callback_mask ( void  )
static

Definition at line 6066 of file listview.c.

6067 {
6068  LVITEMA item;
6069  DWORD mask;
6070  HWND hwnd;
6071  BOOL ret;
6072 
6074 
6076  ok(ret, "got %d\n", ret);
6077 
6079  ok(ret, "got %d\n", ret);
6080 
6082  ok(mask == ~0u, "got 0x%08x\n", mask);
6083 
6085 
6086  /* LVS_OWNERDATA, mask LVIS_FOCUSED */
6088 
6090  ok(mask == 0, "Unexpected callback mask %#x.\n", mask);
6091 
6093  ok(ret, "Failed to set callback mask, %d\n", ret);
6094 
6096  ok(mask == LVIS_FOCUSED, "Unexpected callback mask %#x.\n", mask);
6097 
6099  ok(ret, "Failed to set item count.\n");
6100 
6102  ok(ret == -1, "Unexpected selection mark, %d\n", ret);
6103 
6104  item.stateMask = LVIS_FOCUSED;
6105  item.state = LVIS_FOCUSED;
6107  ok(ret, "Failed to set item state.\n");
6108 
6110 
6112 todo_wine
6113  ok(ret == 0, "Unexpected focused item, ret %d\n", ret);
6114 
6116 todo_wine
6117  ok(ret == 0, "Unexpected selection mark, %d\n", ret);
6118 
6120  ok(ret, "Failed to set item count.\n");
6121 
6123  ok(ret == -1, "Unexpected focused item, ret %d\n", ret);
6124 
6126  ok(ret == -1, "Unexpected selection mark, %d\n", ret);
6127 
6129  ok(ret, "Failed to set item count.\n");
6130 
6132  ok(ret == -1, "Unexpected focused item, ret %d\n", ret);
6133 
6134  ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 1", FALSE);
6135 
6136  /* LVS_OWNDERDATA, empty mask */
6138  ok(ret, "Failed to set callback mask, %d\n", ret);
6139 
6141  ok(ret, "Failed to set item count.\n");
6142 
6144  ok(ret == -1, "Unexpected selection mark, %d\n", ret);
6145 
6146  item.stateMask = LVIS_FOCUSED;
6147  item.state = LVIS_FOCUSED;
6149  ok(ret, "Failed to set item state.\n");
6150 
6152  ok(ret == 0, "Unexpected selection mark, %d\n", ret);
6153 
6155 
6157  ok(ret == 0, "Unexpected focused item, ret %d\n", ret);
6158 
6160  ok(ret, "Failed to set item count.\n");
6161 
6163  ok(ret == -1, "Unexpected focused item, ret %d\n", ret);
6164 
6166 todo_wine
6167  ok(ret == -1, "Unexpected selection mark, %d\n", ret);
6168 
6170  ok(ret, "Failed to set item count.\n");
6171 
6173  ok(ret == -1, "Unexpected focused item, ret %d\n", ret);
6174 
6175  ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 2", FALSE);
6176 
6177  /* 2 items, focus on index 0, reduce to 1 item. */
6179 
6181  ok(ret, "Failed to set item count.\n");
6182 
6184  ok(ret, "Failed to set item state.\n");
6185 
6187  ok(ret == 0, "Unexpected focused item, ret %d\n", ret);
6188 
6190  ok(ret, "Failed to set item count.\n");
6191 
6193  ok(ret == 0, "Unexpected focused item, ret %d\n", ret);
6194 
6196  "parent seq, owner data/focus 3", TRUE);
6197 
6199 }
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 * u
Definition: glfuncs.h:240
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static const struct message parent_focus_change_ownerdata_seq[]
Definition: listview.c:215
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVS_REPORT
Definition: commctrl.h:2258
#define LVM_SETCALLBACKMASK
Definition: commctrl.h:2415
BOOL WINAPI DestroyWindow(_In_ HWND)
GLenum GLint GLuint mask
Definition: glext.h:6028
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: windef.h:208
#define LVNI_FOCUSED
Definition: commctrl.h:2419
#define LVM_SETITEMCOUNT
Definition: commctrl.h:2692
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVM_GETCALLBACKMASK
Definition: commctrl.h:2412
int ret
#define LVM_SETITEMSTATE
Definition: commctrl.h:2668
#define todo_wine
Definition: test.h:162
#define LVM_GETSELECTIONMARK
Definition: commctrl.h:2784
#define LVS_OWNERDATA
Definition: commctrl.h:2270
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
static ATOM item
Definition: dde.c:856
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static const struct message empty_seq[]
Definition: listview.c:211
#define LVM_GETNEXTITEM
Definition: commctrl.h:2429
#define LVIS_FOCUSED
Definition: commctrl.h:2314

Referenced by START_TEST().

◆ test_CallBackCompare()

static INT WINAPI test_CallBackCompare ( LPARAM  first,
LPARAM  second,
LPARAM  lParam 
)
static

Definition at line 2891 of file listview.c.

2892 {
2893  if (first == second) return 0;
2894  return (first > second ? 1 : -1);
2895 }
const GLint * first
Definition: glext.h:5794

Referenced by test_sorting().

◆ test_canceleditlabel()

static void test_canceleditlabel ( void  )
static

Definition at line 4653 of file listview.c.

4654 {
4655  HWND hwnd, hwndedit;
4656  DWORD ret;
4657  CHAR buff[10];
4658  LVITEMA itema;
4659  static CHAR test[] = "test";
4660  static const CHAR test1[] = "test1";
4661 
4663  ok(hwnd != NULL, "failed to create a listview window\n");
4664 
4665  insert_item(hwnd, 0);
4666 
4667  /* try without edit created */
4670  expect(TRUE, ret);
4672  "cancel edit label without edit", FALSE);
4673 
4674  /* cancel without data change */
4675  SetFocus(hwnd);
4676  hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0);
4677  ok(IsWindow(hwndedit), "Expected edit control to be created\n");
4679  expect(TRUE, ret);
4680  ok(!IsWindow(hwndedit), "Expected edit control to be destroyed\n");
4681 
4682  /* cancel after data change */
4683  memset(&itema, 0, sizeof(itema));
4684  itema.pszText = test;
4685  ret = SendMessageA(hwnd, LVM_SETITEMTEXTA, 0, (LPARAM)&itema);
4686  expect(TRUE, ret);
4687  SetFocus(hwnd);
4688  hwndedit = (HWND)SendMessageA(hwnd, LVM_EDITLABELA, 0, 0);
4689  ok(IsWindow(hwndedit), "Expected edit control to be created\n");
4690  ret = SetWindowTextA(hwndedit, test1);
4691  expect(1, ret);
4693  expect(TRUE, ret);
4694  ok(!IsWindow(hwndedit), "Expected edit control to be destroyed\n");
4695  memset(&itema, 0, sizeof(itema));
4696  itema.pszText = buff;
4697  itema.cchTextMax = ARRAY_SIZE(buff);
4698  ret = SendMessageA(hwnd, LVM_GETITEMTEXTA, 0, (LPARAM)&itema);
4699  expect(5, ret);
4700  ok(strcmp(buff, test1) == 0, "Expected label text not to change\n");
4701 
4703 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define expect(expected, got)
Definition: listview.c:49
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVS_REPORT
Definition: commctrl.h:2258
char CHAR
Definition: xmlstorage.h:175
HANDLE HWND
Definition: compat.h:19
HWND WINAPI SetFocus(_In_opt_ HWND)
#define test
Definition: rosglue.h:37
#define LVM_SETITEMTEXTA
Definition: commctrl.h:2682
BOOL WINAPI DestroyWindow(_In_ HWND)
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
LPSTR pszText
Definition: commctrl.h:2344
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
void test1(void)
Definition: hivetest.c:366
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
int cchTextMax
Definition: commctrl.h:2345
#define LVM_CANCELEDITLABEL
Definition: commctrl.h:3008
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define LVS_EDITLABELS
Definition: commctrl.h:2269
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static void insert_item(HWND hwnd, int idx)
Definition: listview.c:1171
#define LVM_EDITLABELA
Definition: commctrl.h:2531
static const struct message empty_seq[]
Definition: listview.c:211
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define memset(x, y, z)
Definition: compat.h:39
static unsigned char buff[32768]
Definition: fatten.c:17
#define LVM_GETITEMTEXTA
Definition: commctrl.h:2675

Referenced by START_TEST().

◆ test_checkboxes()

static void test_checkboxes ( void  )
static

Definition at line 961 of file listview.c.

962 {
963  HWND hwnd;
964  LVITEMA item;
965  DWORD r;
966  static CHAR text[] = "Text",
967  text2[] = "Text2",
968  text3[] = "Text3";
969 
971  10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
972  ok(hwnd != NULL, "failed to create listview window\n");
973 
974  /* first without LVS_EX_CHECKBOXES set and an item and check that state is preserved */
975  item.mask = LVIF_TEXT | LVIF_STATE;
976  item.stateMask = 0xffff;
977  item.state = 0xfccc;
978  item.iItem = 0;
979  item.iSubItem = 0;
980  item.pszText = text;
982  expect(0, r);
983 
984  item.iItem = 0;
985  item.mask = LVIF_STATE;
986  item.stateMask = 0xffff;
988  expect(1, r);
989  ok(item.state == 0xfccc, "state %x\n", item.state);
990 
991  /* Don't set LVIF_STATE */
992  item.mask = LVIF_TEXT;
993  item.stateMask = 0xffff;
994  item.state = 0xfccc;
995  item.iItem = 1;
996  item.iSubItem = 0;
997  item.pszText = text;
999  expect(1, r);
1000 
1001  item.iItem = 1;
1002  item.mask = LVIF_STATE;
1003  item.stateMask = 0xffff;
1005  expect(1, r);
1006  ok(item.state == 0, "state %x\n", item.state);
1007 
1009  expect(0, r);
1010 
1011  /* Having turned on checkboxes, check that all existing items are set to 0x1000 (unchecked) */
1012  item.iItem = 0;
1013  item.mask = LVIF_STATE;
1014  item.stateMask = 0xffff;
1016  expect(1, r);
1017  if (item.state != 0x1ccc)
1018  {
1019  win_skip("LVS_EX_CHECKBOXES style is unavailable. Skipping.\n");
1021  return;
1022  }
1023 
1024  /* Now add an item without specifying a state and check that its state goes to 0x1000 */
1025  item.iItem = 2;
1026  item.mask = LVIF_TEXT;
1027  item.state = 0;
1028  item.pszText = text2;
1030  expect(2, r);
1031 
1032  item.iItem = 2;
1033  item.mask = LVIF_STATE;
1034  item.stateMask = 0xffff;
1036  expect(1, r);
1037  ok(item.state == 0x1000, "state %x\n", item.state);
1038 
1039  /* Add a further item this time specifying a state and still its state goes to 0x1000 */
1040  item.iItem = 3;
1041  item.mask = LVIF_TEXT | LVIF_STATE;
1042  item.stateMask = 0xffff;
1043  item.state = 0x2aaa;
1044  item.pszText = text3;
1046  expect(3, r);
1047 
1048  item.iItem = 3;
1049  item.mask = LVIF_STATE;
1050  item.stateMask = 0xffff;
1052  expect(1, r);
1053  ok(item.state == 0x1aaa, "state %x\n", item.state);
1054 
1055  /* Set an item's state to checked */
1056  item.iItem = 3;
1057  item.mask = LVIF_STATE;
1058  item.stateMask = 0xf000;
1059  item.state = 0x2000;
1061  expect(1, r);
1062 
1063  item.iItem = 3;
1064  item.mask = LVIF_STATE;
1065  item.stateMask = 0xffff;
1067  expect(1, r);
1068  ok(item.state == 0x2aaa, "state %x\n", item.state);
1069 
1070  /* Check that only the bits we asked for are returned,
1071  * and that all the others are set to zero
1072  */
1073  item.iItem = 3;
1074  item.mask = LVIF_STATE;
1075  item.stateMask = 0xf000;
1076  item.state = 0xffff;
1078  expect(1, r);
1079  ok(item.state == 0x2000, "state %x\n", item.state);
1080 
1081  /* Set the style again and check that doesn't change an item's state */
1083  ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r);
1084 
1085  item.iItem = 3;
1086  item.mask = LVIF_STATE;
1087  item.stateMask = 0xffff;
1089  expect(1, r);
1090  ok(item.state == 0x2aaa, "state %x\n", item.state);
1091 
1092  /* Unsetting the checkbox extended style doesn't change an item's state */
1094  ok(r == LVS_EX_CHECKBOXES, "ret %x\n", r);
1095 
1096  item.iItem = 3;
1097  item.mask = LVIF_STATE;
1098  item.stateMask = 0xffff;
1100  expect(1, r);
1101  ok(item.state == 0x2aaa, "state %x\n", item.state);
1102 
1103  /* Now setting the style again will change an item's state */
1105  expect(0, r);
1106 
1107  item.iItem = 3;
1108  item.mask = LVIF_STATE;
1109  item.stateMask = 0xffff;
1111  expect(1, r);
1112  ok(item.state == 0x1aaa, "state %x\n", item.state);
1113 
1114  /* Toggle checkbox tests (bug 9934) */
1115  memset (&item, 0xcc, sizeof(item));
1116  item.mask = LVIF_STATE;
1117  item.iItem = 3;
1118  item.iSubItem = 0;
1119  item.state = LVIS_FOCUSED;
1120  item.stateMask = LVIS_FOCUSED;
1122  expect(1, r);
1123 
1124  item.iItem = 3;
1125  item.mask = LVIF_STATE;
1126  item.stateMask = 0xffff;
1128  expect(1, r);
1129  ok(item.state == 0x1aab, "state %x\n", item.state);
1130 
1132  expect(0, r);
1134  expect(0, r);
1135 
1136  item.iItem = 3;
1137  item.mask = LVIF_STATE;
1138  item.stateMask = 0xffff;
1140  expect(1, r);
1141  ok(item.state == 0x2aab, "state %x\n", item.state);
1142 
1144  expect(0, r);
1146  expect(0, r);
1147 
1148  item.iItem = 3;
1149  item.mask = LVIF_STATE;
1150  item.stateMask = 0xffff;
1152  expect(1, r);
1153  ok(item.state == 0x1aab, "state %x\n", item.state);
1154 
1156 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define expect(expected, got)
Definition: listview.c:49
static HWND hwndparent
Definition: listview.c:56
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LVS_REPORT
Definition: commctrl.h:2258
const WCHAR * text
Definition: package.c:1827
char CHAR
Definition: xmlstorage.h:175
#define WC_LISTVIEWA
Definition: commctrl.h:2252
BOOL WINAPI DestroyWindow(_In_ HWND)
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVM_INSERTITEMA
Definition: commctrl.h:2399
smooth NULL
Definition: ftsmooth.c:416
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_KEYUP
Definition: winuser.h:1698
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2720
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2727
static ATOM item
Definition: dde.c:856
#define ok(value,...)
Definition: atltest.h:57
#define LVM_SETITEMA
Definition: commctrl.h:2392
#define VK_SPACE
Definition: winuser.h:2194
#define LVM_GETITEMA
Definition: commctrl.h:2385
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 LVIF_STATE
Definition: commctrl.h:2308
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:149
#define LVIS_FOCUSED
Definition: commctrl.h:2314

Referenced by START_TEST().

◆ test_color()

static void test_color ( void  )
static

Definition at line 2013 of file listview.c.

2014 {
2015  RECT rect;
2016  HWND hwnd;
2017  DWORD r;
2018  int i;
2019 
2020  COLORREF color;
2021  COLORREF colors[4] = {RGB(0,0,0), RGB(100,50,200), CLR_NONE, RGB(255,255,255)};
2022 
2024  ok(hwnd != NULL, "failed to create a listview window\n");
2025 
2027 
2028  for (i = 0; i < 4; i++)
2029  {
2030  color = colors[i];
2031 
2033  expect(TRUE, r);
2034  r = SendMessageA(hwnd, LVM_GETBKCOLOR, 0, 0);
2035  expect(color, r);
2036 
2038  expect (TRUE, r);
2039  r = SendMessageA(hwnd, LVM_GETTEXTCOLOR, 0, 0);
2040  expect(color, r);
2041 
2043  expect(TRUE, r);
2045  expect(color, r);
2046  }
2047 
2050 
2051  /* invalidation test done separately to avoid a message chain mess */
2052  r = ValidateRect(hwnd, NULL);
2053  expect(TRUE, r);
2054  r = SendMessageA(hwnd, LVM_SETBKCOLOR, 0, colors[0]);
2055  expect(TRUE, r);
2056 
2057  rect.right = rect.bottom = 1;
2058  r = GetUpdateRect(hwnd, &rect, TRUE);
2059  todo_wine expect(FALSE, r);
2060  ok(rect.right == 0 && rect.bottom == 0, "got update rectangle\n");
2061 
2062  r = ValidateRect(hwnd, NULL);
2063  expect(TRUE, r);
2064  r = SendMessageA(hwnd, LVM_SETTEXTCOLOR, 0, colors[0]);
2065  expect(TRUE, r);
2066 
2067  rect.right = rect.bottom = 1;
2068  r = GetUpdateRect(hwnd, &rect, TRUE);
2069  todo_wine expect(FALSE, r);
2070  ok(rect.right == 0 && rect.bottom == 0, "got update rectangle\n");
2071 
2072  r = ValidateRect(hwnd, NULL);
2073  expect(TRUE, r);
2074  r = SendMessageA(hwnd, LVM_SETTEXTBKCOLOR, 0, colors[0]);
2075  expect(TRUE, r);
2076 
2077  rect.right = rect.bottom = 1;
2078  r = GetUpdateRect(hwnd, &rect, TRUE);
2079  todo_wine expect(FALSE, r);
2080  ok(rect.right == 0 && rect.bottom == 0, "got update rectangle\n");
2081 
2083 }
#define LVM_SETTEXTCOLOR
Definition: commctrl.h:2654
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define expect(expected, got)
Definition: listview.c:49
static const struct message listview_color_seq[]
Definition: listview.c:123
#define RGB(r, g, b)
Definition: precomp.h:62
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LVS_REPORT
Definition: commctrl.h:2258
BOOL WINAPI DestroyWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
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 FALSE
Definition: types.h:117
GLuint color
Definition: glext.h:6243
smooth NULL
Definition: ftsmooth.c:416
#define CLR_NONE
Definition: commctrl.h:315
#define LVM_SETBKCOLOR
Definition: commctrl.h:2289
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
DWORD COLORREF
Definition: windef.h:300
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVM_SETTEXTBKCOLOR
Definition: commctrl.h:2658
#define LVM_GETBKCOLOR
Definition: commctrl.h:2287
#define todo_wine
Definition: test.h:162
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define LVM_GETTEXTBKCOLOR
Definition: commctrl.h:2656
#define LVM_GETTEXTCOLOR
Definition: commctrl.h:2652

Referenced by START_TEST().

◆ test_columns()

static void test_columns ( void  )
static

Definition at line 1445 of file listview.c.

1446 {
1447  HWND hwnd, header;
1448  LVCOLUMNA column;
1449  LVITEMA item;
1450  INT order[2];
1451  CHAR buff[5];
1452  DWORD rc;
1453 
1455  10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
1456  ok(hwnd != NULL, "failed to create listview window\n");
1457 
1459  ok(header == NULL, "got %p\n", header);
1460 
1462  ok(rc == 0, "got %d\n", rc);
1463 
1465  ok(header == NULL, "got %p\n", header);
1466 
1468 
1470  10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
1471  ok(hwnd != NULL, "failed to create listview window\n");
1472 
1473  rc = SendMessageA(hwnd, LVM_DELETECOLUMN, -1, 0);
1474  ok(!rc, "got %d\n", rc);
1475 
1476  rc = SendMessageA(hwnd, LVM_DELETECOLUMN, 0, 0);
1477  ok(!rc, "got %d\n", rc);
1478 
1479  /* Add a column with no mask */
1480  memset(&column, 0xcc, sizeof(column));
1481  column.mask = 0;
1483  ok(rc == 0, "Inserting column with no mask failed with %d\n", rc);
1484 
1485  /* Check its width */
1486  rc = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0);
1487  ok(rc == 10, "Inserting column with no mask failed to set width to 10 with %d\n", rc);
1488 
1490 
1491  /* LVM_GETCOLUMNORDERARRAY */
1494 
1495  memset(&column, 0, sizeof(column));
1496  column.mask = LVCF_WIDTH;
1497  column.cx = 100;
1499  expect(0, rc);
1500 
1501  column.cx = 200;
1503  expect(1, rc);
1504 
1506 
1508  expect(1, rc);
1509  ok(order[0] == 0, "Expected order 0, got %d\n", order[0]);
1510  ok(order[1] == 1, "Expected order 1, got %d\n", order[1]);
1511 
1513  expect(0, rc);
1514 
1516 
1517  /* LVM_SETCOLUMNORDERARRAY */
1519 
1520  order[0] = 0;
1521  order[1] = 1;
1523  expect(1, rc);
1524 
1526  expect(0, rc);
1527 
1529 
1530  /* after column added subitem is considered as present */
1531  insert_item(hwnd, 0);
1532 
1534 
1535  item.pszText = buff;
1536  item.cchTextMax = sizeof(buff);
1537  item.iItem = 0;
1538  item.iSubItem = 1;
1539  item.mask = LVIF_TEXT;
1540  memset(&g_itema, 0, sizeof(g_itema));
1541  rc = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item);
1542  expect(1, rc);
1543  ok(g_itema.iSubItem == 1, "got %d\n", g_itema.iSubItem);
1544 
1546  "get subitem text after column added", FALSE);
1547 
1549 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define expect(expected, got)
Definition: listview.c:49
static HWND hwndparent
Definition: listview.c:56
#define LVCF_WIDTH
Definition: commctrl.h:2583
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LVS_REPORT
Definition: commctrl.h:2258
static LVITEMA g_itema
Definition: listview.c:71
char CHAR
Definition: xmlstorage.h:175
int iSubItem
Definition: commctrl.h:2341
HANDLE HWND
Definition: compat.h:19
#define WC_LISTVIEWA
Definition: commctrl.h:2252
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:58
static const struct message listview_getorderarray_seq[]
Definition: listview.c:195
#define LVIF_TEXT
Definition: commctrl.h:2305
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static const struct message single_getdispinfo_parent_seq[]
Definition: listview.c:285
static const struct message listview_setorderarray_seq[]
Definition: listview.c:203
#define LVS_LIST
Definition: commctrl.h:2260
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVM_GETCOLUMNORDERARRAY
Definition: commctrl.h:2764
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
static ATOM item
Definition: dde.c:856
static HWND subclass_header(HWND hwndListview)
Definition: listview.c:772
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static void insert_item(HWND hwnd, int idx)
Definition: listview.c:1171
#define LVM_DELETECOLUMN
Definition: commctrl.h:2634
#define LVM_GETHEADER
Definition: commctrl.h:2646
#define LVM_GETITEMA
Definition: commctrl.h:2385
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)
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define LVM_SETCOLUMNORDERARRAY
Definition: commctrl.h:2762
#define LVM_GETCOLUMNWIDTH
Definition: commctrl.h:2637
#define memset(x, y, z)
Definition: compat.h:39
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2627
static unsigned char buff[32768]
Definition: fatten.c:17
struct CFHEADER header
Definition: fdi.c:101

Referenced by START_TEST().

◆ test_columnscreation()

static void test_columnscreation ( void  )
static

Definition at line 3959 of file listview.c.

3960 {
3961  HWND hwnd, header;
3962  DWORD r;
3963 
3965  ok(hwnd != NULL, "failed to create a listview window\n");
3966 
3967  insert_item(hwnd, 0);
3968 
3969  /* headers columns aren't created automatically */
3971  ok(IsWindow(header), "Expected header handle\n");
3973  expect(0, r);
3974 
3976 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define expect(expected, got)
Definition: listview.c:49
BOOL WINAPI IsWindow(_In_opt_ HWND)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LVS_REPORT
Definition: commctrl.h:2258
HANDLE HWND
Definition: compat.h:19
BOOL WINAPI DestroyWindow(_In_ HWND)
#define HDM_GETITEMCOUNT
Definition: commctrl.h:729
smooth NULL
Definition: ftsmooth.c:416
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ok(value,...)
Definition: atltest.h:57
static void insert_item(HWND hwnd, int idx)
Definition: listview.c:1171
#define LVM_GETHEADER
Definition: commctrl.h:2646
struct CFHEADER header
Definition: fdi.c:101

Referenced by START_TEST().

◆ test_create()

static void test_create ( BOOL  is_version_6)
static

Definition at line 1590 of file listview.c.

1591 {
1592  static const WCHAR testtextW[] = {'t','e','s','t',' ','t','e','x','t',0};
1593  char buff[16];
1594  HWND hList;
1595  HWND hHeader;
1596  LONG_PTR ret;
1597  LONG r;
1598  LVCOLUMNA col;
1599  RECT rect;
1600  WNDCLASSEXA cls;
1601  DWORD style;
1602  ATOM class;
1603 
1604  if (is_win_xp() && is_version_6)
1605  {
1606  win_skip("Skipping some tests on XP.\n");
1607  return;
1608  }
1609 
1610  cls.cbSize = sizeof(WNDCLASSEXA);
1612  ok(r, "Failed to get class info.\n");
1615  cls.lpszClassName = "MyListView32";
1616  class = RegisterClassExA(&cls);
1617  ok(class, "Failed to register class.\n");
1618 
1619  test_create_imagelist = pImageList_Create(16, 16, 0, 5, 10);
1620  hList = CreateWindowA("MyListView32", "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0);
1621  ok((HIMAGELIST)SendMessageA(hList, LVM_GETIMAGELIST, 0, 0) == test_create_imagelist, "Image list not obtained\n");
1622  hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0);
1623  ok(IsWindow(hHeader) && IsWindowVisible(hHeader), "Listview not in report mode\n");
1624  ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
1626 
1627  /* header isn't created on LVS_ICON and LVS_LIST styles */
1628  hList = CreateWindowA(WC_LISTVIEWA, "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0);
1630 
1631  /* insert column */
1632  memset(&col, 0, sizeof(LVCOLUMNA));
1633  col.mask = LVCF_WIDTH;
1634  col.cx = 100;
1636  expect(0, r);
1638  hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0);
1639  style = GetWindowLongA(hHeader, GWL_STYLE);
1640  ok(!(style & HDS_HIDDEN), "Not expected HDS_HIDDEN\n");
1642 
1643  hList = CreateWindowA(WC_LISTVIEWA, "Test", WS_VISIBLE|LVS_LIST, 0, 0, 100, 100, NULL, NULL,
1644  GetModuleHandleA(NULL), 0);
1646  /* insert column */
1647  memset(&col, 0, sizeof(LVCOLUMNA));
1648  col.mask = LVCF_WIDTH;
1649  col.cx = 100;
1651  expect(0, r);
1654 
1655  /* try to switch LVS_ICON -> LVS_REPORT and back LVS_ICON -> LVS_REPORT */
1656  hList = CreateWindowA(WC_LISTVIEWA, "Test", WS_VISIBLE, 0, 0, 100, 100, NULL, NULL,
1657  GetModuleHandleA(NULL), 0);
1659  ok(ret & WS_VISIBLE, "Style wrong, should have WS_VISIBLE\n");
1662  ok((ret & WS_VISIBLE) && (ret & LVS_REPORT), "Style wrong, should have WS_VISIBLE|LVS_REPORT\n");
1665 
1666  /* try to switch LVS_LIST -> LVS_REPORT and back LVS_LIST -> LVS_REPORT */
1667  hList = CreateWindowA(WC_LISTVIEWA, "Test", WS_VISIBLE|LVS_LIST, 0, 0, 100, 100, NULL, NULL,
1668  GetModuleHandleA(NULL), 0);
1671  ok(((ret & WS_VISIBLE) && (ret & LVS_LIST)), "Style wrong, should have WS_VISIBLE|LVS_LIST\n");
1674  ok(((ret & WS_VISIBLE) && (ret & LVS_REPORT)), "Style wrong, should have WS_VISIBLE|LVS_REPORT\n");
1677 
1678  /* LVS_REPORT without WS_VISIBLE */
1679  hList = CreateWindowA(WC_LISTVIEWA, "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL,
1680  GetModuleHandleA(NULL), 0);
1681  hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0);
1682 todo_wine_if(is_version_6)
1683  TEST_NO_HEADER2(hList, is_version_6);
1684 
1685  /* insert column */
1686  memset(&col, 0, sizeof(LVCOLUMNA));
1687  col.mask = LVCF_WIDTH;
1688  col.cx = 100;
1690  expect(0, r);
1693 
1694  /* LVS_REPORT without WS_VISIBLE, try to show it */
1695  hList = CreateWindowA(WC_LISTVIEWA, "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL,
1696  GetModuleHandleA(NULL), 0);
1697 todo_wine_if(is_version_6)
1698  TEST_NO_HEADER2(hList, is_version_6);
1699 
1703 
1704  /* LVS_REPORT with LVS_NOCOLUMNHEADER */
1706  0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0);
1708  hHeader = (HWND)SendMessageA(hList, LVM_GETHEADER, 0, 0);
1709  /* HDS_DRAGDROP set by default */
1710  ok(GetWindowLongPtrA(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n");
1712 
1713  /* setting LVS_EX_HEADERDRAGDROP creates header */
1714  hList = CreateWindowA(WC_LISTVIEWA, "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL,
1715  GetModuleHandleA(NULL), 0);
1716 todo_wine_if(is_version_6)
1717  TEST_NO_HEADER2(hList, is_version_6);
1718 
1722 
1723  /* setting LVS_EX_GRIDLINES creates header */
1724  hList = CreateWindowA(WC_LISTVIEWA, "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL,
1725  GetModuleHandleA(NULL), 0);
1726 todo_wine_if(is_version_6)
1727  TEST_NO_HEADER2(hList, is_version_6);
1728 
1732 
1733  /* setting LVS_EX_FULLROWSELECT creates header */
1734  hList = CreateWindowA(WC_LISTVIEWA, "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL,
1735  GetModuleHandleA(NULL), 0);
1736 todo_wine_if(is_version_6)
1737  TEST_NO_HEADER2(hList, is_version_6);
1741 
1742  /* not report style accepts LVS_EX_HEADERDRAGDROP too */
1746  ok(r & LVS_EX_HEADERDRAGDROP, "Expected LVS_EX_HEADERDRAGDROP to be set\n");
1748 
1749  /* requesting header info with LVM_GETSUBITEMRECT doesn't create it */
1750  hList = CreateWindowA(WC_LISTVIEWA, "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL,
1751  GetModuleHandleA(NULL), 0);
1752 todo_wine_if(is_version_6)
1753  TEST_NO_HEADER2(hList, is_version_6);
1754 
1755  SetRect(&rect, LVIR_BOUNDS, 1, -10, -10);
1757  ok(r == 1, "Unexpected ret value %d.\n", r);
1758  /* right value contains garbage, probably because header columns are not set up */
1759  ok(rect.bottom >= 0, "Unexpected rectangle.\n");
1760 
1761 todo_wine_if(is_version_6)
1762  TEST_NO_HEADER2(hList, is_version_6);
1764 
1765  /* WM_MEASUREITEM should be sent when created with LVS_OWNERDRAWFIXED */
1769  "created with LVS_OWNERDRAWFIXED|LVS_REPORT - parent seq", FALSE);
1771 
1772  /* Test that window text is preserved. */
1774  0, 0, 100, 100, hwndparent, NULL, GetModuleHandleA(NULL), NULL);
1775  ok(hList != NULL, "Failed to create ListView window.\n");
1776  *buff = 0;
1777  GetWindowTextA(hList, buff, sizeof(buff));
1778  ok(!strcmp(buff, "test text"), "Unexpected window text %s.\n", buff);
1780 
1782  0, 0, 100, 100, hwndparent, NULL, GetModuleHandleA(NULL), NULL);
1783  ok(hList != NULL, "Failed to create ListView window.\n");
1784  *buff = 0;
1785  GetWindowTextA(hList, buff, sizeof(buff));
1786  ok(!strcmp(buff, "test text"), "Unexpected window text %s.\n", buff);
1788 
1789  r = UnregisterClassA("MyListView32", NULL);
1790  ok(r, "Failed to unregister test class.\n");
1791 }
struct _WNDCLASSEXA WNDCLASSEXA
#define expect(expected, got)
Definition: listview.c:49
static HWND hwndparent
Definition: listview.c:56
#define LVCF_WIDTH
Definition: commctrl.h:2583
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1330
WNDPROC lpfnWndProc
Definition: winuser.h:3178
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2280
#define LVM_GETIMAGELIST
Definition: commctrl.h:2291
LPCSTR lpszClassName
Definition: winuser.h:3186
WORD ATOM
Definition: dimm.idl:113
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LVS_REPORT
Definition: commctrl.h:2258
#define WC_LISTVIEWW
Definition: commctrl.h:2253
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2730
HANDLE HWND
Definition: compat.h:19
#define LVM_GETSUBITEMRECT
Definition: commctrl.h:2758
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WC_LISTVIEWA
Definition: commctrl.h:2252
BOOL WINAPI DestroyWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
#define FALSE
Definition: types.h:117
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
long LONG
Definition: pedump.c:60
static LRESULT CALLBACK create_test_wndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: listview.c:1555
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
#define LVS_EX_HEADERDRAGDROP
Definition: commctrl.h:2729
#define HDS_DRAGDROP
Definition: commctrl.h:628
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
UINT cbSize
Definition: winuser.h:3176
#define LVS_LIST
Definition: commctrl.h:2260
#define SW_SHOW
Definition: winuser.h:769
#define GetWindowLongPtrA
Definition: winuser.h:4803
#define todo_wine_if(is_todo)
Definition: test.h:163
static HIMAGELIST test_create_imagelist
Definition: listview.c:1553
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HWND create_listview_control(DWORD style)
Definition: listview.c:690
#define HDS_HIDDEN
Definition: commctrl.h:627
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
#define TEST_NO_HEADER2(a, b)
Definition: listview.c:1572
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL is_win_xp(void)
Definition: listview.c:736
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2720
#define LVS_EX_GRIDLINES
Definition: commctrl.h:2725
#define LVS_ICON
Definition: commctrl.h:2257
static WNDPROC listviewWndProc
Definition: listview.c:1552
int ret
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR 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 SetWindowLongPtrA
Definition: winuser.h:5320
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
static const struct message create_ownerdrawfixed_parent_seq[]
Definition: listview.c:97
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
#define LVM_GETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2723
#define GWL_STYLE
Definition: winuser.h:846
static const WCHAR testtextW[]
Definition: dialog.c:1384
HWND hList
Definition: livecd.c:10
BOOL WINAPI GetClassInfoExA(_In_opt_ HINSTANCE, _In_ LPCSTR, _Out_ LPWNDCLASSEXA)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define LVIR_BOUNDS
Definition: commctrl.h:2468
#define WS_BORDER
Definition: pedump.c:625
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: listview.c:95
#define TEST_NO_HEADER(a)
Definition: listview.c:1570
#define ok(value,...)
Definition: atltest.h:57
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define TEST_HEADER_EXPECTED(a)
Definition: listview.c:1571
#define LVM_GETHEADER
Definition: commctrl.h:2646
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI IsWindowVisible(_In_ HWND)
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620