ReactOS  0.4.13-dev-687-g023794c
header.c File Reference
#include <windows.h>
#include <commctrl.h>
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
Include dependency graph for header.c:

Go to the source code of this file.

Classes

struct  tagEXPECTEDNOTIFY
 

Macros

#define MAX_CHARS   100
 
#define compare(val, exp, fmt)   ok((val) == (exp), #val " value: " fmt ", expected: " fmt "\n", (val), (exp))
 
#define expect(expected, got)   ok(expected == got, "expected %d, got %d\n", expected,got)
 
#define NUM_MSG_SEQUENCES   2
 
#define PARENT_SEQ_INDEX   0
 
#define HEADER_SEQ_INDEX   1
 
#define TEST_GET_ITEM(i, c)
 
#define TEST_GET_ITEMCOUNT(i)
 
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
 
#define X(f)   p##f = (void*)GetProcAddress(hComCtl32, #f);
 

Typedefs

typedef struct tagEXPECTEDNOTIFY EXPECTEDNOTIFY
 
typedef LRESULT(* CUSTOMDRAWPROC) (int n, NMCUSTOMDRAW *nm)
 

Functions

static HIMAGELIST (WINAPI *pImageList_Create)(int
 
static BOOL (WINAPI *pImageList_Destroy)(HIMAGELIST)
 
static void expect_notify (INT iCode, BOOL fUnicode, HDITEMA *lpItem)
 
static void dont_expect_notify (INT iCode)
 
static BOOL notifies_received (void)
 
static LONG addItem (HWND hdex, int idx, LPSTR text)
 
static LONG setItem (HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
 
static LONG setItemUnicodeNotify (HWND hdex, int idx, LPSTR text, LPWSTR wText)
 
static LONG delItem (HWND hdex, int idx)
 
static LONG getItemCount (HWND hdex)
 
static LONG getItem (HWND hdex, int idx, LPSTR textBuffer)
 
static void addReadDelItem (HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
 
static HWND create_header_control (void)
 
static void compare_items (INT iCode, HDITEMA *hdi1, HDITEMA *hdi2, BOOL fUnicode)
 
static LRESULT WINAPI header_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI parent_wnd_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL register_parent_wnd_class (void)
 
static HWND create_custom_parent_window (void)
 
static HWND create_custom_header_control (HWND hParent, BOOL preloadHeaderItems)
 
static void header_item_getback (HWND hwnd, UINT mask, HDITEMA *item)
 
static void test_item_auto_format (HWND parent)
 
static void check_auto_fields (void)
 
static void check_mask (void)
 
static void test_header_control (void)
 
static void test_hdm_getitemrect (HWND hParent)
 
static void test_hdm_layout (HWND hParent)
 
static void test_hdm_ordertoindex (HWND hParent)
 
static void test_hdm_hittest (HWND hParent)
 
static void test_hdm_sethotdivider (HWND hParent)
 
static void test_hdm_imageMessages (HWND hParent)
 
static void test_hdm_filterMessages (HWND hParent)
 
static void test_hdm_unicodeformatMessages (HWND hParent)
 
static void test_hdm_bitmapmarginMessages (HWND hParent)
 
static void test_hdm_index_messages (HWND hParent)
 
static void test_hdf_fixedwidth (HWND hParent)
 
static void test_hds_nosizing (HWND hParent)
 
static LRESULT customdraw_1 (int n, NMCUSTOMDRAW *nm)
 
static LRESULT customdraw_2 (int n, NMCUSTOMDRAW *nm)
 
static LRESULT customdraw_3 (int n, NMCUSTOMDRAW *nm)
 
static LRESULT customdraw_4 (int n, NMCUSTOMDRAW *nm)
 
static void run_customdraw_scenario (CUSTOMDRAWPROC proc)
 
static void test_customdraw (void)
 
static void check_order (const int expected_id[], const int expected_order[], int count, const char *type)
 
static void test_header_order (void)
 
static LRESULT CALLBACK HeaderTestWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void init_functions (void)
 
static BOOL init (void)
 
static void check_orderarray (HWND hwnd, DWORD start, DWORD set, DWORD expected, BOOL todo, int line)
 
static void test_hdm_orderarray (void)
 
 START_TEST (header)
 

Variables

static int
 
static UINT
 
static CUSTOMDRAWPROC g_CustomDrawProc
 
static int g_CustomDrawCount
 
static DRAWITEMSTRUCT g_DrawItem
 
static BOOL g_DrawItemReceived
 
static DWORD g_customheight
 
static EXPECTEDNOTIFY expectedNotify [10]
 
static INT nExpectedNotify = 0
 
static INT nReceivedNotify = 0
 
static INT unexpectedNotify [10]
 
static INT nUnexpectedNotify = 0
 
static HWND hHeaderParentWnd
 
static HWND hWndHeader
 
static struct msg_sequencesequences [NUM_MSG_SEQUENCES]
 
static const struct message create_parent_wnd_seq []
 
static const struct message add_header_to_parent_seq_interactive []
 
static const struct message add_header_to_parent_seq []
 
static const struct message insertItem_seq []
 
static const struct message getItem_seq []
 
static const struct message deleteItem_getItemCount_seq []
 
static const struct message orderArray_seq []
 
static const struct message setItem_seq []
 
static const struct message getItemRect_seq []
 
static const struct message layout_seq []
 
static const struct message orderToIndex_seq []
 
static const struct message hittest_seq []
 
static const struct message setHotDivider_seq_interactive []
 
static const struct message setHotDivider_seq_noninteractive []
 
static const struct message imageMessages_seq []
 
static const struct message filterMessages_seq_interactive []
 
static const struct message filterMessages_seq_noninteractive []
 
static const struct message unicodeformatMessages_seq []
 
static const struct message bitmapmarginMessages_seq []
 
static char pszFirstItem [] = "First Item"
 
static char pszSecondItem [] = "Second Item"
 
static char pszThirdItem [] = "Third Item"
 
static char pszFourthItem [] = "Fourth Item"
 
static char pszReplaceItem [] = "Replace Item"
 
static char pszOutOfRangeItem [] = "Out Of Range Item"
 
static charstr_items []
 
static char pszUniTestA [] = "TST"
 
static WCHAR pszUniTestW [] = {'T','S','T',0}
 

Macro Definition Documentation

◆ compare

#define compare (   val,
  exp,
  fmt 
)    ok((val) == (exp), #val " value: " fmt ", expected: " fmt "\n", (val), (exp))

Definition at line 57 of file header.c.

◆ expect

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

Definition at line 59 of file header.c.

◆ HEADER_SEQ_INDEX

#define HEADER_SEQ_INDEX   1

Definition at line 63 of file header.c.

◆ MAX_CHARS

#define MAX_CHARS   100

Definition at line 55 of file header.c.

◆ NUM_MSG_SEQUENCES

#define NUM_MSG_SEQUENCES   2

Definition at line 61 of file header.c.

◆ PARENT_SEQ_INDEX

#define PARENT_SEQ_INDEX   0

Definition at line 62 of file header.c.

◆ TEST_GET_ITEM

#define TEST_GET_ITEM (   i,
  c 
)
Value:
ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%d)\n", i, res);\
ok(strcmp(str_items[c], buffer) == 0, "Getting item[%d] returned \"%s\" expecting \"%s\"\n", i, buffer, str_items[c]);\
}
static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
Definition: header.c:303
GLuint buffer
Definition: glext.h:5915
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
const GLubyte * c
Definition: glext.h:8905
static HWND hWndHeader
Definition: header.c:54
GLuint res
Definition: glext.h:9613
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static char * str_items[]
Definition: header.c:387

Definition at line 394 of file header.c.

◆ TEST_GET_ITEMCOUNT

#define TEST_GET_ITEMCOUNT (   i)
Value:
ok(res == i, "Got Item Count as %d\n", res);\
}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HWND hWndHeader
Definition: header.c:54
static LONG getItemCount(HWND hdex)
Definition: header.c:298
GLuint res
Definition: glext.h:9613

Definition at line 400 of file header.c.

◆ TEST_NMCUSTOMDRAW

#define TEST_NMCUSTOMDRAW (   draw_stage,
  item_spec,
  lparam,
  _left,
  _top,
  _right,
  _bottom 
)
Value:
ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %d\n", draw_stage, nm->dwDrawStage); \
if (item_spec != -1) \
ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %ld\n", item_spec, nm->dwItemSpec); \
ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %ld\n", lparam, nm->lItemlParam); \
ok((nm->rc.top == _top && nm->rc.bottom == _bottom && nm->rc.left == _left && nm->rc.right == _right) || \
broken(draw_stage != CDDS_ITEMPREPAINT), /* comctl32 < 5.80 */ \
"Invalid rect (%d,%d)-(%d,%d) vs %s\n", _left, _top, _right, _bottom, \
wine_dbgstr_rect(&nm->rc));
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:270
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ok(value,...)
const char * wine_dbgstr_rect(const RECT *rect)
#define broken(x)
Definition: _sntprintf.h:21

Definition at line 1368 of file header.c.

◆ X

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

Typedef Documentation

◆ CUSTOMDRAWPROC

typedef LRESULT(* CUSTOMDRAWPROC) (int n, NMCUSTOMDRAW *nm)

Definition at line 39 of file header.c.

◆ EXPECTEDNOTIFY

Function Documentation

◆ addItem()

static LONG addItem ( HWND  hdex,
int  idx,
LPSTR  text 
)
static

Definition at line 246 of file header.c.

247 {
248  HDITEMA hdItem;
249  hdItem.mask = HDI_TEXT | HDI_WIDTH;
250  hdItem.cxy = 100;
251  hdItem.pszText = text;
252  hdItem.cchTextMax = 0;
253  return SendMessageA(hdex, HDM_INSERTITEMA, idx, (LPARAM)&hdItem);
254 }
int cchTextMax
Definition: commctrl.h:656
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
#define HDM_INSERTITEMA
Definition: commctrl.h:721
#define HDI_TEXT
Definition: commctrl.h:689
unsigned int idx
Definition: utils.c:41
LPSTR pszText
Definition: commctrl.h:654
LONG_PTR LPARAM
Definition: windef.h:208
int cxy
Definition: commctrl.h:653
UINT mask
Definition: commctrl.h:652
#define HDI_WIDTH
Definition: commctrl.h:687

Referenced by test_hdm_orderarray(), and test_header_control().

◆ addReadDelItem()

static void addReadDelItem ( HWND  hdex,
HDITEMA phdiCreate,
int  maskRead,
HDITEMA phdiRead 
)
static

Definition at line 312 of file header.c.

313 {
314  ok(SendMessageA(hdex, HDM_INSERTITEMA, 0, (LPARAM)phdiCreate)!=-1, "Adding item failed\n");
315  ZeroMemory(phdiRead, sizeof(HDITEMA));
316  phdiRead->mask = maskRead;
317  ok(SendMessageA(hdex, HDM_GETITEMA, 0, (LPARAM)phdiRead)!=0, "Getting item data failed\n");
318  ok(SendMessageA(hdex, HDM_DELETEITEM, 0, 0)!=0, "Deleting item failed\n");
319 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
#define ZeroMemory
Definition: winbase.h:1635
#define HDM_DELETEITEM
Definition: commctrl.h:728
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
#define HDM_GETITEMA
Definition: commctrl.h:731
UINT mask
Definition: commctrl.h:652

Referenced by check_auto_fields().

◆ BOOL()

static BOOL ( WINAPI pImageList_Destroy)
static

Referenced by HEADER_SetUnicodeFormat().

◆ check_auto_fields()

static void check_auto_fields ( void  )
static

Definition at line 613 of file header.c.

614 {
615  HDITEMA hdiCreate;
616  HDITEMA hdiRead;
617  static CHAR text[] = "Test";
618  LONG res;
619 
620  /* Windows stores the format, width, lparam even if they are not in the item's mask */
621  ZeroMemory(&hdiCreate, sizeof(HDITEMA));
622  hdiCreate.mask = HDI_TEXT;
623  hdiCreate.cxy = 100;
624  hdiCreate.pszText = text;
625  addReadDelItem(hWndHeader, &hdiCreate, HDI_WIDTH, &hdiRead);
627  ok(hdiRead.cxy == hdiCreate.cxy, "cxy should be automatically set\n");
628 
629  ZeroMemory(&hdiCreate, sizeof(HDITEMA));
630  hdiCreate.mask = HDI_TEXT;
631  hdiCreate.pszText = text;
632  hdiCreate.lParam = 0x12345678;
633  addReadDelItem(hWndHeader, &hdiCreate, HDI_LPARAM, &hdiRead);
635  ok(hdiRead.lParam == hdiCreate.lParam, "lParam should be automatically set\n");
636 
637  ZeroMemory(&hdiCreate, sizeof(HDITEMA));
638  hdiCreate.mask = HDI_TEXT;
639  hdiCreate.pszText = text;
640  hdiCreate.fmt = HDF_STRING|HDF_CENTER;
641  addReadDelItem(hWndHeader, &hdiCreate, HDI_FORMAT, &hdiRead);
643  ok(hdiRead.fmt == hdiCreate.fmt, "fmt should be automatically set\n");
644 
645  /* others fields are not set */
646  ZeroMemory(&hdiCreate, sizeof(HDITEMA));
647  hdiCreate.mask = HDI_TEXT;
648  hdiCreate.pszText = text;
649  hdiCreate.hbm = CreateBitmap(16, 16, 1, 8, NULL);
650  addReadDelItem(hWndHeader, &hdiCreate, HDI_BITMAP, &hdiRead);
652  ok(hdiRead.hbm == NULL, "hbm should not be automatically set\n");
653  DeleteObject(hdiCreate.hbm);
654 
655  ZeroMemory(&hdiCreate, sizeof(HDITEMA));
656  hdiCreate.mask = HDI_IMAGE;
657  hdiCreate.iImage = 17;
658  hdiCreate.pszText = text;
659  addReadDelItem(hWndHeader, &hdiCreate, HDI_TEXT, &hdiRead);
661  ok(hdiRead.pszText==NULL, "pszText shouldn't be automatically set\n");
662 
663  /* field from comctl >4.0 not tested as the system probably won't touch them */
664 }
HBITMAP hbm
Definition: commctrl.h:655
const WCHAR * text
Definition: package.c:1827
#define HDI_BITMAP
Definition: commctrl.h:692
int fmt
Definition: commctrl.h:657
char CHAR
Definition: xmlstorage.h:175
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define HDI_TEXT
Definition: commctrl.h:689
#define HDF_CENTER
Definition: commctrl.h:700
#define HDF_STRING
Definition: commctrl.h:705
long LONG
Definition: pedump.c:60
#define HDI_FORMAT
Definition: commctrl.h:690
#define ok(value,...)
LPSTR pszText
Definition: commctrl.h:654
smooth NULL
Definition: ftsmooth.c:416
int cxy
Definition: commctrl.h:653
#define HDI_IMAGE
Definition: commctrl.h:693
#define TEST_GET_ITEMCOUNT(i)
Definition: header.c:400
static HWND hWndHeader
Definition: header.c:54
int iImage
Definition: commctrl.h:659
static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
Definition: header.c:312
#define HDI_LPARAM
Definition: commctrl.h:691
GLuint res
Definition: glext.h:9613
LPARAM lParam
Definition: commctrl.h:658
UINT mask
Definition: commctrl.h:652
#define HDI_WIDTH
Definition: commctrl.h:687
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

Referenced by test_header_control().

◆ check_mask()

static void check_mask ( void  )
static

Definition at line 666 of file header.c.

667 {
668  HDITEMA hdi;
669  static CHAR text[] = "ABC";
670  LRESULT ret;
671 
672  /* don't create items if the mask is zero */
673  ZeroMemory(&hdi, sizeof(hdi));
674  hdi.mask = 0;
675  hdi.cxy = 200;
676  hdi.pszText = text;
677  hdi.fmt = 0;
678  hdi.iOrder = 0;
679  hdi.lParam = 17;
680  hdi.cchTextMax = 260;
682  ok(ret == -1, "Creating an item with a zero mask should have failed\n");
683  if (ret != -1) SendMessageA(hWndHeader, HDM_DELETEITEM, 0, 0);
684 
685  /* with a non-zero mask creation will succeed */
686  ZeroMemory(&hdi, sizeof(hdi));
687  hdi.mask = HDI_LPARAM;
689  ok(ret != -1, "Adding item with non-zero mask failed\n");
690  if (ret != -1)
692 
693  /* in SETITEM if the mask contains a unknown bit, it is ignored */
694  ZeroMemory(&hdi, sizeof(hdi));
695  hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
696  hdi.lParam = 133;
697  hdi.iImage = 17;
699  ok(ret != -1, "Adding item failed\n");
700 
701  if (ret != -1)
702  {
703  /* check result */
704  ZeroMemory(&hdi, sizeof(hdi));
705  hdi.mask = HDI_LPARAM | HDI_IMAGE;
707  ok(hdi.lParam == 133, "comctl32 4.0 field not set\n");
708  ok(hdi.iImage == 17, "comctl32 >4.0 field not set\n");
709 
710  /* but in GETITEM if an unknown bit is set, comctl32 uses only version 4.0 fields */
711  ZeroMemory(&hdi, sizeof(hdi));
712  hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
714  ok(hdi.lParam == 133, "comctl32 4.0 field not read\n");
715  ok(hdi.iImage == 0, "comctl32 >4.0 field shouldn't be read\n");
716 
718  }
719 }
int cchTextMax
Definition: commctrl.h:656
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
#define HDM_INSERTITEMA
Definition: commctrl.h:721
int fmt
Definition: commctrl.h:657
char CHAR
Definition: xmlstorage.h:175
#define ZeroMemory
Definition: winbase.h:1635
#define HDM_DELETEITEM
Definition: commctrl.h:728
#define ok(value,...)
LPSTR pszText
Definition: commctrl.h:654
LONG_PTR LPARAM
Definition: windef.h:208
int cxy
Definition: commctrl.h:653
#define HDI_IMAGE
Definition: commctrl.h:693
int ret
static HWND hWndHeader
Definition: header.c:54
int iImage
Definition: commctrl.h:659
int iOrder
Definition: commctrl.h:660
#define HDI_LPARAM
Definition: commctrl.h:691
LPARAM lParam
Definition: commctrl.h:658
#define HDM_GETITEMA
Definition: commctrl.h:731
UINT mask
Definition: commctrl.h:652
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by test_header_control().

◆ check_order()

static void check_order ( const int  expected_id[],
const int  expected_order[],
int  count,
const char type 
)
static

Definition at line 1536 of file header.c.

1538 {
1539  int i;
1540  HDITEMA hdi;
1541 
1542  ok(getItemCount(hWndHeader) == count, "Invalid item count in order tests\n");
1543  for (i = 0; i < count; i++)
1544  {
1545  hdi.mask = HDI_LPARAM|HDI_ORDER;
1547  ok(hdi.lParam == expected_id[i],
1548  "Invalid item ids after '%s'- item %d has lParam %d\n", type, i, (int)hdi.lParam);
1549  ok(hdi.iOrder == expected_order[i],
1550  "Invalid item order after '%s'- item %d has iOrder %d\n", type, i, hdi.iOrder);
1551  }
1552 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static LRESULT expected_id
Definition: win.c:4336
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 ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
static HWND hWndHeader
Definition: header.c:54
static LONG getItemCount(HWND hdex)
Definition: header.c:298
int iOrder
Definition: commctrl.h:660
#define HDI_ORDER
Definition: commctrl.h:695
#define HDI_LPARAM
Definition: commctrl.h:691
LPARAM lParam
Definition: commctrl.h:658
#define HDM_GETITEMA
Definition: commctrl.h:731
UINT mask
Definition: commctrl.h:652

Referenced by test_header_order().

◆ check_orderarray()

static void check_orderarray ( HWND  hwnd,
DWORD  start,
DWORD  set,
DWORD  expected,
BOOL  todo,
int  line 
)
static

Definition at line 1721 of file header.c.

1723 {
1724  int count, i;
1725  INT order[8];
1726  DWORD ret, array = 0;
1727 
1729 
1730  /* initial order */
1731  for(i = 1; i<=count; i++)
1732  order[i-1] = start>>(4*(count-i)) & 0xf;
1733 
1735  ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
1736 
1737  /* new order */
1738  for(i = 1; i<=count; i++)
1739  order[i-1] = set>>(4*(count-i)) & 0xf;
1741  ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
1742 
1743  /* check actual order */
1745  ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %d\n", ret);
1746  for(i = 1; i<=count; i++)
1747  array |= order[i-1]<<(4*(count-i));
1748 
1750  ok_(__FILE__, line)(array == expected, "Expected %x, got %x\n", expected, array);
1751 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define ok_(x1, x2)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLuint GLuint GLsizei count
Definition: gl.h:1545
BOOL todo
Definition: filedlg.c:313
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HDM_GETITEMCOUNT
Definition: commctrl.h:718
LONG_PTR LPARAM
Definition: windef.h:208
Definition: parser.c:48
#define todo_wine_if(is_todo)
Definition: test.h:155
#define HDM_SETORDERARRAY
Definition: commctrl.h:794
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HDM_GETORDERARRAY
Definition: commctrl.h:791
int ret
GLuint start
Definition: gl.h:1545
Definition: _set.h:46
BOOL expected
Definition: store.c:2063
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320

Referenced by test_hdm_orderarray().

◆ compare_items()

static void compare_items ( INT  iCode,
HDITEMA hdi1,
HDITEMA hdi2,
BOOL  fUnicode 
)
static

Definition at line 347 of file header.c.

348 {
349  ok(hdi1->mask == hdi2->mask, "Notify %d mask mismatch (%08x != %08x)\n", iCode, hdi1->mask, hdi2->mask);
350  if (hdi1->mask & HDI_WIDTH)
351  {
352  ok(hdi1->cxy == hdi2->cxy, "Notify %d cxy mismatch (%08x != %08x)\n", iCode, hdi1->cxy, hdi2->cxy);
353  }
354  if (hdi1->mask & HDI_TEXT)
355  {
356  if (hdi1->pszText == LPSTR_TEXTCALLBACKA)
357  {
358  ok(hdi1->pszText == LPSTR_TEXTCALLBACKA, "Notify %d - only one item is LPSTR_TEXTCALLBACK\n", iCode);
359  }
360  else
361  if (fUnicode)
362  {
363  char buf1[260];
364  char buf2[260];
365  WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)hdi1->pszText, -1, buf1, 260, NULL, NULL);
366  WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)hdi2->pszText, -1, buf2, 260, NULL, NULL);
367  ok(lstrcmpW((LPWSTR)hdi1->pszText, (LPWSTR)hdi2->pszText)==0,
368  "Notify %d text mismatch (L\"%s\" vs L\"%s\")\n",
369  iCode, buf1, buf2);
370  }
371  else
372  {
373  ok(strcmp(hdi1->pszText, hdi2->pszText)==0,
374  "Notify %d text mismatch (\"%s\" vs \"%s\")\n",
375  iCode, hdi1->pszText, hdi2->pszText);
376  }
377  }
378 }
#define WideCharToMultiByte
Definition: compat.h:101
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CP_ACP
Definition: compat.h:99
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static HRGN INT iCode
Definition: mapping.c:33
#define HDI_TEXT
Definition: commctrl.h:689
#define ok(value,...)
LPSTR pszText
Definition: commctrl.h:654
smooth NULL
Definition: ftsmooth.c:416
int cxy
Definition: commctrl.h:653
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
UINT mask
Definition: commctrl.h:652
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HDI_WIDTH
Definition: commctrl.h:687
#define LPSTR_TEXTCALLBACKA
Definition: commctrl.h:2353

Referenced by HeaderTestWndProc().

◆ create_custom_header_control()

static HWND create_custom_header_control ( HWND  hParent,
BOOL  preloadHeaderItems 
)
static

Definition at line 487 of file header.c.

488 {
489  WNDPROC oldproc;
490  HWND childHandle;
491  HDLAYOUT hlayout;
492  RECT rectwin;
493  WINDOWPOS winpos;
494  int retVal;
495  int loopcnt;
496  static char firstHeaderItem[] = "Name";
497  static char secondHeaderItem[] = "Size";
498  static char *items[] = {secondHeaderItem, firstHeaderItem};
499  HDITEMA hdItem;
500  hdItem.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
501  hdItem.fmt = HDF_LEFT;
502  hdItem.cxy = 80;
503  hdItem.cchTextMax = 260;
504 
506 
507  childHandle = CreateWindowExA(0, WC_HEADERA, NULL,
509  0, 0, 0, 0,
510  hParent, NULL, NULL, NULL);
511  ok(childHandle != NULL, "failed to create child window\n");
512  if (preloadHeaderItems)
513  {
514  for ( loopcnt = 0 ; loopcnt < 2 ; loopcnt++ )
515  {
516  hdItem.pszText = items[loopcnt];
517  retVal = SendMessageA(childHandle, HDM_INSERTITEMA, loopcnt, (LPARAM) &hdItem);
518  ok(retVal == loopcnt, "Adding item %d failed with return value %d\n", ( loopcnt + 1 ), retVal);
519  }
520  }
521 
524 
525  GetClientRect(hParent,&rectwin);
526  hlayout.prc = &rectwin;
527  hlayout.pwpos = &winpos;
528  SendMessageA(childHandle,HDM_LAYOUT,0,(LPARAM) &hlayout);
529  SetWindowPos(childHandle, winpos.hwndInsertAfter, winpos.x, winpos.y,
530  winpos.cx, winpos.cy, 0);
531 
532  oldproc = (WNDPROC)SetWindowLongPtrA(childHandle, GWLP_WNDPROC,
534  SetWindowLongPtrA(childHandle, GWLP_USERDATA, (LONG_PTR)oldproc);
535  return childHandle;
536 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
int cchTextMax
Definition: commctrl.h:656
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
int fmt
Definition: commctrl.h:657
HWND hwndInsertAfter
Definition: winuser.h:3563
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
#define WS_CHILD
Definition: pedump.c:617
int winetest_interactive
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define HDI_TEXT
Definition: commctrl.h:689
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:405
#define HDS_HORZ
Definition: commctrl.h:613
#define HDI_FORMAT
Definition: commctrl.h:690
#define HDM_LAYOUT
Definition: commctrl.h:752
#define ok(value,...)
LPSTR pszText
Definition: commctrl.h:654
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
int cxy
Definition: commctrl.h:653
#define SW_SHOW
Definition: winuser.h:769
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define SetWindowLongPtrA
Definition: winuser.h:5246
#define GWLP_WNDPROC
Definition: treelist.c:66
#define HDS_BUTTONS
Definition: commctrl.h:614
#define HDF_LEFT
Definition: commctrl.h:698
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WS_BORDER
Definition: pedump.c:625
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
RECT * prc
Definition: commctrl.h:748
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
WINDOWPOS * pwpos
Definition: commctrl.h:749
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 SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
UINT mask
Definition: commctrl.h:652
#define HDI_WIDTH
Definition: commctrl.h:687
static TCHAR * items[]
Definition: page1.c:45
#define WS_VISIBLE
Definition: pedump.c:620
#define WC_HEADERA
Definition: commctrl.h:608

Referenced by test_hdf_fixedwidth(), test_hdm_bitmapmarginMessages(), test_hdm_filterMessages(), test_hdm_getitemrect(), test_hdm_hittest(), test_hdm_imageMessages(), test_hdm_index_messages(), test_hdm_layout(), test_hdm_ordertoindex(), test_hdm_sethotdivider(), test_hdm_unicodeformatMessages(), test_hds_nosizing(), and test_item_auto_format().

◆ create_custom_parent_window()

static HWND create_custom_parent_window ( void  )
static

Definition at line 475 of file header.c.

476 {
478  return NULL;
479 
480  return CreateWindowExA(0, "Header test parent class", "Header Message Sequence Testing",
485 }
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define SM_CYSIZEFRAME
Definition: winuser.h:985
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define SM_CYCAPTION
Definition: winuser.h:953
int WINAPI GetSystemMetrics(_In_ int)
static BOOL register_parent_wnd_class(void)
Definition: header.c:458
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637

Referenced by START_TEST().

◆ create_header_control()

static HWND create_header_control ( void  )
static

Definition at line 321 of file header.c.

322 {
323  HWND handle;
324  HDLAYOUT hlayout;
325  RECT rectwin;
326  WINDOWPOS winpos;
327 
330  0, 0, 0, 0,
332  ok(handle != NULL, "failed to create header window\n");
333 
336 
338  hlayout.prc = &rectwin;
339  hlayout.pwpos = &winpos;
340  SendMessageA(handle, HDM_LAYOUT, 0, (LPARAM)&hlayout);
341  SetWindowPos(handle, winpos.hwndInsertAfter, winpos.x, winpos.y,
342  winpos.cx, winpos.cy, 0);
343 
344  return handle;
345 }
static HWND hHeaderParentWnd
Definition: header.c:53
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndInsertAfter
Definition: winuser.h:3563
#define WS_CHILD
Definition: pedump.c:617
int winetest_interactive
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define HDS_HORZ
Definition: commctrl.h:613
#define HDM_LAYOUT
Definition: commctrl.h:752
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
#define HDS_BUTTONS
Definition: commctrl.h:614
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WS_BORDER
Definition: pedump.c:625
RECT * prc
Definition: commctrl.h:748
WINDOWPOS * pwpos
Definition: commctrl.h:749
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 SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WS_VISIBLE
Definition: pedump.c:620
#define WC_HEADERA
Definition: commctrl.h:608

Referenced by test_customdraw(), test_hdm_orderarray(), test_header_control(), and test_header_order().

◆ customdraw_1()

static LRESULT customdraw_1 ( int  n,
NMCUSTOMDRAW nm 
)
static

Definition at line 1378 of file header.c.

1379 {
1380  if (nm == NULL) { /* test ended */
1381  ok(n==1, "NM_CUSTOMDRAW messages: %d, expected: 1\n", n);
1382  return 0;
1383  }
1384 
1385  switch (n)
1386  {
1387  case 0:
1388  /* don't test dwItemSpec - it's 0 no comctl5 but 1308756 on comctl6 */
1389  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
1390  return 0;
1391  }
1392 
1393  ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1394  return -1;
1395 }
GLdouble n
Definition: glext.h:7729
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
Definition: header.c:1368
#define CDDS_PREPAINT
Definition: commctrl.h:265
static DWORD g_customheight
Definition: header.c:45

Referenced by test_customdraw().

◆ customdraw_2()

static LRESULT customdraw_2 ( int  n,
NMCUSTOMDRAW nm 
)
static

Definition at line 1397 of file header.c.

1398 {
1399  if (nm == NULL) { /* test ended */
1400  ok(n==4, "NM_CUSTOMDRAW messages: %d, expected: 4\n", n);
1401  return 0;
1402  }
1403 
1404  switch (n)
1405  {
1406  case 0:
1407  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
1408  return CDRF_NOTIFYITEMDRAW;
1409  case 1:
1411  return 0;
1412  case 2:
1414  return 0;
1415  case 3:
1416  TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
1417  return 0;
1418  }
1419 
1420  ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1421  return 0;
1422 }
GLdouble n
Definition: glext.h:7729
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:270
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:260
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
Definition: header.c:1368
#define CDDS_PREPAINT
Definition: commctrl.h:265
static DWORD g_customheight
Definition: header.c:45

Referenced by test_customdraw().

◆ customdraw_3()

static LRESULT customdraw_3 ( int  n,
NMCUSTOMDRAW nm 
)
static

Definition at line 1424 of file header.c.

1425 {
1426  if (nm == NULL) { /* test ended */
1427  ok(n==5, "NM_CUSTOMDRAW messages: %d, expected: 5\n", n);
1428  return 0;
1429  }
1430 
1431  switch (n)
1432  {
1433  case 0:
1434  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
1436  case 1:
1438  return 0;
1439  case 2:
1441  return 0;
1442  case 3:
1443  TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
1444  return 0;
1445  case 4:
1446  TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight);
1447  return 0;
1448  }
1449 
1450  ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1451  return 0;
1452 }
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:259
GLdouble n
Definition: glext.h:7729
#define CDDS_POSTPAINT
Definition: commctrl.h:266
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:270
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:255
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:260
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
Definition: header.c:1368
#define CDDS_PREPAINT
Definition: commctrl.h:265
static DWORD g_customheight
Definition: header.c:45
#define CDRF_NOTIFYPOSTERASE
Definition: commctrl.h:262

Referenced by test_customdraw().

◆ customdraw_4()

static LRESULT customdraw_4 ( int  n,
NMCUSTOMDRAW nm 
)
static

Definition at line 1455 of file header.c.

1456 {
1457  if (nm == NULL) { /* test ended */
1458  ok(n==4, "NM_CUSTOMDRAW messages: %d, expected: 4\n", n);
1459  return 0;
1460  }
1461 
1462  switch (n)
1463  {
1464  case 0:
1465  TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
1467  case 1:
1469  return 0;
1470  case 2:
1471  TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
1472  return 0;
1473  case 3:
1474  TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight);
1475  return 0;
1476  }
1477 
1478  ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
1479  return 0;
1480 }
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:259
GLdouble n
Definition: glext.h:7729
#define CDDS_POSTPAINT
Definition: commctrl.h:266
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:270
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:260
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
Definition: header.c:1368
#define CDDS_PREPAINT
Definition: commctrl.h:265
static DWORD g_customheight
Definition: header.c:45

Referenced by test_customdraw().

◆ delItem()

static LONG delItem ( HWND  hdex,
int  idx 
)
static

Definition at line 293 of file header.c.

294 {
295  return SendMessageA(hdex, HDM_DELETEITEM, idx, 0);
296 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_DELETEITEM
Definition: commctrl.h:728
unsigned int idx
Definition: utils.c:41

Referenced by test_header_control().

◆ dont_expect_notify()

static void dont_expect_notify ( INT  iCode)
static

Definition at line 231 of file header.c.

232 {
233  ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify);
234  if (nExpectedNotify < 10)
236 }
static HRGN INT iCode
Definition: mapping.c:33
#define ok(value,...)
static INT nExpectedNotify
Definition: header.c:48
static INT unexpectedNotify[10]
Definition: header.c:50
static INT nUnexpectedNotify
Definition: header.c:51

Referenced by test_header_control().

◆ expect_notify()

static void expect_notify ( INT  iCode,
BOOL  fUnicode,
HDITEMA lpItem 
)
static

Definition at line 219 of file header.c.

220 {
221  ok(nExpectedNotify < 10, "notification count %d\n", nExpectedNotify);
222  if (nExpectedNotify < 10)
223  {
227  nExpectedNotify++;
228  }
229 }
static HRGN INT iCode
Definition: mapping.c:33
#define ok(value,...)
HDITEMA hdItem
Definition: header.c:36
static INT nExpectedNotify
Definition: header.c:48
static EXPECTEDNOTIFY expectedNotify[10]
Definition: header.c:47

Referenced by setItem(), and setItemUnicodeNotify().

◆ getItem()

static LONG getItem ( HWND  hdex,
int  idx,
LPSTR  textBuffer 
)
static

Definition at line 303 of file header.c.

304 {
305  HDITEMA hdItem;
306  hdItem.mask = HDI_TEXT;
307  hdItem.pszText = textBuffer;
308  hdItem.cchTextMax = MAX_CHARS;
309  return SendMessageA(hdex, HDM_GETITEMA, idx, (LPARAM)&hdItem);
310 }
int cchTextMax
Definition: commctrl.h:656
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAX_CHARS
Definition: header.c:55
#define HDI_TEXT
Definition: commctrl.h:689
unsigned int idx
Definition: utils.c:41
LPSTR pszText
Definition: commctrl.h:654
LONG_PTR LPARAM
Definition: windef.h:208
static char * textBuffer
Definition: combo.c:52
#define HDM_GETITEMA
Definition: commctrl.h:731
UINT mask
Definition: commctrl.h:652

Referenced by test_header_control().

◆ getItemCount()

static LONG getItemCount ( HWND  hdex)
static

Definition at line 298 of file header.c.

299 {
300  return SendMessageA(hdex, HDM_GETITEMCOUNT, 0, 0);
301 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_GETITEMCOUNT
Definition: commctrl.h:718

Referenced by check_order().

◆ header_item_getback()

static void header_item_getback ( HWND  hwnd,
UINT  mask,
HDITEMA item 
)
static

Definition at line 538 of file header.c.

539 {
540  int ret;
541 
543  ok(ret != -1, "Failed to add header item.\n");
544 
545  memset(item, 0, sizeof(*item));
546  item->mask = mask;
547 
549  ok(ret != 0, "Failed to get item data.\n");
551  ok(ret != 0, "Failed to delete item.\n");
552 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
#define HDM_DELETEITEM
Definition: commctrl.h:728
GLenum GLint GLuint mask
Definition: glext.h:6028
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
int ret
static ATOM item
Definition: dde.c:856
#define HDM_GETITEMA
Definition: commctrl.h:731
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_item_auto_format().

◆ header_subclass_proc()

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

Definition at line 405 of file header.c.

406 {
408  static LONG defwndproc_counter = 0;
409  struct message msg = { 0 };
410  LRESULT ret;
411 
412  msg.message = message;
413  msg.flags = sent|wparam|lparam;
414  if (defwndproc_counter) msg.flags |= defwinproc;
415  msg.wParam = wParam;
416  msg.lParam = lParam;
418 
419  defwndproc_counter++;
420  ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
421  defwndproc_counter--;
422 
423  return ret;
424 }
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
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
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:4729
int ret
Definition: msg.h:34
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
#define add_message(msg)
Definition: msg.c:2142
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
#define HEADER_SEQ_INDEX
Definition: header.c:63
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by create_custom_header_control().

◆ HeaderTestWndProc()

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

Definition at line 1613 of file header.c.

1614 {
1615  DRAWITEMSTRUCT *di;
1616  switch(msg) {
1617 
1618  case WM_NOTIFY:
1619  {
1622  int i;
1623 
1624  if (hdr->hdr.code == NM_CUSTOMDRAW)
1625  if (g_CustomDrawProc)
1627 
1628  for (i=0; i<nUnexpectedNotify; i++)
1629  ok(hdr->hdr.code != unexpectedNotify[i], "Received invalid notify %d\n", hdr->hdr.code);
1630 
1631  if (nReceivedNotify >= nExpectedNotify || hdr->hdr.hwndFrom != hWndHeader )
1632  break;
1633 
1635  if (hdr->hdr.code != expected->iCode)
1636  break;
1637 
1638  nReceivedNotify++;
1639  compare_items(hdr->hdr.code, &expected->hdItem, hdr->pitem, expected->fUnicode);
1640  break;
1641  }
1642 
1643  case WM_DRAWITEM:
1644  di = (DRAWITEMSTRUCT *)lParam;
1645  ok(g_DrawItem.CtlType != 0, "Unexpected WM_DRAWITEM\n");
1646  if (g_DrawItem.CtlType == 0) return 0;
1648  compare(di->CtlType, g_DrawItem.CtlType, "%d");
1649  compare(di->CtlID, g_DrawItem.CtlID, "%d");
1650  compare(di->hwndItem, g_DrawItem.hwndItem, "%p");
1651  compare(di->itemID, g_DrawItem.itemID, "%d");
1652  compare(di->itemState, g_DrawItem.itemState, "%d");
1653  compare(di->rcItem.left, g_DrawItem.rcItem.left, "%d");
1654  compare(di->rcItem.top, g_DrawItem.rcItem.top, "%d");
1655  compare(di->rcItem.right, g_DrawItem.rcItem.right, "%d");
1657  break;
1658 
1659  case WM_DESTROY:
1660  PostQuitMessage(0);
1661  break;
1662 
1663  default:
1664  return DefWindowProcA(hWnd, msg, wParam, lParam);
1665  }
1666 
1667  return 0L;
1668 }
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
static BOOL g_DrawItemReceived
Definition: header.c:44
static void compare_items(INT iCode, HDITEMA *hdi1, HDITEMA *hdi2, BOOL fUnicode)
Definition: header.c:347
LONG right
Definition: windef.h:293
WPARAM wParam
Definition: combotst.c:138
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 ok(value,...)
#define WM_DESTROY
Definition: winuser.h:1591
static CUSTOMDRAWPROC g_CustomDrawProc
Definition: header.c:41
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
static const WCHAR L[]
Definition: oid.c:1250
static HWND hWndHeader
Definition: header.c:54
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static INT nReceivedNotify
Definition: header.c:49
#define compare(val, exp, fmt)
Definition: header.c:57
#define WM_DRAWITEM
Definition: winuser.h:1627
#define msg(x)
Definition: auth_time.c:54
static INT nExpectedNotify
Definition: header.c:48
LONG bottom
Definition: windef.h:294
static EXPECTEDNOTIFY expectedNotify[10]
Definition: header.c:47
static INT unexpectedNotify[10]
Definition: header.c:50
LPARAM lParam
Definition: combotst.c:139
static DRAWITEMSTRUCT g_DrawItem
Definition: header.c:43
static INT nUnexpectedNotify
Definition: header.c:51
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_NOTIFY
Definition: richedit.h:61
BOOL expected
Definition: store.c:2063
static int g_CustomDrawCount
Definition: header.c:42

Referenced by init().

◆ HIMAGELIST()

static HIMAGELIST ( WINAPI pImageList_Create)
static

Referenced by test_hdm_imageMessages().

◆ init()

static BOOL init ( void  )
static

Definition at line 1680 of file header.c.

1681 {
1682  WNDCLASSA wc;
1683  TEXTMETRICA tm;
1684  HFONT hOldFont;
1685  HDC hdc;
1686 
1687  wc.style = CS_HREDRAW | CS_VREDRAW;
1688  wc.cbClsExtra = 0;
1689  wc.cbWndExtra = 0;
1691  wc.hIcon = NULL;
1694  wc.lpszMenuName = NULL;
1695  wc.lpszClassName = "HeaderTestClass";
1697  RegisterClassA(&wc);
1698 
1699  /* The height of the header control depends on the height of the system font.
1700  The height of the system font is dpi dependent */
1701  hdc = GetDC(0);
1703  GetTextMetricsA(hdc, &tm);
1704  /* 2 dot extra space are needed for the border */
1705  g_customheight = tm.tmHeight + 2;
1706  trace("customdraw height: %d (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY));
1707  SelectObject(hdc, hOldFont);
1708  ReleaseDC(0, hdc);
1709 
1710  hHeaderParentWnd = CreateWindowExA(0, "HeaderTestClass", "Header test", WS_OVERLAPPEDWINDOW,
1713  NULL, NULL, GetModuleHandleA(NULL), 0);
1714  ok(hHeaderParentWnd != NULL, "failed to create parent wnd\n");
1715 
1717  return hHeaderParentWnd != NULL;
1718 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static HWND hHeaderParentWnd
Definition: header.c:53
#define trace(...)
Definition: kmt_test.h:217
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
int cbClsExtra
Definition: winuser.h:3139
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3145
HBRUSH hbrBackground
Definition: winuser.h:3144
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define COLOR_WINDOW
Definition: winuser.h:908
int cbWndExtra
Definition: winuser.h:3140
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ok(value,...)
HCURSOR hCursor
Definition: winuser.h:3143
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define SM_CYSIZEFRAME
Definition: winuser.h:985
#define SYSTEM_FONT
Definition: wingdi.h:910
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
const char * LPCSTR
Definition: xmlstorage.h:183
#define SW_SHOW
Definition: winuser.h:769
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define CS_VREDRAW
Definition: winuser.h:653
#define SM_CYCAPTION
Definition: winuser.h:953
int WINAPI GetSystemMetrics(_In_ int)
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
Definition: time.h:76
LPCSTR lpszClassName
Definition: winuser.h:3146
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3137
HINSTANCE hInstance
Definition: winuser.h:3141
static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: header.c:1613
static DWORD g_customheight
Definition: header.c:45
WNDPROC lpfnWndProc
Definition: winuser.h:3138
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define IDC_ARROW
Definition: winuser.h:682
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define LOGPIXELSY
Definition: wingdi.h:718
HBRUSH WINAPI GetSysColorBrush(_In_ int)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3142

Referenced by START_TEST().

◆ init_functions()

static void init_functions ( void  )
static

Definition at line 1670 of file header.c.

1671 {
1672  HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
1673 
1674 #define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
1677 #undef X
1678 }
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:925
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:801
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define X(f)

Referenced by START_TEST().

◆ notifies_received()

static BOOL notifies_received ( void  )
static

Definition at line 238 of file header.c.

239 {
242  nUnexpectedNotify = 0;
243  return fRet;
244 }
unsigned int BOOL
Definition: ntddk_ex.h:94
static INT nReceivedNotify
Definition: header.c:49
static INT nExpectedNotify
Definition: header.c:48
static INT nUnexpectedNotify
Definition: header.c:51

Referenced by setItem(), and setItemUnicodeNotify().

◆ parent_wnd_proc()

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

Definition at line 426 of file header.c.

427 {
428  static LONG defwndproc_counter = 0;
429  LRESULT ret;
430  struct message msg;
431 
432  /* do not log painting messages */
433  if (message != WM_PAINT &&
434  message != WM_ERASEBKGND &&
435  message != WM_NCPAINT &&
436  message != WM_NCHITTEST &&
437  message != WM_GETTEXT &&
438  message != WM_GETICON &&
440 
441  {
442  msg.message = message;
443  msg.flags = sent|wparam|lparam;
444  if (defwndproc_counter) msg.flags |= defwinproc;
445  msg.wParam = wParam;
446  msg.lParam = lParam;
447  msg.id = 0;
449  }
450 
451  defwndproc_counter++;
453  defwndproc_counter--;
454 
455  return ret;
456 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
#define WM_GETTEXT
Definition: winuser.h:1600
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define WM_NCHITTEST
Definition: winuser.h:1668
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
#define PARENT_SEQ_INDEX
Definition: header.c:62
WPARAM wParam
Definition: combotst.c:138
#define WM_NCPAINT
Definition: winuser.h:1669
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_PAINT
Definition: winuser.h:1602
int ret
Definition: msg.h:34
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define add_message(msg)
Definition: msg.c:2142
#define WM_DEVICECHANGE
Definition: winuser.h:1793
#define msg(x)
Definition: auth_time.c:54
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by register_parent_wnd_class().

◆ register_parent_wnd_class()

static BOOL register_parent_wnd_class ( void  )
static

Definition at line 458 of file header.c.

459 {
460  WNDCLASSA cls;
461 
462  cls.style = 0;
464  cls.cbClsExtra = 0;
465  cls.cbWndExtra = 0;
467  cls.hIcon = 0;
468  cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
470  cls.lpszMenuName = NULL;
471  cls.lpszClassName = "Header test parent class";
472  return RegisterClassA(&cls);
473 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
int cbClsExtra
Definition: winuser.h:3139
LPCSTR lpszMenuName
Definition: winuser.h:3145
#define WHITE_BRUSH
Definition: wingdi.h:901
HBRUSH hbrBackground
Definition: winuser.h:3144
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:426
int cbWndExtra
Definition: winuser.h:3140
HCURSOR hCursor
Definition: winuser.h:3143
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LPCSTR lpszClassName
Definition: winuser.h:3146
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3137
HINSTANCE hInstance
Definition: winuser.h:3141
WNDPROC lpfnWndProc
Definition: winuser.h:3138
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3142

Referenced by create_custom_parent_window().

◆ run_customdraw_scenario()

static void run_customdraw_scenario ( CUSTOMDRAWPROC  proc)
static

Definition at line 1482 of file header.c.

1483 {
1485  g_CustomDrawCount = 0;
1490 }
#define TRUE
Definition: types.h:120
BOOL WINAPI UpdateWindow(_In_ HWND)
static HANDLE proc()
Definition: pdb.c:32
smooth NULL
Definition: ftsmooth.c:416
static CUSTOMDRAWPROC g_CustomDrawProc
Definition: header.c:41
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
static HWND hWndHeader
Definition: header.c:54
static int g_CustomDrawCount
Definition: header.c:42

Referenced by test_customdraw().

◆ setItem()

static LONG setItem ( HWND  hdex,
int  idx,
LPSTR  text,
BOOL  fCheckNotifies 
)
static

Definition at line 256 of file header.c.

257 {
258  LONG ret;
259  HDITEMA hdexItem;
260  hdexItem.mask = HDI_TEXT;
261  hdexItem.pszText = text;
262  hdexItem.cchTextMax = 0;
263  if (fCheckNotifies)
264  {
266  expect_notify(HDN_ITEMCHANGEDA, FALSE, &hdexItem);
267  }
268  ret = SendMessageA(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
269  if (fCheckNotifies)
270  ok(notifies_received(), "setItem(): not all expected notifies were received\n");
271  return ret;
272 }
#define HDM_SETITEMA
Definition: commctrl.h:738
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:822
int cchTextMax
Definition: commctrl.h:656
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:824
static BOOL notifies_received(void)
Definition: header.c:238
#define HDI_TEXT
Definition: commctrl.h:689
long LONG
Definition: pedump.c:60
#define ok(value,...)
unsigned int idx
Definition: utils.c:41
LPSTR pszText
Definition: commctrl.h:654
LONG_PTR LPARAM
Definition: windef.h:208
static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
Definition: header.c:219
int ret
UINT mask
Definition: commctrl.h:652

Referenced by test_header_control().

◆ setItemUnicodeNotify()

static LONG setItemUnicodeNotify ( HWND  hdex,
int  idx,
LPSTR  text,
LPWSTR  wText 
)
static

Definition at line 274 of file header.c.

275 {
276  LONG ret;
277  HDITEMA hdexItem;
278  HDITEMW hdexNotify;
279  hdexItem.mask = HDI_TEXT;
280  hdexItem.pszText = text;
281  hdexItem.cchTextMax = 0;
282 
283  hdexNotify.mask = HDI_TEXT;
284  hdexNotify.pszText = wText;
285 
286  expect_notify(HDN_ITEMCHANGINGW, TRUE, (HDITEMA*)&hdexNotify);
287  expect_notify(HDN_ITEMCHANGEDW, TRUE, (HDITEMA*)&hdexNotify);
288  ret = SendMessageA(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
289  ok(notifies_received(), "setItemUnicodeNotify(): not all expected notifies were received\n");
290  return ret;
291 }
#define HDM_SETITEMA
Definition: commctrl.h:738
#define TRUE
Definition: types.h:120
int cchTextMax
Definition: commctrl.h:656
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * text
Definition: package.c:1827
LPWSTR pszText
Definition: commctrl.h:671
static BOOL notifies_received(void)
Definition: header.c:238
#define HDI_TEXT
Definition: commctrl.h:689
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:823
long LONG
Definition: pedump.c:60
#define ok(value,...)
unsigned int idx
Definition: utils.c:41
LPSTR pszText
Definition: commctrl.h:654
LONG_PTR LPARAM
Definition: windef.h:208
static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
Definition: header.c:219
int ret
UINT mask
Definition: commctrl.h:669
UINT mask
Definition: commctrl.h:652
#define HDN_ITEMCHANGEDW
Definition: commctrl.h:825

Referenced by test_header_control().

◆ START_TEST()

START_TEST ( header  )

Definition at line 1836 of file header.c.

1837 {
1838  HWND parent_hwnd;
1839  ULONG_PTR ctx_cookie;
1840  HANDLE hCtx;
1841 
1842  init_functions();
1844 
1845  if (!init())
1846  return;
1847 
1852  test_customdraw();
1853 
1855 
1857  parent_hwnd = create_custom_parent_window();
1858  ok_sequence(sequences, PARENT_SEQ_INDEX, create_parent_wnd_seq, "create parent windows", FALSE);
1859 
1860  test_hdm_index_messages(parent_hwnd);
1861  test_hdm_getitemrect(parent_hwnd);
1862  test_hdm_hittest(parent_hwnd);
1863  test_hdm_layout(parent_hwnd);
1864  test_hdm_ordertoindex(parent_hwnd);
1865  test_hdm_sethotdivider(parent_hwnd);
1866  test_hdm_imageMessages(parent_hwnd);
1867  test_hdm_filterMessages(parent_hwnd);
1868  test_hdm_unicodeformatMessages(parent_hwnd);
1869  test_hdm_bitmapmarginMessages(parent_hwnd);
1870 
1871  if (!load_v6_module(&ctx_cookie, &hCtx))
1872  {
1873  DestroyWindow(parent_hwnd);
1874  return;
1875  }
1876 
1877  init_functions();
1878 
1879  /* comctl32 version 6 tests start here */
1880  test_hdf_fixedwidth(parent_hwnd);
1881  test_hds_nosizing(parent_hwnd);
1882  test_item_auto_format(parent_hwnd);
1883 
1884  unload_v6_module(ctx_cookie, hCtx);
1885 
1886  DestroyWindow(parent_hwnd);
1887 }
static HWND hHeaderParentWnd
Definition: header.c:53
#define NUM_MSG_SEQUENCES
Definition: header.c:61
static void test_item_auto_format(HWND parent)
Definition: header.c:554
static void test_hdm_unicodeformatMessages(HWND hParent)
Definition: header.c:1068
static void test_hdf_fixedwidth(HWND hParent)
Definition: header.c:1225
static void test_hdm_filterMessages(HWND hParent)
Definition: header.c:1009
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
static const struct message create_parent_wnd_seq[]
Definition: header.c:67
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
static void test_hdm_bitmapmarginMessages(HWND hParent)
Definition: header.c:1089
uint32_t ULONG_PTR
Definition: typedefs.h:63
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
static void test_header_order(void)
Definition: header.c:1554
static void test_hdm_sethotdivider(HWND hParent)
Definition: header.c:946
static void test_hdm_hittest(HWND hParent)
Definition: header.c:899
static BOOL init(void)
Definition: header.c:1680
static void init_functions(void)
Definition: header.c:1670
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static void test_hdm_layout(HWND hParent)
Definition: header.c:857
static void test_hdm_orderarray(void)
Definition: header.c:1753
static void test_header_control(void)
Definition: header.c:721
static void test_hds_nosizing(HWND hParent)
Definition: header.c:1293
static void test_hdm_index_messages(HWND hParent)
Definition: header.c:1111
static void test_customdraw(void)
Definition: header.c:1492
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static void test_hdm_imageMessages(HWND hParent)
Definition: header.c:977
static void test_hdm_ordertoindex(HWND hParent)
Definition: header.c:881
static void test_hdm_getitemrect(HWND hParent)
Definition: header.c:820
static HWND create_custom_parent_window(void)
Definition: header.c:475

◆ test_customdraw()

static void test_customdraw ( void  )
static

Definition at line 1492 of file header.c.

1493 {
1494  int i;
1495  HDITEMA item;
1496  RECT rect;
1497  CHAR name[] = "Test";
1500  ok(rect.right - rect.left == 670 && rect.bottom - rect.top == g_customheight,
1501  "Tests will fail as header size is %dx%d instead of 670x%d\n",
1502  rect.right - rect.left, rect.bottom - rect.top, g_customheight);
1503 
1504  for (i = 0; i < 3; i++)
1505  {
1506  ZeroMemory(&item, sizeof(item));
1507  item.mask = HDI_TEXT|HDI_WIDTH;
1508  item.cxy = 50*(i+1);
1509  item.pszText = name;
1510  item.lParam = i*5;
1512  }
1513 
1517 
1518  ZeroMemory(&item, sizeof(item));
1519  item.mask = HDI_FORMAT;
1520  item.fmt = HDF_OWNERDRAW;
1522  g_DrawItem.CtlID = 0;
1525  g_DrawItem.itemID = 1;
1526  g_DrawItem.itemState = 0;
1529  ok(g_DrawItemReceived, "WM_DRAWITEM not received\n");
1531  hWndHeader = NULL;
1532  g_DrawItem.CtlType = 0;
1534 }
#define HDM_SETITEMA
Definition: commctrl.h:738
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
char CHAR
Definition: xmlstorage.h:175
#define ZeroMemory
Definition: winbase.h:1635
#define HDM_GETITEMRECT
Definition: commctrl.h:776
static void run_customdraw_scenario(CUSTOMDRAWPROC proc)
Definition: header.c:1482
static BOOL g_DrawItemReceived
Definition: header.c:44
#define HDI_TEXT
Definition: commctrl.h:689
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 HDI_FORMAT
Definition: commctrl.h:690
#define ODT_HEADER
Definition: commctrl.h:78
#define ok(value,...)
#define HDF_OWNERDRAW
Definition: commctrl.h:704
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static HWND create_header_control(void)
Definition: header.c:321
static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1378
static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1424
static HWND hWndHeader
Definition: header.c:54
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static ATOM item
Definition: dde.c:856
static DWORD g_customheight
Definition: header.c:45
static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1455
Definition: name.c:36
#define HDI_WIDTH
Definition: commctrl.h:687
static DRAWITEMSTRUCT g_DrawItem
Definition: header.c:43
static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1397
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by START_TEST().

◆ test_hdf_fixedwidth()

static void test_hdf_fixedwidth ( HWND  hParent)
static

Definition at line 1225 of file header.c.

1226 {
1227  HWND hChild;
1228  HDITEMA hdItem;
1229  DWORD ret;
1230  RECT rect;
1231  HDHITTESTINFO ht;
1232 
1234 
1235  hdItem.mask = HDI_WIDTH | HDI_FORMAT;
1236  hdItem.fmt = HDF_FIXEDWIDTH;
1237  hdItem.cxy = 80;
1238 
1239  ret = SendMessageA(hChild, HDM_INSERTITEMA, 0, (LPARAM)&hdItem);
1240  expect(0, ret);
1241 
1242  /* try to change width */
1243  rect.right = rect.bottom = 0;
1245  ok(rect.right != 0, "Expected not zero width\n");
1246  ok(rect.bottom != 0, "Expected not zero height\n");
1247 
1248  SendMessageA(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
1249  SendMessageA(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1250  SendMessageA(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1251 
1253 
1254  if (hdItem.cxy != rect.right)
1255  {
1256  win_skip("HDF_FIXEDWIDTH format not supported\n");
1258  return;
1259  }
1260 
1261  /* try to adjust with message */
1262  hdItem.mask = HDI_WIDTH;
1263  hdItem.cxy = 90;
1264 
1265  ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
1266  expect(TRUE, ret);
1267 
1268  rect.right = 0;
1270  expect(90, rect.right);
1271 
1272  /* hittesting doesn't report ondivider flag for HDF_FIXEDWIDTH */
1273  ht.pt.x = rect.right - 1;
1274  ht.pt.y = rect.bottom / 2;
1276  expect(HHT_ONHEADER, ht.flags);
1277 
1278  /* try to adjust with message */
1279  hdItem.mask = HDI_FORMAT;
1280  hdItem.fmt = 0;
1281 
1282  ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
1283  expect(TRUE, ret);
1284 
1285  ht.pt.x = 90;
1286  ht.pt.y = rect.bottom / 2;
1288  expect(HHT_ONDIVIDER, ht.flags);
1289 
1291 }
#define HDM_SETITEMA
Definition: commctrl.h:738
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
int fmt
Definition: commctrl.h:657
#define expect(expected, got)
Definition: header.c:59
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define HDM_GETITEMRECT
Definition: commctrl.h:776
BOOL WINAPI DestroyWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
#define HDM_HITTEST
Definition: commctrl.h:774
#define HHT_ONHEADER
Definition: commctrl.h:756
#define HDI_FORMAT
Definition: commctrl.h:690
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
int cxy
Definition: commctrl.h:653
#define HHT_ONDIVIDER
Definition: commctrl.h:757
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define WM_LBUTTONUP
Definition: winuser.h:1759
static const struct newhuff ht[]
Definition: huffman.h:296
#define WM_MOUSEMOVE
Definition: winuser.h:1757
UINT mask
Definition: commctrl.h:652
#define HDI_WIDTH
Definition: commctrl.h:687
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_hdm_bitmapmarginMessages()

static void test_hdm_bitmapmarginMessages ( HWND  hParent)
static

Definition at line 1089 of file header.c.

1090 {
1091  HWND hChild;
1092  int retVal;
1093 
1097  "adder header control to parent", FALSE);
1098 
1100  retVal = SendMessageA(hChild, HDM_GETBITMAPMARGIN, 0, 0);
1101  if (retVal == 0)
1102  win_skip("HDM_GETBITMAPMARGIN needs 5.80\n");
1103  else
1104  expect(6, retVal);
1105 
1107  "bitmapmarginMessages sequence testing", FALSE);
1109 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static const struct message bitmapmarginMessages_seq[]
Definition: header.c:213
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define HDM_GETBITMAPMARGIN
Definition: commctrl.h:803
#define win_skip
Definition: test.h:141
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_filterMessages()

static void test_hdm_filterMessages ( HWND  hParent)
static

Definition at line 1009 of file header.c.

1010 {
1011  HWND hChild;
1012  int retVal, timeout;
1013 
1017  "adder header control to parent", FALSE);
1018 
1020  ok(timeout == 1000, "got %d\n", timeout);
1021 
1023  ok(timeout == 1000, "got %d\n", timeout);
1024 
1026  ok(timeout == 1000, "got %d\n", timeout);
1027 
1029  ok(timeout == -100, "got %d\n", timeout);
1031  ok(retVal == 100, "got %d\n", retVal);
1032 
1034 
1035  /* msdn incorrectly states that return value
1036  * is the index of the filter control being
1037  * modified. The sendMessage here should
1038  * return previous filter timeout value
1039  */
1040 
1041  retVal = SendMessageA(hChild, HDM_SETFILTERCHANGETIMEOUT, 1, 100);
1042  expect(timeout, retVal);
1043 
1044  todo_wine
1045  {
1046  retVal = SendMessageA(hChild, HDM_CLEARFILTER, 0, 1);
1047  if (retVal == 0)
1048  win_skip("HDM_CLEARFILTER needs 5.80\n");
1049  else
1050  expect(1, retVal);
1051 
1052  retVal = SendMessageA(hChild, HDM_EDITFILTER, 1, 0);
1053  if (retVal == 0)
1054  win_skip("HDM_EDITFILTER needs 5.80\n");
1055  else
1056  expect(1, retVal);
1057  }
1060  "filterMessages sequence testing", TRUE);
1061  else
1063  "filterMessages sequence testing", FALSE);
1065 
1066 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
#define HDM_SETFILTERCHANGETIMEOUT
Definition: commctrl.h:812
#define HDM_CLEARFILTER
Definition: commctrl.h:818
static const struct message filterMessages_seq_noninteractive[]
Definition: header.c:198
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
#define HDM_EDITFILTER
Definition: commctrl.h:815
Definition: dhcpd.h:245
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
int winetest_interactive
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
GLbitfield GLuint64 timeout
Definition: glext.h:7164
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define ok(value,...)
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
#define todo_wine
Definition: test.h:154
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define win_skip
Definition: test.h:141
static const struct message filterMessages_seq_interactive[]
Definition: header.c:188
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_getitemrect()

static void test_hdm_getitemrect ( HWND  hParent)
static

Definition at line 820 of file header.c.

821 {
822 
823  HWND hChild;
824  RECT rect;
825  int retVal;
826 
830  "adder header control to parent", FALSE);
831 
832  retVal = SendMessageA(hChild, HDM_GETITEMRECT, 1, (LPARAM) &rect);
833  ok(retVal == TRUE, "Getting item rect should TRUE, got %d\n", retVal);
834  /* check bounding rectangle information of 2nd header item */
835  expect(80, rect.left);
836  expect(0, rect.top);
837  expect(160, rect.right);
838  expect(g_customheight, rect.bottom);
839 
840  retVal = SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
841 
842  ok(retVal == TRUE, "Getting item rect should TRUE, got %d\n", retVal);
843  /* check bounding rectangle information of 1st header item */
844  expect(0, rect.left);
845  expect(0, rect.top);
846 
847  expect(80, rect.right);
848  expect(g_customheight, rect.bottom);
849 
850  retVal = SendMessageA(hChild, HDM_GETITEMRECT, 10, (LPARAM) &rect);
851  ok(retVal == 0, "Getting rect of nonexistent item should return 0, got %d\n", retVal);
852 
853  ok_sequence(sequences, HEADER_SEQ_INDEX, getItemRect_seq, "getItemRect sequence testing", FALSE);
855 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
#define HDM_GETITEMRECT
Definition: commctrl.h:776
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
& rect
Definition: startmenu.cpp:1413
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static DWORD g_customheight
Definition: header.c:45
static const struct message getItemRect_seq[]
Definition: header.c:138
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_hittest()

static void test_hdm_hittest ( HWND  hParent)
static

Definition at line 899 of file header.c.

900 {
901  HWND hChild;
902  int retVal;
903  POINT pt;
904  HDHITTESTINFO hdHitTestInfo;
905  const int firstItemRightBoundary = 80;
906  const int secondItemRightBoundary = 160;
907  const int bottomBoundary = g_customheight;
908 
909  pt.x = firstItemRightBoundary - 1;
910  pt.y = bottomBoundary - 1;
911  hdHitTestInfo.pt = pt;
912 
913 
917  "adder header control to parent", FALSE);
918 
920  retVal = SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
921  expect(0, retVal);
922  expect(0, hdHitTestInfo.iItem);
923  expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
924 
925  pt.x = secondItemRightBoundary - 1;
926  pt.y = bottomBoundary - 1;
927  hdHitTestInfo.pt = pt;
928  retVal = SendMessageA(hChild, HDM_HITTEST, 1, (LPARAM) &hdHitTestInfo);
929  expect(1, retVal);
930  expect(1, hdHitTestInfo.iItem);
931  expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
932 
933  pt.x = secondItemRightBoundary;
934  pt.y = bottomBoundary + 1;
935  hdHitTestInfo.pt = pt;
936  retVal = SendMessageA(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
937  expect(-1, retVal);
938  expect(-1, hdHitTestInfo.iItem);
939  expect(HHT_BELOW, hdHitTestInfo.flags);
940 
941  ok_sequence(sequences, HEADER_SEQ_INDEX, hittest_seq, "hittest sequence testing", FALSE);
942 
944 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
static const struct message hittest_seq[]
Definition: header.c:155
static HTREEITEM hChild
Definition: treeview.c:381
#define pt(x, y)
Definition: drawing.c:79
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
#define HDM_HITTEST
Definition: commctrl.h:774
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
LONG_PTR LPARAM
Definition: windef.h:208
#define HHT_ONDIVIDER
Definition: commctrl.h:757
#define HHT_BELOW
Definition: commctrl.h:762
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static DWORD g_customheight
Definition: header.c:45
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_imageMessages()

static void test_hdm_imageMessages ( HWND  hParent)
static

Definition at line 977 of file header.c.

978 {
979  HIMAGELIST hImageList = pImageList_Create (4, 4, 0, 1, 0);
980  HIMAGELIST hIml;
981  BOOL wasValid;
982  HWND hChild;
983 
987  "adder header control to parent", FALSE);
988 
990 
991  hIml = (HIMAGELIST) SendMessageA(hChild, HDM_SETIMAGELIST, 0, (LPARAM) hImageList);
992  ok(hIml == NULL, "Expected NULL, got %p\n", hIml);
993 
995  ok(hIml != NULL, "Expected non-NULL handle, got %p\n", hIml);
996 
998  ok(hIml != NULL, "Expected non-NULL handle, got %p\n", hIml);
999  pImageList_Destroy(hIml);
1000 
1001  ok_sequence(sequences, HEADER_SEQ_INDEX, imageMessages_seq, "imageMessages sequence testing", FALSE);
1002 
1004 
1005  wasValid = pImageList_Destroy(hImageList);
1006  ok(wasValid, "Header must not free image list at destruction!\n");
1007 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_GETIMAGELIST
Definition: commctrl.h:782
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define HDM_CREATEDRAGIMAGE
Definition: commctrl.h:788
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static const struct message imageMessages_seq[]
Definition: header.c:181
static HIMAGELIST(WINAPI *pImageList_Create)(int
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define HDM_SETIMAGELIST
Definition: commctrl.h:779
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_index_messages()

static void test_hdm_index_messages ( HWND  hParent)
static

Definition at line 1111 of file header.c.

1112 {
1113  HWND hChild;
1114  int retVal, i, iSize;
1115  static const int lpiarray[2] = {1, 0};
1116  static const char *item_texts[] = {
1117  "Name", "Size", "Type", "Date Modified"
1118  };
1119  RECT rect;
1120  HDITEMA hdItem;
1121  char buffA[32];
1122  int array[2];
1123 
1128  "adder header control to parent", TRUE);
1129  else
1131  "adder header control to parent", FALSE);
1133  for (i = 0; i < ARRAY_SIZE(item_texts); i++)
1134  {
1135  hdItem.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
1136  hdItem.pszText = (char*)item_texts[i];
1137  hdItem.fmt = HDF_LEFT;
1138  hdItem.cxy = 80;
1139 
1140  retVal = SendMessageA(hChild, HDM_INSERTITEMA, i, (LPARAM) &hdItem);
1141  ok(retVal == i, "Adding item %d failed with return value %d\n", i, retVal);
1142  }
1143  ok_sequence(sequences, HEADER_SEQ_INDEX, insertItem_seq, "insertItem sequence testing", FALSE);
1144 
1146 
1147  retVal = SendMessageA(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
1148  ok(retVal == TRUE, "Deleting item 3 should return TRUE, got %d\n", retVal);
1149  retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1150  ok(retVal == 3, "Getting item count should return 3, got %d\n", retVal);
1151 
1152  retVal = SendMessageA(hChild, HDM_DELETEITEM, 3, (LPARAM) &hdItem);
1153  ok(retVal == FALSE, "Deleting already-deleted item should return FALSE, got %d\n", retVal);
1154  retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1155  ok(retVal == 3, "Getting item count should return 3, got %d\n", retVal);
1156 
1157  retVal = SendMessageA(hChild, HDM_DELETEITEM, 2, (LPARAM) &hdItem);
1158  ok(retVal == TRUE, "Deleting item 2 should return TRUE, got %d\n", retVal);
1159  retVal = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1160  ok(retVal == 2, "Getting item count should return 2, got %d\n", retVal);
1161 
1163  "deleteItem_getItemCount sequence testing", FALSE);
1164 
1166 
1167  hdItem.mask = HDI_WIDTH;
1168  retVal = SendMessageA(hChild, HDM_GETITEMA, 3, (LPARAM) &hdItem);
1169  ok(retVal == FALSE, "Getting already-deleted item should return FALSE, got %d\n", retVal);
1170 
1171  hdItem.mask = HDI_TEXT | HDI_WIDTH;
1172  hdItem.pszText = buffA;
1173  hdItem.cchTextMax = ARRAY_SIZE(buffA);
1174  retVal = SendMessageA(hChild, HDM_GETITEMA, 0, (LPARAM) &hdItem);
1175  ok(retVal == TRUE, "Getting the 1st header item should return TRUE, got %d\n", retVal);
1176 
1177  ok_sequence(sequences, HEADER_SEQ_INDEX, getItem_seq, "getItem sequence testing", FALSE);
1178 
1179  /* check if the item is the right one */
1180  ok(!strcmp(hdItem.pszText, item_texts[0]), "got wrong item %s, expected %s\n",
1181  hdItem.pszText, item_texts[0]);
1182  expect(80, hdItem.cxy);
1183 
1184  iSize = SendMessageA(hChild, HDM_GETITEMCOUNT, 0, 0);
1185 
1186  /* item should be updated just after accepting new array */
1188  retVal = SendMessageA(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
1189  expect(TRUE, retVal);
1190  rect.left = 0;
1191  retVal = SendMessageA(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect);
1192  expect(TRUE, retVal);
1193  ok(rect.left != 0, "Expected updated rectangle\n");
1194 
1196 
1197  retVal = SendMessageA(hChild, HDM_SETORDERARRAY, iSize, (LPARAM) lpiarray);
1198  ok(retVal == TRUE, "Setting header items order should return TRUE, got %d\n", retVal);
1199 
1201  ok(retVal == TRUE, "Getting header items order should return TRUE, got %d\n", retVal);
1202 
1203  ok_sequence(sequences, HEADER_SEQ_INDEX, orderArray_seq, "set_get_orderArray sequence testing", FALSE);
1204 
1205  /* check if the array order is set correctly and the size of the array is correct. */
1206  expect(2, iSize);
1207  ok(lpiarray[0] == array[0], "got %d, expected %d\n", array[0], lpiarray[0]);
1208  ok(lpiarray[1] == array[1], "got %d, expected %d\n", array[1], lpiarray[1]);
1209 
1210  hdItem.mask = HDI_FORMAT;
1211  hdItem.fmt = HDF_CENTER | HDF_STRING;
1212 
1214 
1215  retVal = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM) &hdItem);
1216  ok(retVal == TRUE, "Aligning 1st header item to center should return TRUE, got %d\n", retVal);
1217  hdItem.fmt = HDF_RIGHT | HDF_STRING;
1218  retVal = SendMessageA(hChild, HDM_SETITEMA, 1, (LPARAM) &hdItem);
1219  ok(retVal == TRUE, "Aligning 2nd header item to right should return TRUE, got %d\n", retVal);
1220 
1221  ok_sequence(sequences, HEADER_SEQ_INDEX, setItem_seq, "setItem sequence testing", FALSE);
1223 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define HDM_SETITEMA
Definition: commctrl.h:738
#define TRUE
Definition: types.h:120
#define HDF_RIGHT
Definition: commctrl.h:699
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
int cchTextMax
Definition: commctrl.h:656
static HTREEITEM hChild
Definition: treeview.c:381
#define SW_HIDE
Definition: winuser.h:762
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
int fmt
Definition: commctrl.h:657
#define expect(expected, got)
Definition: header.c:59
#define HDM_GETITEMRECT
Definition: commctrl.h:776
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
#define HDM_DELETEITEM
Definition: commctrl.h:728
int winetest_interactive
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define HDI_TEXT
Definition: commctrl.h:689
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
& rect
Definition: startmenu.cpp:1413
#define HDF_CENTER
Definition: commctrl.h:700
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HDF_STRING
Definition: commctrl.h:705
#define HDM_GETITEMCOUNT
Definition: commctrl.h:718
static const struct message getItem_seq[]
Definition: header.c:109
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define HDI_FORMAT
Definition: commctrl.h:690
#define ok(value,...)
LPSTR pszText
Definition: commctrl.h:654
LONG_PTR LPARAM
Definition: windef.h:208
int cxy
Definition: commctrl.h:653
#define HDM_SETORDERARRAY
Definition: commctrl.h:794
static const struct message insertItem_seq[]
Definition: header.c:101
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
#define HDM_GETORDERARRAY
Definition: commctrl.h:791
static const struct message add_header_to_parent_seq_interactive[]
Definition: header.c:75
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define HDF_LEFT
Definition: commctrl.h:698
static const struct message setItem_seq[]
Definition: header.c:132
#define ARRAY_SIZE(a)
Definition: main.h:24
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define HDM_GETITEMA
Definition: commctrl.h:731
UINT mask
Definition: commctrl.h:652
static const struct message deleteItem_getItemCount_seq[]
Definition: header.c:116
#define HDI_WIDTH
Definition: commctrl.h:687
#define HEADER_SEQ_INDEX
Definition: header.c:63
static const struct message orderArray_seq[]
Definition: header.c:126

Referenced by START_TEST().

◆ test_hdm_layout()

static void test_hdm_layout ( HWND  hParent)
static

Definition at line 857 of file header.c.

858 {
859  HWND hChild;
860  int retVal;
861  RECT rect;
862  HDLAYOUT hdLayout;
863  WINDOWPOS windowPos;
864  hdLayout.prc = &rect;
865  hdLayout.pwpos = &windowPos;
866 
870  "adder header control to parent", FALSE);
871 
873  retVal = SendMessageA(hChild, HDM_LAYOUT, 0, (LPARAM) &hdLayout);
874  expect(TRUE, retVal);
875 
876  ok_sequence(sequences, HEADER_SEQ_INDEX, layout_seq, "layout sequence testing", FALSE);
877 
879 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
& rect
Definition: startmenu.cpp:1413
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define HDM_LAYOUT
Definition: commctrl.h:752
LONG_PTR LPARAM
Definition: windef.h:208
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
RECT * prc
Definition: commctrl.h:748
WINDOWPOS * pwpos
Definition: commctrl.h:749
static const struct message layout_seq[]
Definition: header.c:145
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_orderarray()

static void test_hdm_orderarray ( void  )
static

Definition at line 1753 of file header.c.

1754 {
1755  HWND hwnd;
1756  INT order[5];
1757  DWORD ret;
1758 
1760 
1761  /* three items */
1762  addItem(hwnd, 0, NULL);
1763  addItem(hwnd, 1, NULL);
1764  addItem(hwnd, 2, NULL);
1765 
1767  if (!ret)
1768  {
1769  win_skip("HDM_GETORDERARRAY not implemented.\n");
1771  return;
1772  }
1773 
1774  expect(0, order[0]);
1775  expect(1, order[1]);
1776  expect(2, order[2]);
1777 
1778 if (0)
1779 {
1780  /* null pointer, crashes native */
1782  expect(FALSE, ret);
1783 }
1784  /* count out of limits */
1786  expect(FALSE, ret);
1787  /* count out of limits */
1789  expect(FALSE, ret);
1790 
1791  /* try with out of range item index */
1792  /* (0,1,2)->(1,0,3) => (1,0,2) */
1793  check_orderarray(hwnd, 0x120, 0x103, 0x102, FALSE, __LINE__);
1794  /* (1,0,2)->(3,0,1) => (0,2,1) */
1795  check_orderarray(hwnd, 0x102, 0x301, 0x021, TRUE, __LINE__);
1796  /* (0,2,1)->(2,3,1) => (2,0,1) */
1797  check_orderarray(hwnd, 0x021, 0x231, 0x201, FALSE, __LINE__);
1798 
1799  /* (0,1,2)->(0,2,2) => (0,1,2) */
1800  check_orderarray(hwnd, 0x012, 0x022, 0x012, FALSE, __LINE__);
1801 
1802  addItem(hwnd, 3, NULL);
1803 
1804  /* (0,1,2,3)->(0,1,2,2) => (0,1,3,2) */
1805  check_orderarray(hwnd, 0x0123, 0x0122, 0x0132, FALSE, __LINE__);
1806  /* (0,1,2,3)->(0,1,3,3) => (0,1,2,3) */
1807  check_orderarray(hwnd, 0x0123, 0x0133, 0x0123, FALSE, __LINE__);
1808  /* (0,1,2,3)->(0,4,2,3) => (0,1,2,3) */
1809  check_orderarray(hwnd, 0x0123, 0x0423, 0x0123, FALSE, __LINE__);
1810  /* (0,1,2,3)->(4,0,1,2) => (0,1,3,2) */
1811  check_orderarray(hwnd, 0x0123, 0x4012, 0x0132, TRUE, __LINE__);
1812  /* (0,1,3,2)->(4,0,1,4) => (0,3,1,2) */
1813  check_orderarray(hwnd, 0x0132, 0x4014, 0x0312, TRUE, __LINE__);
1814  /* (0,1,2,3)->(4,1,0,2) => (1,0,3,2) */
1815  check_orderarray(hwnd, 0x0123, 0x4102, 0x1032, TRUE, __LINE__);
1816  /* (0,1,2,3)->(0,1,4,2) => (0,1,2,3) */
1817  check_orderarray(hwnd, 0x0123, 0x0142, 0x0132, FALSE, __LINE__);
1818  /* (0,1,2,3)->(4,4,4,4) => (0,1,2,3) */
1819  check_orderarray(hwnd, 0x0123, 0x4444, 0x0123, FALSE, __LINE__);
1820  /* (0,1,2,3)->(4,4,1,2) => (0,1,3,2) */
1821  check_orderarray(hwnd, 0x0123, 0x4412, 0x0132, TRUE, __LINE__);
1822  /* (0,1,2,3)->(4,4,4,1) => (0,2,3,1) */
1823  check_orderarray(hwnd, 0x0123, 0x4441, 0x0231, TRUE, __LINE__);
1824  /* (0,1,2,3)->(1,4,4,4) => (1,0,2,3) */
1825  check_orderarray(hwnd, 0x0123, 0x1444, 0x1023, FALSE, __LINE__);
1826  /* (0,1,2,3)->(4,2,4,1) => (0,2,3,1) */
1827  check_orderarray(hwnd, 0x0123, 0x4241, 0x0231, FALSE, __LINE__);
1828  /* (0,1,2,3)->(4,2,0,1) => (2,0,3,1) */
1829  check_orderarray(hwnd, 0x0123, 0x4201, 0x2031, TRUE, __LINE__);
1830  /* (3,2,1,0)->(4,2,0,1) => (3,2,0,1) */
1831  check_orderarray(hwnd, 0x3210, 0x4201, 0x3201, FALSE, __LINE__);
1832 
1834 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define TRUE
Definition: types.h:120
static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected, BOOL todo, int line)
Definition: header.c:1721
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define HDM_SETORDERARRAY
Definition: commctrl.h:794
static HWND create_header_control(void)
Definition: header.c:321
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HDM_GETORDERARRAY
Definition: commctrl.h:791
int ret
static LONG addItem(HWND hdex, int idx, LPSTR text)
Definition: header.c:246
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_hdm_ordertoindex()

static void test_hdm_ordertoindex ( HWND  hParent)
static

Definition at line 881 of file header.c.

882 {
883  HWND hChild;
884  int retVal;
885 
889  "adder header control to parent", FALSE);
890 
892  retVal = SendMessageA(hChild, HDM_ORDERTOINDEX, 1, 0);
893  expect(1, retVal);
894 
895  ok_sequence(sequences, HEADER_SEQ_INDEX, orderToIndex_seq, "orderToIndex sequence testing", FALSE);
897 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
#define HDM_ORDERTOINDEX
Definition: commctrl.h:785
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
static const struct message orderToIndex_seq[]
Definition: header.c:150
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_sethotdivider()

static void test_hdm_sethotdivider ( HWND  hParent)
static

Definition at line 946 of file header.c.

947 {
948  HWND hChild;
949  int retVal;
950  /* low word: x coordinate = 5
951  * high word: y coordinate = 5
952  */
953 
957  "adder header control to parent", FALSE);
958 
961  expect(0, retVal);
962 
963  retVal = SendMessageA(hChild, HDM_SETHOTDIVIDER, FALSE, 100);
964  expect(100, retVal);
966  expect(1, retVal);
969  "setHotDivider sequence testing", TRUE);
970  else
972  "setHotDivider sequence testing", FALSE);
973 
975 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
#define HDM_SETHOTDIVIDER
Definition: commctrl.h:797
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
int winetest_interactive
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
static const struct message setHotDivider_seq_interactive[]
Definition: header.c:162
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static const struct message setHotDivider_seq_noninteractive[]
Definition: header.c:174
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hdm_unicodeformatMessages()

static void test_hdm_unicodeformatMessages ( HWND  hParent)
static

Definition at line 1068 of file header.c.

1069 {
1070  HWND hChild;
1071  int retVal;
1072 
1076  "adder header control to parent", FALSE);
1077 
1080  expect(0, retVal);
1081  retVal = SendMessageA(hChild, HDM_GETUNICODEFORMAT, 0, 0);
1082  expect(1, retVal);
1083 
1085  "unicodeformatMessages sequence testing", FALSE);
1087 }
#define NUM_MSG_SEQUENCES
Definition: header.c:61
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define expect(expected, got)
Definition: header.c:59
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PARENT_SEQ_INDEX
Definition: header.c:62
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static const struct message unicodeformatMessages_seq[]
Definition: header.c:207
#define HDM_GETUNICODEFORMAT
Definition: commctrl.h:809
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define HDM_SETUNICODEFORMAT
Definition: commctrl.h:806
#define HEADER_SEQ_INDEX
Definition: header.c:63

Referenced by START_TEST().

◆ test_hds_nosizing()

static void test_hds_nosizing ( HWND  hParent)
static

Definition at line 1293 of file header.c.

1294 {
1295  HWND hChild;
1296  HDITEMA hdItem;
1297  DWORD ret;
1298  RECT rect;
1299  HDHITTESTINFO ht;
1300 
1302 
1303  memset(&hdItem, 0, sizeof(hdItem));
1304  hdItem.mask = HDI_WIDTH;
1305  hdItem.cxy = 80;
1306 
1307  ret = SendMessageA(hChild, HDM_INSERTITEMA, 0, (LPARAM)&hdItem);
1308  expect(0, ret);
1309 
1310  /* HDS_NOSIZING only blocks hittesting */
1312  SetWindowLongA(hChild, GWL_STYLE, ret | HDS_NOSIZING);
1313 
1314  /* try to change width with mouse gestures */
1315  rect.right = rect.bottom = 0;
1317  ok(rect.right != 0, "Expected not zero width\n");
1318  ok(rect.bottom != 0, "Expected not zero height\n");
1319 
1320  SendMessageA(hChild, WM_LBUTTONDOWN, 0, MAKELPARAM(rect.right, rect.bottom / 2));
1321  SendMessageA(hChild, WM_MOUSEMOVE, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1322  SendMessageA(hChild, WM_LBUTTONUP, 0, MAKELPARAM(rect.right + 20, rect.bottom / 2));
1323 
1325 
1326  if (hdItem.cxy != rect.right)
1327  {
1328  win_skip("HDS_NOSIZING style not supported\n");
1330  return;
1331  }
1332 
1333  /* this style doesn't set HDF_FIXEDWIDTH for items */
1334  hdItem.mask = HDI_FORMAT;
1335  ret = SendMessageA(hChild, HDM_GETITEMA, 0, (LPARAM)&hdItem);
1336  expect(TRUE, ret);
1337  ok(!(hdItem.fmt & HDF_FIXEDWIDTH), "Unexpected HDF_FIXEDWIDTH\n");
1338 
1339  /* try to adjust with message */
1340  hdItem.mask = HDI_WIDTH;
1341  hdItem.cxy = 90;
1342 
1343  ret = SendMessageA(hChild, HDM_SETITEMA, 0, (LPARAM)&hdItem);
1344  expect(TRUE, ret);
1345 
1346  rect.right = 0;
1348  expect(90, rect.right);
1349 
1350  /* hittesting doesn't report ondivider flags for HDS_NOSIZING */
1351  ht.pt.x = rect.right - 1;
1352  ht.pt.y = rect.bottom / 2;
1354  expect(HHT_ONHEADER, ht.flags);
1355 
1356  /* try to adjust with message */
1358  SetWindowLongA(hChild, GWL_STYLE, ret & ~HDS_NOSIZING);
1359 
1360  ht.pt.x = 90;
1361  ht.pt.y = rect.bottom / 2;
1363  expect(HHT_ONDIVIDER, ht.flags);
1364 
1366 }
#define HDM_SETITEMA
Definition: commctrl.h:738
#define TRUE
Definition: types.h:120
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
static HTREEITEM hChild
Definition: treeview.c:381
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
int fmt
Definition: commctrl.h:657
#define expect(expected, got)
Definition: header.c:59
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define HDM_GETITEMRECT
Definition: commctrl.h:776
BOOL WINAPI DestroyWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
#define HDM_HITTEST
Definition: commctrl.h:774
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define HHT_ONHEADER
Definition: commctrl.h:756
#define HDI_FORMAT
Definition: commctrl.h:690
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
int cxy
Definition: commctrl.h:653
#define HHT_ONDIVIDER
Definition: commctrl.h:757
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define GWL_STYLE
Definition: winuser.h:846
#define WM_LBUTTONUP
Definition: winuser.h:1759
static const struct newhuff ht[]
Definition: huffman.h:296
#define WM_MOUSEMOVE
Definition: winuser.h:1757
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define HDM_GETITEMA
Definition: commctrl.h:731
UINT mask
Definition: commctrl.h:652
#define HDI_WIDTH
Definition: commctrl.h:687
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_header_control()

static void test_header_control ( void  )
static

Definition at line 721 of file header.c.

722 {
723  LONG res;
724  static char buffer[MAX_CHARS];
725  int i;
726 
728 
729  for (i = 3; i >= 0; i--)
730  {
732  res = addItem(hWndHeader, 0, str_items[i]);
733  ok(res == 0, "Adding simple item failed (%d)\n", res);
734  }
735 
737  res = addItem(hWndHeader, 99, str_items[i+1]);
738  ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
740  res = addItem(hWndHeader, 5, str_items[i+1]);
741  ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
743 
744  for (i = 0; i < 4; i++) { TEST_GET_ITEM(i,i); TEST_GET_ITEMCOUNT(6); }
745 
747  ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer);
749  ok(res == 1, "Getting Out of Range item should fail with 1 (%d), got %s\n", res,buffer);
751  ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer);
752 
754  {
757  }
758 
761  ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res);
763  ok(res == 1, "Setting Out of Range item should fail with 1 (%d)\n", res);
765  ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res);
767 
768  for (i = 0; i < 4; i++)
769  {
771  ok(res != 0, "Setting %d item failed (%d)\n", i+1, res);
772  TEST_GET_ITEM(i, 4);
774  }
775 
779  setItem(hWndHeader, 3, str_items[4], TRUE);
780 
784  setItem(hWndHeader, 0, str_items[4], TRUE);
785  /* unexpected notifies cleared by notifies_received in setItem */
789  /* unexpected notifies cleared by notifies_received in setItem */
790  delItem(hWndHeader, 0);
791 
795  check_mask();
797 
798  res = delItem(hWndHeader, 5);
799  ok(res == 1, "Deleting Out of Range item should fail with 1 (%d)\n", res);
800  res = delItem(hWndHeader, -2);
801  ok(res == 0, "Deleting Out of Range item should fail with 0 (%d)\n", res);
803 
804  res = delItem(hWndHeader, 3);
805  ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
807  res = delItem(hWndHeader, 0);
808  ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
810  res = delItem(hWndHeader, 0);
811  ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
813  res = delItem(hWndHeader, 0);
814  ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
816 
818 }
static HWND hHeaderParentWnd
Definition: header.c:53
#define HDN_GETDISPINFOA
Definition: commctrl.h:838
#define TRUE
Definition: types.h:120
#define TEST_GET_ITEM(i, c)
Definition: header.c:394
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAX_CHARS
Definition: header.c:55
BOOL WINAPI UpdateWindow(_In_ HWND)
static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
Definition: header.c:303
static void check_mask(void)
Definition: header.c:666
GLuint buffer
Definition: glext.h:5915
UINT_PTR WPARAM
Definition: windef.h:207
int winetest_interactive
BOOL WINAPI DestroyWindow(_In_ HWND)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
long LONG
Definition: pedump.c:60
#define ok(value,...)
#define HDN_GETDISPINFOW
Definition: commctrl.h:839
static WCHAR pszUniTestW[]
Definition: header.c:391
static void check_auto_fields(void)
Definition: header.c:613
static HWND create_header_control(void)
Definition: header.c:321
#define NF_REQUERY
Definition: winuser.h:2436
static void dont_expect_notify(INT iCode)
Definition: header.c:231
static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText)
Definition: header.c:274
#define TEST_GET_ITEMCOUNT(i)
Definition: header.c:400
static HWND hWndHeader
Definition: header.c:54
static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
Definition: header.c:256
static LONG delItem(HWND hdex, int idx)
Definition: header.c:293
GLuint res
Definition: glext.h:9613
static LONG addItem(HWND hdex, int idx, LPSTR text)
Definition: header.c:246
static char pszUniTestA[]
Definition: header.c:390
#define HDM_SETUNICODEFORMAT
Definition: commctrl.h:806
static char * str_items[]
Definition: header.c:387
#define LPSTR_TEXTCALLBACKA
Definition: commctrl.h:2353

Referenced by START_TEST().

◆ test_header_order()

static void test_header_order ( void  )
static

Definition at line 1554 of file header.c.

1555 {
1556  const int rand1[] = {0, 1, 1, 0, 4};
1557  const int rand2[] = {4, 5, 6, 7, 4};
1558  const int rand3[] = {5, 5, 1, 6, 1};
1559  const int rand4[] = {1, 5, 2, 7, 6, 1, 4, 2, 3, 2};
1560  const int rand5[] = {7, 8, 5, 6, 7, 2, 1, 9, 10, 10};
1561  const int rand6[] = {2, 8, 3, 4, 0};
1562 
1563  const int ids1[] = {3, 0, 2, 1, 4};
1564  const int ord1[] = {0, 1, 2, 3, 4};
1565  const int ids2[] = {3, 9, 7, 0, 2, 1, 4, 8, 6, 5};
1566  const int ord2[] = {0, 4, 7, 1, 2, 3, 9, 8, 6, 5};
1567  const int ord3[] = {0, 3, 9, 2, 1, 8, 7, 6, 5, 4};
1568  const int ids4[] = {9, 0, 1, 8, 6};
1569  const int ord4[] = {1, 0, 4, 3, 2};
1570 
1571  char buffer[20];
1572  HDITEMA hdi;
1573  int i;
1574 
1576 
1577  ZeroMemory(&hdi, sizeof(HDITEMA));
1578  hdi.mask = HDI_TEXT | HDI_LPARAM;
1579  hdi.pszText = buffer;
1580  strcpy(buffer, "test");
1581 
1582  for (i = 0; i < 5; i++)
1583  {
1584  hdi.lParam = i;
1585  SendMessageA(hWndHeader, HDM_INSERTITEMA, rand1[i], (LPARAM)&hdi);
1586  }
1587  check_order(ids1, ord1, 5, "insert without iOrder");
1588 
1589  hdi.mask |= HDI_ORDER;
1590  for (i = 0; i < 5; i++)
1591  {
1592  hdi.lParam = i + 5;
1593  hdi.iOrder = rand2[i];
1594  SendMessageA(hWndHeader, HDM_INSERTITEMA, rand3[i], (LPARAM)&hdi);
1595  }
1596  check_order(ids2, ord2, 10, "insert with order");
1597 
1598  hdi.mask = HDI_ORDER;
1599  for (i=0; i<10; i++)
1600  {
1601  hdi.iOrder = rand5[i];
1602  SendMessageA(hWndHeader, HDM_SETITEMA, rand4[i], (LPARAM)&hdi);
1603  }
1604  check_order(ids2, ord3, 10, "setitems changing order");
1605 
1606  for (i=0; i<5; i++)
1607  SendMessageA(hWndHeader, HDM_DELETEITEM, rand6[i], 0);
1608  check_order(ids4, ord4, 5, "deleteitem");
1609 
1611 }
#define HDM_SETITEMA
Definition: commctrl.h:738
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_INSERTITEMA
Definition: commctrl.h:721
#define ZeroMemory
Definition: winbase.h:1635
GLuint buffer
Definition: glext.h:5915
#define HDM_DELETEITEM
Definition: commctrl.h:728
#define HDI_TEXT
Definition: commctrl.h:689
BOOL WINAPI DestroyWindow(_In_ HWND)
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
LPSTR pszText
Definition: commctrl.h:654
LONG_PTR LPARAM
Definition: windef.h:208
static HWND create_header_control(void)
Definition: header.c:321
static HWND hWndHeader
Definition: header.c:54
int iOrder
Definition: commctrl.h:660
static void check_order(const int expected_id[], const int expected_order[], int count, const char *type)
Definition: header.c:1536
#define HDI_ORDER
Definition: commctrl.h:695
#define HDI_LPARAM
Definition: commctrl.h:691
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
LPARAM lParam
Definition: commctrl.h:658
UINT mask
Definition: commctrl.h:652

Referenced by START_TEST().

◆ test_item_auto_format()

static void test_item_auto_format ( HWND  parent)
static

Definition at line 554 of file header.c.

555 {
556  static char text[] = "Test";
557  HDITEMA item;
558  HBITMAP hbm;
559  HWND hwnd;
560 
562 
563  /* Windows implicitly sets some format bits in INSERTITEM */
564 
565  /* HDF_STRING is automatically set and cleared for no text */
566  item.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
567  item.pszText = text;
568  item.cxy = 100;
569  item.fmt = HDF_CENTER;
571  ok(item.fmt == (HDF_STRING | HDF_CENTER), "Unexpected item format mask %#x.\n", item.fmt);
572 
573  item.mask = HDI_WIDTH | HDI_FORMAT;
574  item.pszText = text;
575  item.fmt = HDF_CENTER | HDF_STRING;
577  ok(item.fmt == HDF_CENTER, "Unexpected item format mask %#x.\n", item.fmt);
578 
579  /* HDF_BITMAP is automatically set and cleared for a NULL bitmap or no bitmap */
580  item.mask = HDI_BITMAP | HDI_WIDTH | HDI_FORMAT;
581  item.hbm = hbm = CreateBitmap(16, 16, 1, 8, NULL);
582  item.fmt = HDF_CENTER;
584  ok(item.fmt == (HDF_BITMAP | HDF_CENTER), "Unexpected item format mask %#x.\n", item.fmt);
585  DeleteObject(hbm);
586 
587  item.mask = HDI_BITMAP | HDI_WIDTH | HDI_FORMAT;
588  item.hbm = NULL;
589  item.fmt = HDF_CENTER | HDF_BITMAP;
591  ok(item.fmt == HDF_CENTER, "Unexpected item format mask %#x.\n", item.fmt);
592 
593  item.mask = HDI_WIDTH | HDI_FORMAT;