ReactOS 0.4.16-dev-197-g92996da
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]);\
}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
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 getItem(HWND hdex, int idx, LPSTR textBuffer)
Definition: header.c:303
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);\
}
static LONG getItemCount(HWND hdex)
Definition: header.c:298

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));
@ lparam
Definition: SystemMenu.c:31
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285

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}
unsigned int idx
Definition: utils.c:41
const WCHAR * text
Definition: package.c:1794
#define HDI_TEXT
Definition: commctrl.h:704
#define HDM_INSERTITEMA
Definition: commctrl.h:736
#define HDI_WIDTH
Definition: commctrl.h:702
UINT mask
Definition: commctrl.h:667
LPSTR pszText
Definition: commctrl.h:669
int cchTextMax
Definition: commctrl.h:671
int cxy
Definition: commctrl.h:668
LONG_PTR LPARAM
Definition: windef.h:208
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

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}
#define HDM_GETITEMA
Definition: commctrl.h:746
#define HDM_DELETEITEM
Definition: commctrl.h:743
#define ZeroMemory
Definition: winbase.h:1736

Referenced by check_auto_fields().

◆ BOOL()

static BOOL ( WINAPI pImageList_Destroy)
static

◆ 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}
#define NULL
Definition: types.h:112
pKey DeleteObject()
static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
Definition: header.c:312
#define TEST_GET_ITEMCOUNT(i)
Definition: header.c:400
long LONG
Definition: pedump.c:60
#define HDF_CENTER
Definition: commctrl.h:715
#define HDI_BITMAP
Definition: commctrl.h:707
#define HDF_STRING
Definition: commctrl.h:720
#define HDI_FORMAT
Definition: commctrl.h:705
#define HDI_LPARAM
Definition: commctrl.h:706
#define HDI_IMAGE
Definition: commctrl.h:708
HBITMAP hbm
Definition: commctrl.h:670
int iImage
Definition: commctrl.h:674
int fmt
Definition: commctrl.h:672
LPARAM lParam
Definition: commctrl.h:673
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
char CHAR
Definition: xmlstorage.h:175

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 iOrder
Definition: commctrl.h:675
int ret
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 {
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}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define HDI_ORDER
Definition: commctrl.h:710
static LRESULT expected_id
Definition: win.c:4343

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}
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: _set.h:50
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint start
Definition: gl.h:1545
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
BOOL todo
Definition: filedlg.c:313
BOOL expected
Definition: store.c:2063
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define HDM_SETORDERARRAY
Definition: commctrl.h:809
#define HDM_GETITEMCOUNT
Definition: commctrl.h:733
#define HDM_GETORDERARRAY
Definition: commctrl.h:806
Definition: parser.c:49
int32_t INT
Definition: typedefs.h:58
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

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 CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
static HRGN INT iCode
Definition: mapping.c:33
#define LPSTR_TEXTCALLBACKA
Definition: commctrl.h:2386
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

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
523 ShowWindow (hParent, SW_SHOW);
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}
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:99
#define NUM_MSG_SEQUENCES
Definition: header.c:61
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:405
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: header.c:65
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static TCHAR * items[]
Definition: page1.c:45
#define WS_CHILD
Definition: pedump.c:617
#define WS_BORDER
Definition: pedump.c:625
#define WS_VISIBLE
Definition: pedump.c:620
#define HDS_BUTTONS
Definition: commctrl.h:629
#define HDF_LEFT
Definition: commctrl.h:713
#define WC_HEADERA
Definition: commctrl.h:623
#define HDM_LAYOUT
Definition: commctrl.h:767
#define HDS_HORZ
Definition: commctrl.h:628
int winetest_interactive
WINDOWPOS * pwpos
Definition: commctrl.h:764
RECT * prc
Definition: commctrl.h:763
HWND hwndInsertAfter
Definition: winuser.h:3592
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
#define SetWindowLongPtrA
Definition: winuser.h:5357
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 ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SW_SHOW
Definition: winuser.h:778
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909

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}
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
static BOOL register_parent_wnd_class(void)
Definition: header.c:458
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define SM_CXSIZEFRAME
Definition: winuser.h:996
#define CW_USEDEFAULT
Definition: winuser.h:225
#define SM_CYCAPTION
Definition: winuser.h:966
#define SM_CYSIZEFRAME
Definition: winuser.h:998
int WINAPI GetSystemMetrics(_In_ int)

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

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 */
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}
#define FALSE
Definition: types.h:117
GLdouble n
Definition: glext.h:7729
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom)
Definition: header.c:1368
static DWORD g_customheight
Definition: header.c:45
#define CDDS_PREPAINT
Definition: commctrl.h:280

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:
1408 return CDRF_NOTIFYITEMDRAW;
1409 case 1:
1411 return 0;
1412 case 2:
1414 return 0;
1415 case 3:
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}
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275

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:
1436 case 1:
1438 return 0;
1439 case 2:
1441 return 0;
1442 case 3:
1444 return 0;
1445 case 4:
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_NOTIFYPOSTERASE
Definition: commctrl.h:277
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:274
#define CDDS_POSTPAINT
Definition: commctrl.h:281
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:270

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:
1467 case 1:
1469 return 0;
1470 case 2:
1472 return 0;
1473 case 3:
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}

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}

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 INT unexpectedNotify[10]
Definition: header.c:50
static INT nUnexpectedNotify
Definition: header.c:51
static INT nExpectedNotify
Definition: header.c:48

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 {
228 }
229}
static EXPECTEDNOTIFY expectedNotify[10]
Definition: header.c:47
HDITEMA hdItem
Definition: header.c:36

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}
static char * textBuffer
Definition: combo.c:58
#define MAX_CHARS
Definition: header.c:55

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}

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}
GLenum GLint GLuint mask
Definition: glext.h:6028
static ATOM item
Definition: dde.c:856
#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++;
421 defwndproc_counter--;
422
423 return ret;
424}
@ sent
Definition: SystemMenu.c:27
@ defwinproc
Definition: SystemMenu.c:32
@ wparam
Definition: SystemMenu.c:30
#define add_message(msg)
Definition: SystemMenu.c:98
#define msg(x)
Definition: auth_time.c:54
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define HEADER_SEQ_INDEX
Definition: header.c:63
Definition: tftpd.h:60
UINT message
Definition: SystemMenu.c:42
#define GetWindowLongPtrA
Definition: winuser.h:4831
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

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
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");
1654 compare(di->rcItem.top, g_DrawItem.rcItem.top, "%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}
HWND hWnd
Definition: settings.c:17
#define TRUE
Definition: types.h:120
char hdr[14]
Definition: iptest.cpp:33
static CUSTOMDRAWPROC g_CustomDrawProc
Definition: header.c:41
#define compare(val, exp, fmt)
Definition: header.c:57
static DRAWITEMSTRUCT g_DrawItem
Definition: header.c:43
static void compare_items(INT iCode, HDITEMA *hdi1, HDITEMA *hdi2, BOOL fUnicode)
Definition: header.c:347
static int g_CustomDrawCount
Definition: header.c:42
static INT nReceivedNotify
Definition: header.c:49
static BOOL g_DrawItemReceived
Definition: header.c:44
#define L(x)
Definition: ntvdm.h:50
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define WM_NOTIFY
Definition: richedit.h:61
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_DRAWITEM
Definition: winuser.h:1648
#define WM_DESTROY
Definition: winuser.h:1612

Referenced by init().

◆ HIMAGELIST()

static HIMAGELIST ( WINAPI pImageList_Create)
static

◆ init()

static BOOL init ( void  )
static

Definition at line 1680 of file header.c.

1681{
1682 WNDCLASSA wc;
1684 HFONT hOldFont;
1685 HDC hdc;
1686
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);
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,
1714 ok(hHeaderParentWnd != NULL, "failed to create parent wnd\n");
1715
1717 return hHeaderParentWnd != NULL;
1718}
#define trace
Definition: atltest.h:70
HDC hdc
Definition: main.c:9
static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: header.c:1613
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HBRUSH hbrBackground
Definition: winuser.h:3173
HICON hIcon
Definition: winuser.h:3171
HINSTANCE hInstance
Definition: winuser.h:3170
HCURSOR hCursor
Definition: winuser.h:3172
int cbWndExtra
Definition: winuser.h:3169
UINT style
Definition: winuser.h:3166
LPCSTR lpszMenuName
Definition: winuser.h:3174
LPCSTR lpszClassName
Definition: winuser.h:3175
WNDPROC lpfnWndProc
Definition: winuser.h:3167
int cbClsExtra
Definition: winuser.h:3168
Definition: time.h:68
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define SYSTEM_FONT
Definition: wingdi.h:911
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CS_VREDRAW
Definition: winuser.h:658
#define COLOR_WINDOW
Definition: winuser.h:921
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HDC WINAPI GetDC(_In_opt_ HWND)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2142
const char * LPCSTR
Definition: xmlstorage.h:183

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:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define X(f)

Referenced by START_TEST().

◆ notifies_received()

static BOOL notifies_received ( void  )
static

Definition at line 238 of file header.c.

239{
243 return fRet;
244}
unsigned int BOOL
Definition: ntddk_ex.h:94

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 &&
435 message != WM_NCPAINT &&
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}
#define PARENT_SEQ_INDEX
Definition: header.c:62
#define WM_PAINT
Definition: winuser.h:1623
#define WM_ERASEBKGND
Definition: winuser.h:1628
#define WM_NCHITTEST
Definition: winuser.h:1689
#define WM_GETTEXT
Definition: winuser.h:1621
#define WM_DEVICECHANGE
Definition: winuser.h:1814
#define WM_NCPAINT
Definition: winuser.h:1690

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;
470 cls.lpszMenuName = NULL;
471 cls.lpszClassName = "Header test parent class";
472 return RegisterClassA(&cls);
473}
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: header.c:426
#define WHITE_BRUSH
Definition: wingdi.h:902

Referenced by create_custom_parent_window(), and create_parent_window().

◆ run_customdraw_scenario()

static void run_customdraw_scenario ( CUSTOMDRAWPROC  proc)
static

Definition at line 1482 of file header.c.

1483{
1490}
static HANDLE proc()
Definition: pdb.c:34
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

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 {
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}
static BOOL notifies_received(void)
Definition: header.c:238
static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
Definition: header.c:219
#define HDM_SETITEMA
Definition: commctrl.h:753
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:837
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:839

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
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 HDN_ITEMCHANGEDW
Definition: commctrl.h:840
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:838
UINT mask
Definition: commctrl.h:684
LPWSTR pszText
Definition: commctrl.h:686

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
1844
1845 if (!init())
1846 return;
1847
1853
1855
1857 parent_hwnd = create_custom_parent_window();
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
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}
#define ok_sequence(exp, contx, todo)
Definition: SystemMenu.c:275
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:393
static void test_header_order(void)
Definition: header.c:1554
static void test_hdm_getitemrect(HWND hParent)
Definition: header.c:820
static void test_hds_nosizing(HWND hParent)
Definition: header.c:1293
static void test_hdm_unicodeformatMessages(HWND hParent)
Definition: header.c:1068
static void test_hdm_orderarray(void)
Definition: header.c:1753
static void test_hdm_index_messages(HWND hParent)
Definition: header.c:1111
static void test_hdm_sethotdivider(HWND hParent)
Definition: header.c:946
static void test_hdm_filterMessages(HWND hParent)
Definition: header.c:1009
static void test_customdraw(void)
Definition: header.c:1492
static void test_hdm_bitmapmarginMessages(HWND hParent)
Definition: header.c:1089
static void test_item_auto_format(HWND parent)
Definition: header.c:554
static void test_hdm_hittest(HWND hParent)
Definition: header.c:899
static BOOL init(void)
Definition: header.c:1680
static void test_hdm_imageMessages(HWND hParent)
Definition: header.c:977
static void test_hdm_ordertoindex(HWND hParent)
Definition: header.c:881
static HWND create_custom_parent_window(void)
Definition: header.c:475
static void test_hdf_fixedwidth(HWND hParent)
Definition: header.c:1225
static void test_hdm_layout(HWND hParent)
Definition: header.c:857
static void test_header_control(void)
Definition: header.c:721
static const struct message create_parent_wnd_seq[]
Definition: header.c:67
static void init_functions(void)
Definition: header.c:1670
uint32_t ULONG_PTR
Definition: typedefs.h:65
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:73
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:65
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ 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;
1529 ok(g_DrawItemReceived, "WM_DRAWITEM not received\n");
1531 hWndHeader = NULL;
1532 g_DrawItem.CtlType = 0;
1534}
static void run_customdraw_scenario(CUSTOMDRAWPROC proc)
Definition: header.c:1482
static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1397
static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1378
static HWND create_header_control(void)
Definition: header.c:321
static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1455
static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
Definition: header.c:1424
#define ODT_HEADER
Definition: commctrl.h:78
#define HDF_OWNERDRAW
Definition: commctrl.h:719
#define HDM_GETITEMRECT
Definition: commctrl.h:791
& rect
Definition: startmenu.cpp:1413
Definition: name.c:39

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;
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}
static const struct newhuff ht[]
Definition: huffman.h:296
static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
Definition: header.c:487
#define expect(expected, got)
Definition: header.c:59
static HTREEITEM hChild
Definition: treeview.c:383
#define HDM_HITTEST
Definition: commctrl.h:789
#define HHT_ONDIVIDER
Definition: commctrl.h:772
#define HHT_ONHEADER
Definition: commctrl.h:771
#define win_skip
Definition: test.h:163
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_LBUTTONUP
Definition: winuser.h:1780

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}
static const struct message bitmapmarginMessages_seq[]
Definition: header.c:213
static const struct message add_header_to_parent_seq[]
Definition: header.c:94
#define HDM_GETBITMAPMARGIN
Definition: commctrl.h:818

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
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}
static const struct message filterMessages_seq_noninteractive[]
Definition: header.c:198
static const struct message filterMessages_seq_interactive[]
Definition: header.c:188
#define todo_wine
Definition: custom.c:89
#define HDM_EDITFILTER
Definition: commctrl.h:830
#define HDM_SETFILTERCHANGETIMEOUT
Definition: commctrl.h:827
#define HDM_CLEARFILTER
Definition: commctrl.h:833
Definition: dhcpd.h:245

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
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
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}
static const struct message getItemRect_seq[]
Definition: header.c:138

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 pt(x, y)
Definition: drawing.c:79
static const struct message hittest_seq[]
Definition: header.c:155
#define HHT_BELOW
Definition: commctrl.h:777

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}
static const struct message imageMessages_seq[]
Definition: header.c:181
struct _IMAGELIST * HIMAGELIST
Definition: commctrl.h:324
#define HDM_SETIMAGELIST
Definition: commctrl.h:794
#define HDM_CREATEDRAGIMAGE
Definition: commctrl.h:803
#define HDM_GETIMAGELIST
Definition: commctrl.h:797

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 ARRAY_SIZE(A)
Definition: main.h:20
static const struct message add_header_to_parent_seq_interactive[]
Definition: header.c:75
static const struct message deleteItem_getItemCount_seq[]
Definition: header.c:116
static const struct message setItem_seq[]
Definition: header.c:132
static const struct message insertItem_seq[]
Definition: header.c:101
static const struct message getItem_seq[]
Definition: header.c:109
static const struct message orderArray_seq[]
Definition: header.c:126
#define HDF_RIGHT
Definition: commctrl.h:714
#define SW_HIDE
Definition: winuser.h:771

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}
static const struct message layout_seq[]
Definition: header.c:145

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
1778if (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}
static LONG addItem(HWND hdex, int idx, LPSTR text)
Definition: header.c:246
static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected, BOOL todo, int line)
Definition: header.c:1721

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}
static const struct message orderToIndex_seq[]
Definition: header.c:150
#define HDM_ORDERTOINDEX
Definition: commctrl.h:800

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
964 expect(100, retVal);
966 expect(1, retVal);
969 "setHotDivider sequence testing", TRUE);
970 else
972 "setHotDivider sequence testing", FALSE);
973
975}
static const struct message setHotDivider_seq_interactive[]
Definition: header.c:162
static const struct message setHotDivider_seq_noninteractive[]
Definition: header.c:174
#define HDM_SETHOTDIVIDER
Definition: commctrl.h:812

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}
static const struct message unicodeformatMessages_seq[]
Definition: header.c:207
#define HDM_SETUNICODEFORMAT
Definition: commctrl.h:821
#define HDM_GETUNICODEFORMAT
Definition: commctrl.h:824

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;
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}
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define GWL_STYLE
Definition: winuser.h:855

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 {
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
780
785 /* unexpected notifies cleared by notifies_received in setItem */
789 /* unexpected notifies cleared by notifies_received in setItem */
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 void check_mask(void)
Definition: header.c:666
static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText)
Definition: header.c:274
static void dont_expect_notify(INT iCode)
Definition: header.c:231
static WCHAR pszUniTestW[]
Definition: header.c:391
static void check_auto_fields(void)
Definition: header.c:613
static LONG delItem(HWND hdex, int idx)
Definition: header.c:293
static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
Definition: header.c:256
static char pszUniTestA[]
Definition: header.c:390
#define TEST_GET_ITEM(i, c)
Definition: header.c:394
#define HDN_GETDISPINFOA
Definition: commctrl.h:853
#define HDN_GETDISPINFOW
Definition: commctrl.h:854
UINT_PTR WPARAM
Definition: windef.h:207
#define NF_REQUERY
Definition: winuser.h:2464

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;
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];
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++)
1608 check_order(ids4, ord4, 5, "deleteitem");
1609
1611}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static void check_order(const int expected_id[], const int expected_order[], int count, const char *type)
Definition: header.c:1536

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";
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 */
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 */
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);
586
588 item.hbm = NULL;
589 item.fmt = HDF_CENTER | HDF_BITMAP;
591 ok(item.fmt == HDF_CENTER, "Unexpected item format mask %#x.\n", item.fmt);
592
593 item.mask = HDI_WIDTH | HDI_FORMAT;
594 item.fmt = HDF_CENTER | HDF_BITMAP;
596 ok(item.fmt == HDF_CENTER, "Unexpected item format mask %#x.\n", item.fmt);
597
598 /* HDF_IMAGE is automatically set but not cleared */
600 item.iImage = 17;
602 ok(item.fmt == (HDF_IMAGE | HDF_CENTER), "Unexpected item format mask %#x.\n", item.fmt);
603
604 item.mask = HDI_WIDTH | HDI_FORMAT;
605 item.fmt = HDF_CENTER | HDF_IMAGE;
606 item.iImage = 0;
608 ok(item.fmt == (HDF_CENTER | HDF_IMAGE), "Unexpected item format mask %#x.\n", item.fmt);
609
611}
r parent
Definition: btrfs.c:3010
static HBITMAP
Definition: button.c:44
static void header_item_getback(HWND hwnd, UINT mask, HDITEMA *item)
Definition: header.c:538
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
#define HDF_IMAGE
Definition: commctrl.h:723
#define HDF_BITMAP
Definition: commctrl.h:721

Referenced by START_TEST().

Variable Documentation

◆ add_header_to_parent_seq

const struct message add_header_to_parent_seq[]
static

◆ add_header_to_parent_seq_interactive

const struct message add_header_to_parent_seq_interactive[]
static
Initial value:
= {
{ WM_NOTIFYFORMAT, sent|lparam, 0, NF_QUERY },
{ WM_QUERYUISTATE, sent },
{ WM_SIZE, sent|wparam, 0 },
{ WM_MOVE, sent|wparam, 0 },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1833
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1664
#define WM_SIZE
Definition: winuser.h:1614
#define WM_SETFOCUS
Definition: winuser.h:1616
#define WM_ACTIVATE
Definition: winuser.h:1615
#define WM_SHOWWINDOW
Definition: winuser.h:1631
#define WM_IME_SETCONTEXT
Definition: winuser.h:1832
#define WM_NCACTIVATE
Definition: winuser.h:1691
#define WM_MOVE
Definition: winuser.h:1613
#define WM_ACTIVATEAPP
Definition: winuser.h:1635
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1665

Definition at line 75 of file header.c.

Referenced by test_hdm_index_messages().

◆ bitmapmarginMessages_seq

const struct message bitmapmarginMessages_seq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 213 of file header.c.

Referenced by test_hdm_bitmapmarginMessages().

◆ create_parent_wnd_seq

const struct message create_parent_wnd_seq[]
static
Initial value:
= {
{ 0 }
}
#define WM_CREATE
Definition: winuser.h:1611
#define WM_NCCREATE
Definition: winuser.h:1686
#define WM_GETMINMAXINFO
Definition: winuser.h:1643
#define WM_NCCALCSIZE
Definition: winuser.h:1688

Definition at line 67 of file header.c.

Referenced by START_TEST().

◆ deleteItem_getItemCount_seq

const struct message deleteItem_getItemCount_seq[]
static
Initial value:

Definition at line 116 of file header.c.

Referenced by test_hdm_index_messages().

◆ expectedNotify

EXPECTEDNOTIFY expectedNotify[10]
static

Definition at line 47 of file header.c.

Referenced by expect_notify(), and HeaderTestWndProc().

◆ filterMessages_seq_interactive

const struct message filterMessages_seq_interactive[]
static
Initial value:

Definition at line 188 of file header.c.

Referenced by test_hdm_filterMessages().

◆ filterMessages_seq_noninteractive

const struct message filterMessages_seq_noninteractive[]
static

◆ g_CustomDrawCount

int g_CustomDrawCount
static

Definition at line 42 of file header.c.

Referenced by HeaderTestWndProc(), and run_customdraw_scenario().

◆ g_CustomDrawProc

CUSTOMDRAWPROC g_CustomDrawProc
static

Definition at line 41 of file header.c.

Referenced by HeaderTestWndProc(), and run_customdraw_scenario().

◆ g_customheight

◆ g_DrawItem

DRAWITEMSTRUCT g_DrawItem
static

Definition at line 43 of file header.c.

Referenced by HeaderTestWndProc(), and test_customdraw().

◆ g_DrawItemReceived

BOOL g_DrawItemReceived
static

Definition at line 44 of file header.c.

Referenced by HeaderTestWndProc(), and test_customdraw().

◆ getItem_seq

const struct message getItem_seq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 109 of file header.c.

Referenced by test_hdm_index_messages().

◆ getItemRect_seq

const struct message getItemRect_seq[]
static
Initial value:

Definition at line 138 of file header.c.

Referenced by test_hdm_getitemrect().

◆ hHeaderParentWnd

HWND hHeaderParentWnd
static

Definition at line 53 of file header.c.

Referenced by create_header_control(), init(), START_TEST(), and test_header_control().

◆ hittest_seq

const struct message hittest_seq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 155 of file header.c.

Referenced by test_hdm_hittest().

◆ hWndHeader

◆ imageMessages_seq

const struct message imageMessages_seq[]
static
Initial value:

Definition at line 181 of file header.c.

Referenced by test_hdm_imageMessages().

◆ insertItem_seq

const struct message insertItem_seq[]
static
Initial value:

Definition at line 101 of file header.c.

Referenced by test_hdm_index_messages().

◆ int

int

Definition at line 29 of file header.c.

◆ layout_seq

const struct message layout_seq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 145 of file header.c.

Referenced by test_hdm_layout().

◆ nExpectedNotify

INT nExpectedNotify = 0
static

Definition at line 48 of file header.c.

Referenced by dont_expect_notify(), expect_notify(), HeaderTestWndProc(), and notifies_received().

◆ nReceivedNotify

INT nReceivedNotify = 0
static

Definition at line 49 of file header.c.

Referenced by HeaderTestWndProc(), and notifies_received().

◆ nUnexpectedNotify

INT nUnexpectedNotify = 0
static

Definition at line 51 of file header.c.

Referenced by dont_expect_notify(), HeaderTestWndProc(), and notifies_received().

◆ orderArray_seq

const struct message orderArray_seq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 126 of file header.c.

Referenced by test_hdm_index_messages().

◆ orderToIndex_seq

const struct message orderToIndex_seq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 150 of file header.c.

Referenced by test_hdm_ordertoindex().

◆ pszFirstItem

char pszFirstItem[] = "First Item"
static

Definition at line 380 of file header.c.

◆ pszFourthItem

char pszFourthItem[] = "Fourth Item"
static

Definition at line 383 of file header.c.

◆ pszOutOfRangeItem

char pszOutOfRangeItem[] = "Out Of Range Item"
static

Definition at line 385 of file header.c.

◆ pszReplaceItem

char pszReplaceItem[] = "Replace Item"
static

Definition at line 384 of file header.c.

◆ pszSecondItem

char pszSecondItem[] = "Second Item"
static

Definition at line 381 of file header.c.

◆ pszThirdItem

char pszThirdItem[] = "Third Item"
static

Definition at line 382 of file header.c.

◆ pszUniTestA

char pszUniTestA[] = "TST"
static

Definition at line 390 of file header.c.

Referenced by test_header_control().

◆ pszUniTestW

WCHAR pszUniTestW[] = {'T','S','T',0}
static

Definition at line 391 of file header.c.

Referenced by test_header_control().

◆ sequences

◆ setHotDivider_seq_interactive

const struct message setHotDivider_seq_interactive[]
static

◆ setHotDivider_seq_noninteractive

const struct message setHotDivider_seq_noninteractive[]
static
Initial value:

Definition at line 174 of file header.c.

Referenced by test_hdm_sethotdivider().

◆ setItem_seq

const struct message setItem_seq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 132 of file header.c.

Referenced by test_hdm_index_messages().

◆ str_items

char* str_items[]
static
Initial value:
=
static char pszFourthItem[]
Definition: header.c:383
static char pszThirdItem[]
Definition: header.c:382
static char pszReplaceItem[]
Definition: header.c:384
static char pszFirstItem[]
Definition: header.c:380
static char pszOutOfRangeItem[]
Definition: header.c:385
static char pszSecondItem[]
Definition: header.c:381

Definition at line 387 of file header.c.

Referenced by test_header_control().

◆ UINT

Definition at line 29 of file header.c.

◆ unexpectedNotify

INT unexpectedNotify[10]
static

Definition at line 50 of file header.c.

Referenced by dont_expect_notify(), and HeaderTestWndProc().

◆ unicodeformatMessages_seq

const struct message unicodeformatMessages_seq[]
static
Initial value:

Definition at line 207 of file header.c.

Referenced by test_hdm_unicodeformatMessages().