ReactOS 0.4.16-dev-188-g678aa63
pager.c File Reference
#include <windows.h>
#include <commctrl.h>
#include "wine/test.h"
#include "msg.h"
Include dependency graph for pager.c:

Go to the source code of this file.

Classes

struct  notify_test_info
 
struct  notify_test_send
 
struct  notify_test_receive
 
struct  generic_text_helper_para
 
struct  notify_test_tooltip
 
struct  notify_test_datetime_format
 

Macros

#define NUM_MSG_SEQUENCES   1
 
#define PAGER_SEQ_INDEX   0
 
#define CHILD1_ID   1
 
#define CHILD2_ID   2
 
#define X(f)   p##f = (void*)GetProcAddress(mod, #f);
 

Enumerations

enum  test_conversion_flags {
  CONVERT_SEND = 0x01 , DONT_CONVERT_SEND = 0x02 , CONVERT_RECEIVE = 0x04 , DONT_CONVERT_RECEIVE = 0x08 ,
  SEND_EMPTY_IF_NULL = 0x10 , DONT_SEND_EMPTY_IF_NULL = 0x20 , SET_NULL_IF_NO_MASK = 0x40 , ZERO_SEND = 0x80
}
 
enum  handler_ids { TVITEM_NEW_HANDLER , TVITEM_OLD_HANDLER }
 

Functions

static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX *)
 
static CHARheap_strdup (const CHAR *str)
 
static LRESULT WINAPI parent_wnd_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL register_parent_wnd_class (void)
 
static HWND create_parent_window (void)
 
static LRESULT WINAPI pager_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static HWND create_pager_control (DWORD style)
 
static LRESULT WINAPI child_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL register_child_wnd_class (void)
 
static void test_pager (void)
 
static LRESULT WINAPI test_notifyformat_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL register_notifyformat_class (void)
 
static void test_wm_notifyformat (void)
 
static void notify_generic_text_handler (CHAR **text, INT *text_max)
 
static void notify_tooltip_handler (NMTTDISPINFOA *nm)
 
static void notify_datetime_handler (NMDATETIMEFORMATA *nm)
 
static LRESULT WINAPI test_notify_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL register_test_notify_class (void)
 
static void send_notify (HWND pager, UINT unicode, UINT ansi, LPARAM lParam, BOOL code_change)
 
static void test_notify_generic_text_helper (HWND pager, const struct generic_text_helper_para *para)
 
static void test_wm_notify_comboboxex (HWND pager)
 
static void test_wm_notify_datetime (HWND pager)
 
static void test_wm_notify_header (HWND pager)
 
static void test_wm_notify_tooltip (HWND pager)
 
static void test_wm_notify (void)
 
static void init_functions (void)
 
 START_TEST (pager)
 

Variables

static HWND parent_wnd
 
static HWND child1_wnd
 
static HWND child2_wnd
 
static INT notify_format
 
static BOOL notify_query_received
 
static const CHAR test_a [] = "test"
 
static const WCHAR test_w [] = L"test"
 
static const CHAR te_a [] = {'t', 'e', 0, 0}
 
static const CHAR large_a []
 
static const WCHAR large_w []
 
static const WCHAR large_truncated_65_w [65]
 
static const WCHAR large_truncated_80_w [80]
 
static WCHAR buffer [64]
 
static struct notify_test_info notify_test_info
 
static const struct notify_test_send test_convert_send_data []
 
static const struct notify_test_send test_dont_convert_send_data []
 
static const struct notify_test_receive test_convert_receive_data []
 
static const struct notify_test_receive test_dont_convert_receive_data []
 
static const struct notify_test_tooltip test_tooltip_data []
 
static const struct notify_test_datetime_format test_datetime_format_data []
 
static SUBCLASSPROC
 
static UINT_PTR
 
static DWORD_PTR
 
static struct msg_sequencesequences [NUM_MSG_SEQUENCES]
 
static const struct message set_child_seq []
 
static const struct message switch_child_seq []
 
static const struct message set_pos_seq []
 
static const struct message set_pos_empty_seq []
 

Macro Definition Documentation

◆ CHILD1_ID

#define CHILD1_ID   1

Definition at line 201 of file pager.c.

◆ CHILD2_ID

#define CHILD2_ID   2

Definition at line 202 of file pager.c.

◆ NUM_MSG_SEQUENCES

#define NUM_MSG_SEQUENCES   1

Definition at line 27 of file pager.c.

◆ PAGER_SEQ_INDEX

#define PAGER_SEQ_INDEX   0

Definition at line 28 of file pager.c.

◆ X

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

Enumeration Type Documentation

◆ handler_ids

Enumerator
TVITEM_NEW_HANDLER 
TVITEM_OLD_HANDLER 

Definition at line 60 of file pager.c.

61{
64};
@ TVITEM_NEW_HANDLER
Definition: pager.c:62
@ TVITEM_OLD_HANDLER
Definition: pager.c:63

◆ test_conversion_flags

Enumerator
CONVERT_SEND 
DONT_CONVERT_SEND 
CONVERT_RECEIVE 
DONT_CONVERT_RECEIVE 
SEND_EMPTY_IF_NULL 
DONT_SEND_EMPTY_IF_NULL 
SET_NULL_IF_NO_MASK 
ZERO_SEND 

Definition at line 48 of file pager.c.

49{
50 CONVERT_SEND = 0x01,
51 DONT_CONVERT_SEND = 0x02,
52 CONVERT_RECEIVE = 0x04,
54 SEND_EMPTY_IF_NULL = 0x10,
57 ZERO_SEND = 0x80
58};
@ CONVERT_RECEIVE
Definition: pager.c:102
@ ZERO_SEND
Definition: pager.c:108
@ SEND_EMPTY_IF_NULL
Definition: pager.c:104
@ SET_NULL_IF_NO_MASK
Definition: pager.c:106
@ CONVERT_SEND
Definition: pager.c:100
@ DONT_SEND_EMPTY_IF_NULL
Definition: pager.c:55
@ DONT_CONVERT_RECEIVE
Definition: pager.c:53
@ DONT_CONVERT_SEND
Definition: pager.c:51

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pInitCommonControlsEx) const
static

◆ child_proc()

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

Definition at line 386 of file pager.c.

387{
388 static LONG defwndproc_counter;
389 struct message msg = { 0 };
390 LRESULT ret;
391
392 msg.message = message;
393 msg.flags = sent | wparam | lparam;
394 if (defwndproc_counter)
395 msg.flags |= defwinproc;
396 msg.wParam = wParam;
397 msg.lParam = lParam;
398
399 if (hwnd == child1_wnd)
400 msg.id = CHILD1_ID;
401 else if (hwnd == child2_wnd)
402 msg.id = CHILD2_ID;
403 else
404 msg.id = 0;
405
407
408 defwndproc_counter++;
410 defwndproc_counter--;
411
412 return ret;
413}
@ sent
Definition: SystemMenu.c:27
@ defwinproc
Definition: SystemMenu.c:32
@ lparam
Definition: SystemMenu.c:31
@ 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 CHILD1_ID
Definition: pager.c:201
static HWND child2_wnd
Definition: pager.c:30
#define PAGER_SEQ_INDEX
Definition: pager.c:28
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: pager.c:207
static HWND child1_wnd
Definition: pager.c:30
#define CHILD2_ID
Definition: pager.c:202
long LONG
Definition: pedump.c:60
Definition: tftpd.h:60
UINT message
Definition: SystemMenu.c:42
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LRESULT
Definition: windef.h:209
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by register_child_wnd_class().

◆ create_pager_control()

static HWND create_pager_control ( DWORD  style)
static

Definition at line 372 of file pager.c.

373{
374 WNDPROC oldproc;
375 HWND hwnd;
376 RECT rect;
377
380 0, 0, 100, 100, parent_wnd, 0, GetModuleHandleA(0), 0 );
383 return hwnd;
384}
Arabic default style
Definition: afstyles.h:94
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
static LRESULT WINAPI pager_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:359
static HWND parent_wnd
Definition: pager.c:30
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_CHILD
Definition: pedump.c:617
#define WS_BORDER
Definition: pedump.c:625
#define WS_VISIBLE
Definition: pedump.c:620
#define WC_PAGESCROLLERA
Definition: commctrl.h:4503
& rect
Definition: startmenu.cpp:1413
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
#define SetWindowLongPtrA
Definition: winuser.h:5357
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4318
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909

Referenced by test_pager().

◆ create_parent_window()

static HWND create_parent_window ( void  )
static

Definition at line 349 of file pager.c.

350{
352 return NULL;
353
354 return CreateWindowA("Pager test parent class", "Pager test parent window",
356 0, 0, 200, 200, 0, NULL, GetModuleHandleA(NULL), NULL );
357}
#define NULL
Definition: types.h:112
static BOOL register_parent_wnd_class(void)
Definition: pager.c:332
#define WS_OVERLAPPED
Definition: pedump.c:615

◆ heap_strdup()

static CHAR * heap_strdup ( const CHAR str)
static

Definition at line 270 of file pager.c.

271{
272 int len = lstrlenA(str) + 1;
273 CHAR *ret = heap_alloc(len * sizeof(CHAR));
274 lstrcpyA(ret, str);
275 return ret;
276}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
GLenum GLsizei len
Definition: glext.h:6722
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
const WCHAR * str
char CHAR
Definition: xmlstorage.h:175

Referenced by notify_generic_text_handler().

◆ init_functions()

static void init_functions ( void  )
static

Definition at line 1298 of file pager.c.

1299{
1300 HMODULE mod = LoadLibraryA("comctl32.dll");
1301
1302#define X(f) p##f = (void*)GetProcAddress(mod, #f);
1304#undef X
1305
1306 pSetWindowSubclass = (void*)GetProcAddress(mod, (LPSTR)410);
1307}
std::map< E_MODULE, HMODULE > mod
Definition: LocaleTests.cpp:66
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
#define GetProcAddress(x, y)
Definition: compat.h:753
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define X(f)
char * LPSTR
Definition: xmlstorage.h:182

◆ notify_datetime_handler()

static void notify_datetime_handler ( NMDATETIMEFORMATA nm)
static

Definition at line 674 of file pager.c.

675{
677 if (data->expect_pszformat)
678 ok(!lstrcmpA(data->expect_pszformat, nm->pszFormat), "Sub test %d expect %s, got %s\n",
679 notify_test_info.sub_test_id, data->expect_pszformat, nm->pszFormat);
680 ok(nm->pszDisplay == nm->szDisplay, "Test %d expect %p, got %p\n", notify_test_info.sub_test_id, nm->szDisplay,
681 nm->pszDisplay);
682 if (data->write_szdisplay) memcpy(nm->szDisplay, data->write_szdisplay, data->write_szdisplay_size);
683 if (data->write_pszdisplay) nm->pszDisplay = data->write_pszdisplay;
684}
#define ok(value,...)
Definition: atltest.h:57
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const struct notify_test_datetime_format test_datetime_format_data[]
UINT sub_test_id
Definition: pager.c:75

Referenced by test_notify_proc().

◆ notify_generic_text_handler()

static void notify_generic_text_handler ( CHAR **  text,
INT text_max 
)
static

Definition at line 599 of file pager.c.

600{
601 const struct notify_test_send *send_data;
602 const struct notify_test_receive *receive_data;
603
605 {
606 case CONVERT_SEND:
608 {
612 ok(!*text[0], "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
615 ok(!lstrcmpA(send_data->expect_text, *text), "Code 0x%08x test 0x%08x sub test %d expect %s, got %s\n",
617 (CHAR *)send_data->expect_text, *text);
618 else
619 ok(!lstrcmpW((WCHAR *)send_data->expect_text, (WCHAR *)*text),
620 "Code 0x%08x test 0x%08x sub test %d expect %s, got %s\n", notify_test_info.unicode,
623 if (text_max)
624 ok(*text_max == send_data->send_text_max, "Code 0x%08x test 0x%08x sub test %d expect %d, got %d\n",
626 send_data->send_text_max, *text_max);
627 break;
628 }
629 case CONVERT_RECEIVE:
631 {
634 if (text_max)
635 ok(*text_max == receive_data->send_text_max, "Code 0x%08x test 0x%08x sub test %d expect %d, got %d\n",
637 receive_data->send_text_max, *text_max);
638
639 if (receive_data->write_text)
640 memcpy(*text, receive_data->write_text, receive_data->write_text_size);
641 /* 64bit Windows will try to free the text pointer even if it's application provided when handling
642 * HDN_GETDISPINFOW. Deliberate leak here. */
644 *text = heap_strdup(receive_data->write_pointer);
645 else
646 *text = (char *)receive_data->write_pointer;
647 if (text_max && receive_data->write_text_max != -1) *text_max = receive_data->write_text_max;
648 break;
649 }
651 ok(!*text[0], "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
653 break;
655 ok(!*text, "Code 0x%08x test 0x%08x sub test %d expect null text\n", notify_test_info.unicode,
657 break;
658 }
659}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
const WCHAR * text
Definition: package.c:1794
#define wine_dbgstr_w
Definition: kernel32.h:34
if(dx< 0)
Definition: linetemp.h:194
static const struct notify_test_send test_convert_send_data[]
Definition: pager.c:121
static const struct notify_test_receive test_convert_receive_data[]
Definition: pager.c:131
static const struct notify_test_receive test_dont_convert_receive_data[]
Definition: pager.c:140
static const struct notify_test_send test_dont_convert_send_data[]
Definition: pager.c:126
static CHAR * heap_strdup(const CHAR *str)
Definition: pager.c:270
#define HDN_GETDISPINFOW
Definition: commctrl.h:854
static int receive_data(SOCKET sock, SecBuffer *buf)
Definition: schannel.c:604
DWORD flags
Definition: pager.c:78
UINT test_id
Definition: pager.c:74
UINT unicode
Definition: pager.c:68
const void * expect_text
Definition: pager.c:88
INT send_text_max
Definition: pager.c:86
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_notify_proc().

◆ notify_tooltip_handler()

static void notify_tooltip_handler ( NMTTDISPINFOA nm)
static

Definition at line 661 of file pager.c.

662{
664 ok(nm->lpszText == nm->szText, "Sub test %d expect %p, got %p\n", notify_test_info.sub_test_id, nm->szText,
665 nm->lpszText);
666 if (data->expect_sztext)
667 ok(!lstrcmpA(data->expect_sztext, nm->szText), "Sub test %d expect %s, got %s\n", notify_test_info.sub_test_id,
668 data->expect_sztext, nm->szText);
669 if (data->write_sztext) memcpy(nm->szText, data->write_sztext, data->write_sztext_size);
670 if (data->write_lpsztext) nm->lpszText = (char *)data->write_lpsztext;
671 if (data->write_hinst) nm->hinst = data->write_hinst;
672}
static const struct notify_test_tooltip test_tooltip_data[]
char szText[80]
Definition: commctrl.h:1903
HINSTANCE hinst
Definition: commctrl.h:1904

Referenced by test_notify_proc().

◆ pager_subclass_proc()

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

Definition at line 359 of file pager.c.

360{
362 struct message msg = { 0 };
363
364 msg.message = message;
365 msg.flags = sent|wparam|lparam;
366 msg.wParam = wParam;
367 msg.lParam = lParam;
369 return CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
370}
#define GetWindowLongPtrA
Definition: winuser.h:4831
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by create_pager_control().

◆ parent_wnd_proc()

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

Definition at line 278 of file pager.c.

279{
280 static LONG defwndproc_counter = 0;
281 LRESULT ret;
282 struct message msg;
283
284 /* log system messages, except for painting */
285 if (message < WM_USER &&
286 message != WM_PAINT &&
288 message != WM_NCPAINT &&
290 message != WM_GETTEXT &&
291 message != WM_GETICON &&
293 {
294 msg.message = message;
295 msg.flags = sent|wparam|lparam|parent;
296 if (defwndproc_counter) msg.flags |= defwinproc;
297 msg.wParam = wParam;
298 msg.lParam = lParam;
299 if (message == WM_NOTIFY && lParam) msg.id = ((NMHDR*)lParam)->code;
301 }
302
303 if (message == WM_NOTIFY)
304 {
305 NMHDR *nmhdr = (NMHDR *)lParam;
306
307 switch (nmhdr->code)
308 {
309 case PGN_CALCSIZE:
310 {
311 NMPGCALCSIZE *nmpgcs = (NMPGCALCSIZE *)lParam;
313
314 if (style & PGS_HORZ)
315 ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
316 else
317 ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
318 break;
319 }
320 default:
321 ;
322 }
323 }
324
325 defwndproc_counter++;
327 defwndproc_counter--;
328
329 return ret;
330}
r parent
Definition: btrfs.c:3010
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PGN_CALCSIZE
Definition: commctrl.h:4585
#define PGF_CALCWIDTH
Definition: commctrl.h:4587
#define PGF_CALCHEIGHT
Definition: commctrl.h:4588
#define PGS_HORZ
Definition: commctrl.h:4508
#define WM_NOTIFY
Definition: richedit.h:61
DWORD dwFlag
Definition: commctrl.h:4592
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
#define WM_PAINT
Definition: winuser.h:1623
#define WM_ERASEBKGND
Definition: winuser.h:1628
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_NCHITTEST
Definition: winuser.h:1689
#define WM_GETTEXT
Definition: winuser.h:1621
#define WM_DEVICECHANGE
Definition: winuser.h:1814
#define WM_USER
Definition: winuser.h:1898
#define GWL_STYLE
Definition: winuser.h:855
#define WM_NCPAINT
Definition: winuser.h:1690

Referenced by register_parent_wnd_class().

◆ register_child_wnd_class()

static BOOL register_child_wnd_class ( void  )
static

Definition at line 415 of file pager.c.

416{
417 WNDCLASSA cls;
418
419 cls.style = 0;
421 cls.cbClsExtra = 0;
422 cls.cbWndExtra = 0;
424 cls.hIcon = 0;
427 cls.lpszMenuName = NULL;
428 cls.lpszClassName = "Pager test child class";
429 return RegisterClassA(&cls);
430}
static LRESULT WINAPI child_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:386
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
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
#define IDC_ARROW
Definition: winuser.h:687
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2142
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by test_pager().

◆ register_notifyformat_class()

static BOOL register_notifyformat_class ( void  )
static

Definition at line 530 of file pager.c.

531{
532 static const WCHAR class_w[] = {'P', 'a', 'g', 'e', 'r', ' ', 'n', 'o', 't', 'i', 'f', 'y', 'f',
533 'o', 'r', 'm', 'a', 't', ' ', 'c', 'l', 'a', 's', 's', 0};
534 WNDCLASSW cls = {0};
535
538 cls.lpszClassName = class_w;
539 return RegisterClassW(&cls);
540}
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
static LRESULT WINAPI test_notifyformat_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:510
LPCWSTR lpszClassName
Definition: winuser.h:3188
HINSTANCE hInstance
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3180
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)

Referenced by test_wm_notifyformat().

◆ register_parent_wnd_class()

static BOOL register_parent_wnd_class ( void  )
static

Definition at line 332 of file pager.c.

333{
334 WNDCLASSA cls;
335
336 cls.style = 0;
338 cls.cbClsExtra = 0;
339 cls.cbWndExtra = 0;
341 cls.hIcon = 0;
344 cls.lpszMenuName = NULL;
345 cls.lpszClassName = "Pager test parent class";
346 return RegisterClassA(&cls);
347}
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:278

Referenced by create_parent_window().

◆ register_test_notify_class()

static BOOL register_test_notify_class ( void  )
static

Definition at line 908 of file pager.c.

909{
910 WNDCLASSA cls = {0};
911
914 cls.lpszClassName = "Pager notify class";
915 return RegisterClassA(&cls);
916}
static LRESULT WINAPI test_notify_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:686

◆ send_notify()

static void send_notify ( HWND  pager,
UINT  unicode,
UINT  ansi,
LPARAM  lParam,
BOOL  code_change 
)
static

Definition at line 918 of file pager.c.

919{
920 NMHDR *hdr = (NMHDR *)lParam;
921
922 notify_test_info.unicode = unicode;
925 notify_test_info.ansi = ansi;
927
928 hdr->code = unicode;
929 hdr->idFrom = 1;
930 hdr->hwndFrom = child1_wnd;
931
932 SendMessageW(pager, WM_NOTIFY, hdr->idFrom, lParam);
933 ok(notify_test_info.received, "Expect notification received\n");
934 ok(hdr->code == code_change ? ansi : unicode, "Expect 0x%08x, got 0x%08x\n", hdr->code,
935 code_change ? ansi : unicode);
936}
#define FALSE
Definition: types.h:117
char hdr[14]
Definition: iptest.cpp:33
HWND hwnd_from
Definition: pager.c:71
BOOL received
Definition: pager.c:73
UINT_PTR id_from
Definition: pager.c:70
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by LISTBOX_SetSelection(), test_notify_generic_text_helper(), test_wm_notify_comboboxex(), test_wm_notify_datetime(), test_wm_notify_header(), and test_wm_notify_tooltip().

◆ START_TEST()

START_TEST ( pager  )

Definition at line 1309 of file pager.c.

1310{
1312
1314
1315 iccex.dwSize = sizeof(iccex);
1317 pInitCommonControlsEx(&iccex);
1318
1320
1322 ok(parent_wnd != NULL, "Failed to create parent window!\n");
1323
1324 test_pager();
1327
1329}
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:393
static HWND create_parent_window(void)
Definition: pager.c:349
#define NUM_MSG_SEQUENCES
Definition: pager.c:27
static void test_wm_notifyformat(void)
Definition: pager.c:542
static void test_wm_notify(void)
Definition: pager.c:1156
static void test_pager(void)
Definition: pager.c:432
static void init_functions(void)
Definition: pager.c:1298
#define ICC_PAGESCROLLER_CLASS
Definition: commctrl.h:71
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ test_notify_generic_text_helper()

static void test_notify_generic_text_helper ( HWND  pager,
const struct generic_text_helper_para para 
)
static

Definition at line 939 of file pager.c.

940{
941 const struct notify_test_send *send_data;
942 const struct notify_test_receive *receive_data;
944 INT i;
945
948
949 if (para->flags & (CONVERT_SEND | DONT_CONVERT_SEND))
950 {
951 if (para->flags & CONVERT_SEND)
952 {
954 send_data = test_convert_send_data;
956 }
957 else
958 {
960 send_data = test_dont_convert_send_data;
962 }
963
964 for (i = 0; i < array_size; i++)
965 {
966 const struct notify_test_send *data = send_data + i;
968
969 memset(para->ptr, 0, para->size);
970 if (para->mask) *para->mask = para->required_mask;
971 if (data->send_text)
972 {
973 memcpy(buffer, data->send_text, data->send_text_size);
974 *para->text = buffer;
975 }
976 if (para->text_max) *para->text_max = data->send_text_max;
977 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
978 }
979 }
980
982 {
983 if (para->flags & CONVERT_RECEIVE)
984 {
988 }
989 else
990 {
994 }
995
996 for (i = 0; i < array_size; i++)
997 {
998 const struct notify_test_receive *data = receive_data + i;
1000
1001 memset(para->ptr, 0, para->size);
1002 if (para->mask) *para->mask = para->required_mask;
1003 if (data->send_text)
1004 {
1005 memcpy(buffer, data->send_text, data->send_text_size);
1006 *para->text = buffer;
1007 }
1008 if (para->text_max) *para->text_max = data->send_text_max;
1009 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
1010 if (data->return_text)
1011 {
1012 if (para->flags & CONVERT_RECEIVE)
1013 ok(!wcsncmp(data->return_text, *para->text, *para->text_max),
1014 "Code 0x%08x sub test %d expect %s, got %s\n", para->code_unicode, i,
1015 wine_dbgstr_w((WCHAR *)data->return_text), wine_dbgstr_w(*para->text));
1016 else
1017 ok(!lstrcmpA(data->return_text, (CHAR *)*para->text), "Code 0x%08x sub test %d expect %s, got %s\n",
1018 para->code_unicode, i, (CHAR *)data->return_text, (CHAR *)*para->text);
1019 }
1020 if (para->text_max)
1021 ok(data->return_text_max == *para->text_max, "Code 0x%08x sub test %d expect %d, got %d\n",
1022 para->code_unicode, i, data->return_text_max, *para->text_max);
1023 }
1024 }
1025
1026 /* Extra tests for other behavior flags that are not worth it to create their own test arrays */
1027 memset(para->ptr, 0, para->size);
1028 if (para->mask) *para->mask = para->required_mask;
1029 if (para->text_max) *para->text_max = 1;
1030 if (para->flags & SEND_EMPTY_IF_NULL)
1032 else
1034 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
1035
1037 memset(para->ptr, 0, para->size);
1038 memset(buffer, 0, sizeof(buffer));
1039 *para->text = buffer;
1040 if (para->text_max) *para->text_max = ARRAY_SIZE(buffer);
1041 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
1042 if(para->flags & SET_NULL_IF_NO_MASK)
1043 ok(!*para->text, "Expect null text\n");
1044}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define TRUE
Definition: types.h:120
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
static WCHAR buffer[64]
Definition: pager.c:45
static void send_notify(HWND pager, UINT unicode, UINT ansi, LPARAM lParam, BOOL code_change)
Definition: pager.c:918
static UINT array_size
Definition: msctf.c:67
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define memset(x, y, z)
Definition: compat.h:39
UINT handler_id
Definition: pager.c:76
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208

◆ test_notify_proc()

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

Definition at line 686 of file pager.c.

687{
688 static const WCHAR test[] = {'t', 'e', 's', 't', 0};
689 switch (message)
690 {
691 case WM_NOTIFY:
692 {
693 NMHDR *hdr = (NMHDR *)lParam;
694
695 /* Not notifications we want to test */
696 if (!notify_test_info.unicode) break;
697 ok(!notify_test_info.received, "Extra notification received\n");
698
699 ok(wParam == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
700 ok(hdr->code == notify_test_info.ansi, "Expect 0x%08x, got 0x%08x\n", notify_test_info.ansi, hdr->code);
701 ok(hdr->idFrom == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
702 ok(hdr->hwndFrom == notify_test_info.hwnd_from, "Expect %p, got %p\n", notify_test_info.hwnd_from, hdr->hwndFrom);
703
704 if (hdr->code != notify_test_info.ansi)
705 {
706 skip("Notification code mismatch, skipping lParam check\n");
707 return 0;
708 }
709 switch (hdr->code)
710 {
711 /* ComboBoxEx */
712 case CBEN_INSERTITEM:
713 case CBEN_DELETEITEM:
714 {
715 NMCOMBOBOXEXW *nmcbe = (NMCOMBOBOXEXW *)hdr;
717 break;
718 }
719 case CBEN_DRAGBEGINA:
720 {
721 NMCBEDRAGBEGINA *nmcbedb = (NMCBEDRAGBEGINA *)hdr;
722 ok(!lstrcmpA(nmcbedb->szText, test_a), "Expect %s, got %s\n", nmcbedb->szText, test_a);
723 break;
724 }
725 case CBEN_ENDEDITA:
726 {
727 NMCBEENDEDITA *nmcbeed = (NMCBEENDEDITA *)hdr;
728 ok(!lstrcmpA(nmcbeed->szText, test_a), "Expect %s, got %s\n", nmcbeed->szText, test_a);
729 break;
730 }
732 {
733 NMCOMBOBOXEXA *nmcbe = (NMCOMBOBOXEXA *)hdr;
735 break;
736 }
737 /* Date and Time Picker */
738 case DTN_FORMATA:
739 {
741 break;
742 }
743 case DTN_FORMATQUERYA:
744 {
747 break;
748 }
749 case DTN_WMKEYDOWNA:
750 {
753 break;
754 }
755 case DTN_USERSTRINGA:
756 {
759 break;
760 }
761 /* Header */
762 case HDN_BEGINDRAG:
763 case HDN_ENDDRAG:
766 case HDN_DROPDOWN:
767 case HDN_FILTERCHANGE:
768 case HDN_ITEMKEYDOWN:
771 {
772 NMHEADERW *nmhd = (NMHEADERW *)hdr;
773 ok(!lstrcmpW(nmhd->pitem->pszText, test_w), "Expect %s, got %s\n", wine_dbgstr_w(test_w),
774 wine_dbgstr_w(nmhd->pitem->pszText));
775 ok(!lstrcmpW(((HD_TEXTFILTERW *)nmhd->pitem->pvFilter)->pszText, test_w), "Expect %s, got %s\n",
777 break;
778 }
779 case HDN_BEGINTRACKA:
781 case HDN_ENDTRACKA:
782 case HDN_ITEMCHANGEDA:
784 case HDN_ITEMCLICKA:
786 case HDN_TRACKA:
787 {
788 NMHEADERA *nmhd = (NMHEADERA *)hdr;
789 ok(!lstrcmpA(nmhd->pitem->pszText, test_a), "Expect %s, got %s\n", test_a, nmhd->pitem->pszText);
790 ok(!lstrcmpA(((HD_TEXTFILTERA *)nmhd->pitem->pvFilter)->pszText, test_a), "Expect %s, got %s\n", test_a,
791 ((HD_TEXTFILTERA *)nmhd->pitem->pvFilter)->pszText);
792 break;
793 }
794 case HDN_GETDISPINFOA:
795 {
796 NMHDDISPINFOA *nmhddi = (NMHDDISPINFOA *)hdr;
798 break;
799 }
800 /* List View */
803 case LVN_GETDISPINFOA:
804 case LVN_SETDISPINFOA:
805 {
806 NMLVDISPINFOA *nmlvdi = (NMLVDISPINFOA *)hdr;
808 break;
809 }
810 case LVN_GETINFOTIPA:
811 {
812 NMLVGETINFOTIPA *nmlvgit = (NMLVGETINFOTIPA *)hdr;
813 notify_generic_text_handler(&nmlvgit->pszText, &nmlvgit->cchTextMax);
814 break;
815 }
817 case LVN_ODFINDITEMA:
818 {
819 NMLVFINDITEMA *nmlvfi = (NMLVFINDITEMA *)hdr;
821 break;
822 }
823 /* Toolbar */
824 case TBN_SAVE:
825 {
826 NMTBSAVE *nmtbs = (NMTBSAVE *)hdr;
828 break;
829 }
830 case TBN_RESTORE:
831 {
832 NMTBRESTORE *nmtbr = (NMTBRESTORE *)hdr;
834 break;
835 }
837 {
838 NMTOOLBARA *nmtb = (NMTOOLBARA *)hdr;
840 break;
841 }
842 case TBN_GETDISPINFOW:
843 {
844 NMTBDISPINFOW *nmtbdi = (NMTBDISPINFOW *)hdr;
845 notify_generic_text_handler((CHAR **)&nmtbdi->pszText, &nmtbdi->cchText);
846 break;
847 }
848 case TBN_GETINFOTIPA:
849 {
850 NMTBGETINFOTIPA *nmtbgit = (NMTBGETINFOTIPA *)hdr;
851 notify_generic_text_handler(&nmtbgit->pszText, &nmtbgit->cchTextMax);
852 break;
853 }
854 /* Tooltip */
855 case TTN_GETDISPINFOA:
856 {
858 break;
859 }
860 /* Tree View */
863 case TVN_GETDISPINFOA:
864 case TVN_SETDISPINFOA:
865 {
866 NMTVDISPINFOA *nmtvdi = (NMTVDISPINFOA *)hdr;
868 break;
869 }
870 case TVN_GETINFOTIPA:
871 {
872 NMTVGETINFOTIPA *nmtvgit = (NMTVGETINFOTIPA *)hdr;
873 notify_generic_text_handler(&nmtvgit->pszText, &nmtvgit->cchTextMax);
874 break;
875 }
876 case TVN_SINGLEEXPAND:
877 case TVN_BEGINDRAGA:
878 case TVN_BEGINRDRAGA:
881 case TVN_DELETEITEMA:
882 case TVN_SELCHANGINGA:
883 case TVN_SELCHANGEDA:
884 {
885 NMTREEVIEWA *nmtv = (NMTREEVIEWA *)hdr;
888 else
890 break;
891 }
892
893 default:
894 ok(0, "Unexpected message 0x%08x\n", hdr->code);
895 }
897 ok(!lstrcmpA(test_a, "test"), "test_a got modified\n");
898 ok(!lstrcmpW(test_w, test), "test_w got modified\n");
899 return 0;
900 }
901 case WM_NOTIFYFORMAT:
902 if (lParam == NF_QUERY) return NFR_ANSI;
903 break;
904 }
906}
#define skip(...)
Definition: atltest.h:64
static void notify_generic_text_handler(CHAR **text, INT *text_max)
Definition: pager.c:599
static void notify_tooltip_handler(NMTTDISPINFOA *nm)
Definition: pager.c:661
static const WCHAR test_w[]
Definition: pager.c:34
static void notify_datetime_handler(NMDATETIMEFORMATA *nm)
Definition: pager.c:674
static const CHAR test_a[]
Definition: pager.c:33
#define TVN_ENDLABELEDITA
Definition: commctrl.h:3716
#define TTN_GETDISPINFOA
Definition: commctrl.h:1877
#define LVN_GETDISPINFOA
Definition: commctrl.h:3158
#define HDN_ITEMDBLCLICKA
Definition: commctrl.h:843
#define HDN_DROPDOWN
Definition: commctrl.h:863
#define HDN_BEGINTRACKA
Definition: commctrl.h:847
#define TVN_ITEMEXPANDINGA
Definition: commctrl.h:3704
#define TVN_BEGINLABELEDITA
Definition: commctrl.h:3714
#define TBN_SAVE
Definition: commctrl.h:1345
#define LVN_GETINFOTIPA
Definition: commctrl.h:3227
#define HDN_ITEMKEYDOWN
Definition: commctrl.h:862
#define CBEN_DRAGBEGINA
Definition: commctrl.h:3885
#define DTN_USERSTRINGA
Definition: commctrl.h:4378
#define HDN_OVERFLOWCLICK
Definition: commctrl.h:864
#define TVN_BEGINRDRAGA
Definition: commctrl.h:3710
#define CBEN_ENDEDITA
Definition: commctrl.h:3880
#define HDN_BEGINDRAG
Definition: commctrl.h:855
#define TBN_GETDISPINFOW
Definition: commctrl.h:1340
#define HDN_ITEMSTATEICONCLICK
Definition: commctrl.h:861
#define TVN_ITEMEXPANDEDA
Definition: commctrl.h:3706
#define LVN_INCREMENTALSEARCHA
Definition: commctrl.h:3168
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:837
#define LVN_BEGINLABELEDITA
Definition: commctrl.h:3140
#define HDN_ITEMCLICKA
Definition: commctrl.h:841
#define CBEN_GETDISPINFOA
Definition: commctrl.h:3876
#define HDN_ENDTRACKA
Definition: commctrl.h:849
#define DTN_WMKEYDOWNA
Definition: commctrl.h:4398
#define TVN_SELCHANGINGA
Definition: commctrl.h:3650
#define HDN_ENDDRAG
Definition: commctrl.h:856
#define LVN_SETDISPINFOA
Definition: commctrl.h:3160
#define HDN_FILTERCHANGE
Definition: commctrl.h:857
#define LVN_ENDLABELEDITA
Definition: commctrl.h:3142
#define TVN_DELETEITEMA
Definition: commctrl.h:3712
#define TBN_GETBUTTONINFOA
Definition: commctrl.h:1306
#define HDN_GETDISPINFOA
Definition: commctrl.h:853
#define TBN_GETINFOTIPA
Definition: commctrl.h:1341
#define HDN_ENDFILTEREDIT
Definition: commctrl.h:860
#define CBEN_DELETEITEM
Definition: commctrl.h:3878
#define TVN_BEGINDRAGA
Definition: commctrl.h:3708
#define TVN_GETDISPINFOA
Definition: commctrl.h:3659
#define LVN_ODFINDITEMA
Definition: commctrl.h:3149
#define CBEN_INSERTITEM
Definition: commctrl.h:3877
#define DTN_FORMATQUERYA
Definition: commctrl.h:4440
#define DTN_FORMATA
Definition: commctrl.h:4418
#define HDN_TRACKA
Definition: commctrl.h:851
#define TVN_SELCHANGEDA
Definition: commctrl.h:3652
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:839
#define TVN_SETDISPINFOA
Definition: commctrl.h:3661
#define HDN_DIVIDERDBLCLICKA
Definition: commctrl.h:845
#define TBN_RESTORE
Definition: commctrl.h:1344
#define HDN_BEGINFILTEREDIT
Definition: commctrl.h:859
#define TVN_SINGLEEXPAND
Definition: commctrl.h:3721
#define TVN_GETINFOTIPA
Definition: commctrl.h:3719
#define test
Definition: rosglue.h:37
char szText[CBEMAXSTRLEN]
Definition: commctrl.h:3908
char szText[CBEMAXSTRLEN]
Definition: commctrl.h:3927
COMBOBOXEXITEMA ceItem
Definition: commctrl.h:3864
COMBOBOXEXITEMW ceItem
Definition: commctrl.h:3869
LPWSTR pszText
Definition: commctrl.h:1416
LPSTR pszText
Definition: commctrl.h:669
void * pvFilter
Definition: commctrl.h:677
LPWSTR pszText
Definition: commctrl.h:686
void * pvFilter
Definition: commctrl.h:694
INT_PTR iString
Definition: commctrl.h:959
LVITEMA item
Definition: commctrl.h:3179
int cchTextMax
Definition: commctrl.h:2354
LPSTR pszText
Definition: commctrl.h:2353
HDITEMA * pitem
Definition: commctrl.h:884
HDITEMW * pitem
Definition: commctrl.h:891
LVFINDINFOA lvfi
Definition: commctrl.h:3100
TBBUTTON tbButton
Definition: commctrl.h:1373
TBBUTTON tbButton
Definition: commctrl.h:1362
LPSTR pszText
Definition: commctrl.h:1443
TVITEMA itemOld
Definition: commctrl.h:3634
TVITEMA itemNew
Definition: commctrl.h:3635
TVITEMA item
Definition: commctrl.h:3672
LPSTR pszText
Definition: commctrl.h:3312
int cchTextMax
Definition: commctrl.h:3313
#define NFR_ANSI
Definition: winuser.h:2461
#define NF_QUERY
Definition: winuser.h:2463

Referenced by register_test_notify_class().

◆ test_notifyformat_proc()

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

Definition at line 510 of file pager.c.

511{
512 switch (message)
513 {
514 case WM_NOTIFYFORMAT:
515 if (lParam == NF_QUERY)
516 {
518 return notify_format;
519 }
520 else if (lParam == NF_REQUERY)
521 return SendMessageA(GetParent(hwnd), WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
522 else
523 return 0;
524 default:
527 }
528}
static BOOL notify_query_received
Definition: pager.c:32
static INT notify_format
Definition: pager.c:31
UINT_PTR WPARAM
Definition: windef.h:207
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NF_REQUERY
Definition: winuser.h:2464
HWND WINAPI GetParent(_In_ HWND)
#define NFR_UNICODE
Definition: winuser.h:2462

Referenced by register_notifyformat_class().

◆ test_pager()

static void test_pager ( void  )
static

Definition at line 432 of file pager.c.

433{
434 HWND pager;
435 RECT rect, rect2;
436
438 ok(pager != NULL, "Fail to create pager\n");
439
441
442 child1_wnd = CreateWindowA( "Pager test child class", "button", WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 300, 300,
443 pager, 0, GetModuleHandleA(0), 0 );
444 child2_wnd = CreateWindowA("Pager test child class", "button", WS_CHILD | WS_BORDER, 0, 0, 300, 300,
445 pager, 0, GetModuleHandleA(0), 0);
446
450 GetWindowRect( pager, &rect );
451 ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
452 "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
453
456 ok_sequence(sequences, PAGER_SEQ_INDEX, switch_child_seq, "switch to invisible child", FALSE);
457 GetWindowRect(pager, &rect);
458 ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
459 "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
460 ok(!IsWindowVisible(child2_wnd), "Child window 2 is visible\n");
461
464 ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "switch to visible child", FALSE);
465 GetWindowRect(pager, &rect);
466 ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
467 "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
468
470 SendMessageA( pager, PGM_SETPOS, 0, 10 );
472 GetWindowRect( pager, &rect );
473 ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
474 "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
475
477 SendMessageA( pager, PGM_SETPOS, 0, 10 );
479
481 SendMessageA( pager, PGM_SETPOS, 0, 9 );
483
484 DestroyWindow( pager );
485
486 /* Test if resizing works */
488 ok(pager != NULL, "failed to create pager control\n");
489
490 GetWindowRect( pager, &rect );
491 MoveWindow( pager, 0, 0, 200, 100, TRUE );
492 GetWindowRect( pager, &rect2 );
493 ok(rect2.right - rect2.left > rect.right - rect.left, "expected pager window to resize, %s\n",
495
496 DestroyWindow( pager );
497
499 ok(pager != NULL, "failed to create pager control\n");
500
501 GetWindowRect( pager, &rect );
502 MoveWindow( pager, 0, 0, 100, 200, TRUE );
503 GetWindowRect( pager, &rect2 );
504 ok(rect2.bottom - rect2.top > rect.bottom - rect.top, "expected pager window to resize, %s\n",
506
507 DestroyWindow( pager );
508}
#define ok_sequence(exp, contx, todo)
Definition: SystemMenu.c:275
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:99
RECT rect2
Definition: edittest.c:51
static const struct message set_child_seq[]
Definition: pager.c:209
static const struct message set_pos_seq[]
Definition: pager.c:241
static const struct message switch_child_seq[]
Definition: pager.c:227
static HWND create_pager_control(DWORD style)
Definition: pager.c:372
static BOOL register_child_wnd_class(void)
Definition: pager.c:415
static const struct message set_pos_empty_seq[]
Definition: pager.c:265
#define PGM_SETPOS
Definition: commctrl.h:4542
#define PGM_SETCHILD
Definition: commctrl.h:4521
#define CCS_NORESIZE
Definition: commctrl.h:2250
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

◆ test_wm_notify()

static void test_wm_notify ( void  )
static

Definition at line 1156 of file pager.c.

1157{
1158 static const CHAR *class = "Pager notify class";
1159 HWND parent, pager;
1160 /* Combo Box Ex */
1161 static NMCOMBOBOXEXW nmcbe;
1162 /* Date and Time Picker */
1163 static NMDATETIMEFORMATQUERYW nmdtfq;
1164 static NMDATETIMEWMKEYDOWNW nmdtkd;
1165 static NMDATETIMESTRINGW nmdts;
1166 /* Header */
1167 static NMHDDISPINFOW nmhddi;
1168 /* List View */
1169 static NMLVDISPINFOW nmlvdi;
1170 static NMLVGETINFOTIPW nmlvgit;
1171 static NMLVFINDITEMW nmlvfi;
1172 /* Tool Bar */
1173 static NMTBRESTORE nmtbr;
1174 static NMTBSAVE nmtbs;
1175 static NMTOOLBARW nmtb;
1176 static NMTBDISPINFOW nmtbdi;
1177 static NMTBGETINFOTIPW nmtbgit;
1178 /* Tree View */
1179 static NMTVDISPINFOW nmtvdi;
1180 static NMTVGETINFOTIPW nmtvgit;
1181 static NMTREEVIEWW nmtv;
1182 static const struct generic_text_helper_para paras[] =
1183 {
1184 /* Combo Box Ex */
1185 {&nmcbe, sizeof(nmcbe), &nmcbe.ceItem.mask, CBEIF_TEXT, &nmcbe.ceItem.pszText, &nmcbe.ceItem.cchTextMax,
1186 CBEN_INSERTITEM, CBEN_INSERTITEM, DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
1187 {&nmcbe, sizeof(nmcbe), &nmcbe.ceItem.mask, CBEIF_TEXT, &nmcbe.ceItem.pszText, &nmcbe.ceItem.cchTextMax,
1188 CBEN_DELETEITEM, CBEN_DELETEITEM, DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
1189 {&nmcbe, sizeof(nmcbe), &nmcbe.ceItem.mask, CBEIF_TEXT, &nmcbe.ceItem.pszText, &nmcbe.ceItem.cchTextMax,
1190 CBEN_GETDISPINFOW, CBEN_GETDISPINFOA, ZERO_SEND | SET_NULL_IF_NO_MASK | DONT_CONVERT_SEND | CONVERT_RECEIVE},
1191 /* Date and Time Picker */
1192 {&nmdtfq, sizeof(nmdtfq), NULL, 0, (WCHAR **)&nmdtfq.pszFormat, NULL, DTN_FORMATQUERYW, DTN_FORMATQUERYA,
1193 CONVERT_SEND},
1194 {&nmdtkd, sizeof(nmdtkd), NULL, 0, (WCHAR **)&nmdtkd.pszFormat, NULL, DTN_WMKEYDOWNW, DTN_WMKEYDOWNA,
1195 CONVERT_SEND},
1196 {&nmdts, sizeof(nmdts), NULL, 0, (WCHAR **)&nmdts.pszUserString, NULL, DTN_USERSTRINGW, DTN_USERSTRINGA,
1197 CONVERT_SEND},
1198 /* Header */
1199 {&nmhddi, sizeof(nmhddi), &nmhddi.mask, HDI_TEXT, &nmhddi.pszText, &nmhddi.cchTextMax, HDN_GETDISPINFOW,
1200 HDN_GETDISPINFOA, SEND_EMPTY_IF_NULL | CONVERT_SEND | CONVERT_RECEIVE},
1201 /* List View */
1202 {&nmlvfi, sizeof(nmlvfi), &nmlvfi.lvfi.flags, LVFI_STRING, (WCHAR **)&nmlvfi.lvfi.psz, NULL,
1203 LVN_INCREMENTALSEARCHW, LVN_INCREMENTALSEARCHA, CONVERT_SEND},
1204 {&nmlvfi, sizeof(nmlvfi), &nmlvfi.lvfi.flags, LVFI_SUBSTRING, (WCHAR **)&nmlvfi.lvfi.psz, NULL, LVN_ODFINDITEMW,
1205 LVN_ODFINDITEMA, CONVERT_SEND},
1206 {&nmlvdi, sizeof(nmlvdi), &nmlvdi.item.mask, LVIF_TEXT, &nmlvdi.item.pszText, &nmlvdi.item.cchTextMax,
1207 LVN_BEGINLABELEDITW, LVN_BEGINLABELEDITA, SET_NULL_IF_NO_MASK | CONVERT_SEND | CONVERT_RECEIVE},
1208 {&nmlvdi, sizeof(nmlvdi), &nmlvdi.item.mask, LVIF_TEXT, &nmlvdi.item.pszText, &nmlvdi.item.cchTextMax,
1209 LVN_ENDLABELEDITW, LVN_ENDLABELEDITA, SET_NULL_IF_NO_MASK | CONVERT_SEND | CONVERT_RECEIVE},
1210 {&nmlvdi, sizeof(nmlvdi), &nmlvdi.item.mask, LVIF_TEXT, &nmlvdi.item.pszText, &nmlvdi.item.cchTextMax,
1211 LVN_GETDISPINFOW, LVN_GETDISPINFOA, DONT_CONVERT_SEND | CONVERT_RECEIVE},
1212 {&nmlvdi, sizeof(nmlvdi), &nmlvdi.item.mask, LVIF_TEXT, &nmlvdi.item.pszText, &nmlvdi.item.cchTextMax,
1213 LVN_SETDISPINFOW, LVN_SETDISPINFOA, SET_NULL_IF_NO_MASK | CONVERT_SEND | CONVERT_RECEIVE},
1214 {&nmlvgit, sizeof(nmlvgit), NULL, 0, &nmlvgit.pszText, &nmlvgit.cchTextMax, LVN_GETINFOTIPW, LVN_GETINFOTIPA,
1215 CONVERT_SEND | CONVERT_RECEIVE},
1216 /* Tool Bar */
1217 {&nmtbs, sizeof(nmtbs), NULL, 0, (WCHAR **)&nmtbs.tbButton.iString, NULL, TBN_SAVE, TBN_SAVE,
1218 DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
1219 {&nmtbr, sizeof(nmtbr), NULL, 0, (WCHAR **)&nmtbr.tbButton.iString, NULL, TBN_RESTORE, TBN_RESTORE,
1220 DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
1221 {&nmtbdi, sizeof(nmtbdi), &nmtbdi.dwMask, TBNF_TEXT, &nmtbdi.pszText, &nmtbdi.cchText, TBN_GETDISPINFOW,
1222 TBN_GETDISPINFOW, DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
1223 {&nmtb, sizeof(nmtb), NULL, 0, &nmtb.pszText, &nmtb.cchText, TBN_GETBUTTONINFOW, TBN_GETBUTTONINFOA,
1224 SEND_EMPTY_IF_NULL | CONVERT_SEND | CONVERT_RECEIVE},
1225 {&nmtbgit, sizeof(nmtbgit), NULL, 0, &nmtbgit.pszText, &nmtbgit.cchTextMax, TBN_GETINFOTIPW, TBN_GETINFOTIPA,
1226 DONT_CONVERT_SEND | CONVERT_RECEIVE},
1227 /* Tree View */
1228 {&nmtvdi, sizeof(nmtvdi), &nmtvdi.item.mask, TVIF_TEXT, &nmtvdi.item.pszText, &nmtvdi.item.cchTextMax,
1229 TVN_BEGINLABELEDITW, TVN_BEGINLABELEDITA, SET_NULL_IF_NO_MASK | CONVERT_SEND | CONVERT_RECEIVE},
1230 {&nmtvdi, sizeof(nmtvdi), &nmtvdi.item.mask, TVIF_TEXT, &nmtvdi.item.pszText, &nmtvdi.item.cchTextMax,
1231 TVN_ENDLABELEDITW, TVN_ENDLABELEDITA, SET_NULL_IF_NO_MASK | CONVERT_SEND | CONVERT_RECEIVE},
1232 {&nmtvdi, sizeof(nmtvdi), &nmtvdi.item.mask, TVIF_TEXT, &nmtvdi.item.pszText, &nmtvdi.item.cchTextMax,
1233 TVN_GETDISPINFOW, TVN_GETDISPINFOA, ZERO_SEND | DONT_CONVERT_SEND| CONVERT_RECEIVE},
1234 {&nmtvdi, sizeof(nmtvdi), &nmtvdi.item.mask, TVIF_TEXT, &nmtvdi.item.pszText, &nmtvdi.item.cchTextMax,
1235 TVN_SETDISPINFOW, TVN_SETDISPINFOA, SET_NULL_IF_NO_MASK | CONVERT_SEND | CONVERT_RECEIVE},
1236 {&nmtvgit, sizeof(nmtvgit), NULL, 0, &nmtvgit.pszText, &nmtvgit.cchTextMax, TVN_GETINFOTIPW, TVN_GETINFOTIPA,
1237 DONT_CONVERT_SEND | CONVERT_RECEIVE},
1238 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1239 TVN_SINGLEEXPAND, TVN_SINGLEEXPAND, DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE, TVITEM_NEW_HANDLER},
1240 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1241 TVN_SINGLEEXPAND, TVN_SINGLEEXPAND, DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE, TVITEM_OLD_HANDLER},
1242 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1243 TVN_BEGINDRAGW, TVN_BEGINDRAGA, CONVERT_SEND, TVITEM_NEW_HANDLER},
1244 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1245 TVN_BEGINDRAGW, TVN_BEGINDRAGA, DONT_CONVERT_SEND, TVITEM_OLD_HANDLER},
1246 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1247 TVN_BEGINRDRAGW, TVN_BEGINRDRAGA, CONVERT_SEND, TVITEM_NEW_HANDLER},
1248 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1249 TVN_BEGINRDRAGW, TVN_BEGINRDRAGA, DONT_CONVERT_SEND, TVITEM_OLD_HANDLER},
1250 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1251 TVN_ITEMEXPANDEDW, TVN_ITEMEXPANDEDA, CONVERT_SEND, TVITEM_NEW_HANDLER},
1252 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1253 TVN_ITEMEXPANDEDW, TVN_ITEMEXPANDEDA, DONT_CONVERT_SEND, TVITEM_OLD_HANDLER},
1254 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1255 TVN_ITEMEXPANDINGW, TVN_ITEMEXPANDINGA, CONVERT_SEND, TVITEM_NEW_HANDLER},
1256 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1257 TVN_ITEMEXPANDINGW, TVN_ITEMEXPANDINGA, DONT_CONVERT_SEND, TVITEM_OLD_HANDLER},
1258 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1259 TVN_DELETEITEMW, TVN_DELETEITEMA, DONT_CONVERT_SEND, TVITEM_NEW_HANDLER},
1260 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1261 TVN_DELETEITEMW, TVN_DELETEITEMA, CONVERT_SEND, TVITEM_OLD_HANDLER},
1262 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1263 TVN_SELCHANGINGW, TVN_SELCHANGINGA, CONVERT_SEND, TVITEM_NEW_HANDLER},
1264 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1265 TVN_SELCHANGINGW, TVN_SELCHANGINGA, CONVERT_SEND, TVITEM_OLD_HANDLER},
1266 {&nmtv, sizeof(nmtv), &nmtv.itemNew.mask, TVIF_TEXT, &nmtv.itemNew.pszText, &nmtv.itemNew.cchTextMax,
1267 TVN_SELCHANGEDW, TVN_SELCHANGEDA, CONVERT_SEND, TVITEM_NEW_HANDLER},
1268 {&nmtv, sizeof(nmtv), &nmtv.itemOld.mask, TVIF_TEXT, &nmtv.itemOld.pszText, &nmtv.itemOld.cchTextMax,
1269 TVN_SELCHANGEDW, TVN_SELCHANGEDA, CONVERT_SEND, TVITEM_OLD_HANDLER}
1270 };
1271 BOOL bret;
1272 INT i;
1273
1274 bret = register_test_notify_class();
1275 ok(bret, "Register test class failed, error 0x%08x\n", GetLastError());
1276
1277 parent = CreateWindowA(class, "parent", WS_OVERLAPPED, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), 0);
1278 ok(parent != NULL, "CreateWindow failed\n");
1279 pager = CreateWindowA(WC_PAGESCROLLERA, "pager", WS_CHILD, 0, 0, 100, 100, parent, 0, GetModuleHandleA(0), 0);
1280 ok(pager != NULL, "CreateWindow failed\n");
1281 child1_wnd = CreateWindowA(class, "child", WS_CHILD, 0, 0, 100, 100, pager, (HMENU)1, GetModuleHandleA(0), 0);
1282 ok(child1_wnd != NULL, "CreateWindow failed\n");
1283 SendMessageW(pager, PGM_SETCHILD, 0, (LPARAM)child1_wnd);
1284
1285 for (i = 0; i < ARRAY_SIZE(paras); i++)
1286 test_notify_generic_text_helper(pager, paras + i);
1287
1288 /* Tests for those that can't be covered by generic text test helper */
1289 test_wm_notify_comboboxex(pager);
1290 test_wm_notify_datetime(pager);
1291 test_wm_notify_header(pager);
1292 test_wm_notify_tooltip(pager);
1293
1294 DestroyWindow(parent);
1295 UnregisterClassA(class, GetModuleHandleA(NULL));
1296}
const WCHAR * class
Definition: main.c:68
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define error(str)
Definition: mkdosfs.c:1605
static HWND child
Definition: cursoricon.c:298
int notify
Definition: msacm.c:1366
#define CreateWindow
Definition: winuser.h:5766

◆ test_wm_notify_comboboxex()

static void test_wm_notify_comboboxex ( HWND  pager)
static

Definition at line 1046 of file pager.c.

1047{
1048 static NMCBEDRAGBEGINW nmcbedb;
1049 static NMCBEENDEDITW nmcbeed;
1050
1051 /* CBEN_DRAGBEGIN */
1052 memset(&nmcbedb, 0, sizeof(nmcbedb));
1053 memcpy(nmcbedb.szText, test_w, sizeof(test_w));
1055 ok(!lstrcmpW(nmcbedb.szText, test_w), "Expect %s, got %s\n", wine_dbgstr_w(test_w), wine_dbgstr_w(nmcbedb.szText));
1056
1057 /* CBEN_ENDEDIT */
1058 memset(&nmcbeed, 0, sizeof(nmcbeed));
1059 memcpy(nmcbeed.szText, test_w, sizeof(test_w));
1060 send_notify(pager, CBEN_ENDEDITW, CBEN_ENDEDITA, (LPARAM)&nmcbeed, FALSE);
1061 ok(!lstrcmpW(nmcbeed.szText, test_w), "Expect %s, got %s\n", wine_dbgstr_w(test_w), wine_dbgstr_w(nmcbeed.szText));
1062}
#define CBEN_ENDEDITW
Definition: commctrl.h:3881
#define CBEN_DRAGBEGINW
Definition: commctrl.h:3886
WCHAR szText[CBEMAXSTRLEN]
Definition: commctrl.h:3902
WCHAR szText[CBEMAXSTRLEN]
Definition: commctrl.h:3919

◆ test_wm_notify_datetime()

static void test_wm_notify_datetime ( HWND  pager)
static

Definition at line 1064 of file pager.c.

1065{
1066 const struct notify_test_datetime_format *data;
1067 NMDATETIMEFORMATW nmdtf;
1068 INT i;
1069
1070 for (i = 0; i < ARRAY_SIZE(test_datetime_format_data); i++)
1071 {
1074
1075 memset(&nmdtf, 0, sizeof(nmdtf));
1076 if(data->send_pszformat) nmdtf.pszFormat = data->send_pszformat;
1077 nmdtf.pszDisplay = nmdtf.szDisplay;
1078 send_notify(pager, DTN_FORMATW, DTN_FORMATA, (LPARAM)&nmdtf, TRUE);
1079 if (data->return_szdisplay)
1080 ok(!lstrcmpW(nmdtf.szDisplay, data->return_szdisplay), "Sub test %d expect %s, got %s\n", i,
1081 wine_dbgstr_w(data->return_szdisplay), wine_dbgstr_w(nmdtf.szDisplay));
1082 if (data->return_pszdisplay)
1083 ok(!lstrcmpW(nmdtf.pszDisplay, data->return_pszdisplay), "Sub test %d expect %s, got %s\n", i,
1084 wine_dbgstr_w(data->return_pszdisplay), wine_dbgstr_w(nmdtf.pszDisplay));
1085 }
1086}
#define DTN_FORMATW
Definition: commctrl.h:4419
WCHAR szDisplay[64]
Definition: commctrl.h:4433

◆ test_wm_notify_header()

static void test_wm_notify_header ( HWND  pager)
static

Definition at line 1088 of file pager.c.

1089{
1090 NMHEADERW nmh = {{0}};
1091 HDITEMW hdi = {0};
1092 HD_TEXTFILTERW hdtf = {0};
1093
1094 hdi.mask = HDI_TEXT | HDI_FILTER;
1095 hdi.pszText = (WCHAR *)test_w;
1096 hdtf.pszText = (WCHAR *)test_w;
1097 nmh.pitem = &hdi;
1098 nmh.pitem->pvFilter = &hdtf;
1115 send_notify(pager, HDN_TRACKW, HDN_TRACKA, (LPARAM)&nmh, TRUE);
1116}
#define HDI_TEXT
Definition: commctrl.h:704
#define HDN_ITEMCHANGEDW
Definition: commctrl.h:840
#define HDN_ENDTRACKW
Definition: commctrl.h:850
#define HDN_ITEMDBLCLICKW
Definition: commctrl.h:844
#define HDN_TRACKW
Definition: commctrl.h:852
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:838
#define HDN_DIVIDERDBLCLICKW
Definition: commctrl.h:846
#define HDN_BEGINTRACKW
Definition: commctrl.h:848
#define HDI_FILTER
Definition: commctrl.h:711
#define HDN_ITEMCLICKW
Definition: commctrl.h:842
UINT mask
Definition: commctrl.h:684
LPWSTR pszText
Definition: commctrl.h:658

◆ test_wm_notify_tooltip()

static void test_wm_notify_tooltip ( HWND  pager)
static

Definition at line 1118 of file pager.c.

1119{
1120 NMTTDISPINFOW nmttdi;
1121 const struct notify_test_tooltip *data;
1122 INT i;
1123
1124 for (i = 0; i < ARRAY_SIZE(test_tooltip_data); i++)
1125 {
1128
1129 memset(&nmttdi, 0, sizeof(nmttdi));
1130 if (data->send_sztext) memcpy(nmttdi.szText, data->send_sztext, data->send_sztext_size);
1131 if (data->send_lpsztext) nmttdi.lpszText = (WCHAR *)data->send_lpsztext;
1133 if (data->return_sztext)
1134 {
1135 if (data->return_sztext_size == -1)
1136 ok(!lstrcmpW(nmttdi.szText, data->return_sztext), "Sub test %d expect %s, got %s\n", i,
1137 wine_dbgstr_w(data->return_sztext), wine_dbgstr_w(nmttdi.szText));
1138 else
1139 ok(!memcmp(nmttdi.szText, data->return_sztext, data->return_sztext_size), "Wrong szText content\n");
1140 }
1141 if (data->return_lpsztext)
1142 {
1143 if (IS_INTRESOURCE(data->return_lpsztext))
1144 ok(nmttdi.lpszText == data->return_lpsztext, "Sub test %d expect %s, got %s\n", i,
1145 wine_dbgstr_w(data->return_lpsztext), wine_dbgstr_w(nmttdi.lpszText));
1146 else
1147 ok(!lstrcmpW(nmttdi.lpszText, data->return_lpsztext), "Test %d expect %s, got %s\n", i,
1148 wine_dbgstr_w(data->return_lpsztext), wine_dbgstr_w(nmttdi.lpszText));
1149 }
1150 if (data->return_hinst)
1151 ok(nmttdi.hinst == data->return_hinst, "Sub test %d expect %p, got %p\n", i, data->return_hinst,
1152 nmttdi.hinst);
1153 }
1154}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TTN_GETDISPINFOW
Definition: commctrl.h:1878
HINSTANCE hinst
Definition: commctrl.h:1913
WCHAR szText[80]
Definition: commctrl.h:1912
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

◆ test_wm_notifyformat()

static void test_wm_notifyformat ( void  )
static

Definition at line 542 of file pager.c.

543{
544 static const WCHAR class_w[] = {'P', 'a', 'g', 'e', 'r', ' ', 'n', 'o', 't', 'i', 'f', 'y', 'f',
545 'o', 'r', 'm', 'a', 't', ' ', 'c', 'l', 'a', 's', 's', 0};
546 static const WCHAR parent_w[] = {'p', 'a', 'r', 'e', 'n', 't', 0};
547 static const WCHAR pager_w[] = {'p', 'a', 'g', 'e', 'r', 0};
548 static const WCHAR child_w[] = {'c', 'h', 'i', 'l', 'd', 0};
549 static const INT formats[] = {NFR_UNICODE, NFR_ANSI};
550 HWND parent, pager, child;
551 LRESULT ret;
552 BOOL bret;
553 INT i;
554
556 ok(bret, "Register test class failed, error 0x%08x\n", GetLastError());
557
558 for (i = 0; i < ARRAY_SIZE(formats); i++)
559 {
561 parent = CreateWindowW(class_w, parent_w, WS_OVERLAPPED, 0, 0, 100, 100, 0, 0, GetModuleHandleW(0), 0);
562 ok(parent != NULL, "CreateWindow failed\n");
563 pager = CreateWindowW(WC_PAGESCROLLERW, pager_w, WS_CHILD, 0, 0, 100, 100, parent, 0, GetModuleHandleW(0), 0);
564 ok(pager != NULL, "CreateWindow failed\n");
565 child = CreateWindowW(class_w, child_w, WS_CHILD, 0, 0, 100, 100, pager, 0, GetModuleHandleW(0), 0);
566 ok(child != NULL, "CreateWindow failed\n");
568
569 /* Test parent */
571 ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent, NF_REQUERY);
572 ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
573 ok(notify_query_received, "Didn't receive notify\n");
574
575 /* Send NF_QUERY directly to parent */
577 ret = SendMessageW(parent, WM_NOTIFYFORMAT, (WPARAM)pager, NF_QUERY);
578 ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
579 ok(notify_query_received, "Didn't receive notify\n");
580
581 /* Pager send notifications to its parent regardless of wParam */
583 ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent_wnd, NF_REQUERY);
584 ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
585 ok(notify_query_received, "Didn't receive notify\n");
586
587 /* Pager always wants Unicode notifications from children */
588 ret = SendMessageW(child, WM_NOTIFYFORMAT, (WPARAM)pager, NF_REQUERY);
589 ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
590 ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)child, NF_QUERY);
591 ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
592
594 }
595
597}
static const struct pixel_format_desc formats[]
Definition: util.c:59
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL register_notifyformat_class(void)
Definition: pager.c:530
#define WC_PAGESCROLLERW
Definition: commctrl.h:4502
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Variable Documentation

◆ buffer

WCHAR buffer[64]
static

Definition at line 45 of file pager.c.

Referenced by test_notify_generic_text_helper().

◆ child1_wnd

HWND child1_wnd
static

Definition at line 30 of file pager.c.

Referenced by child_proc(), send_notify(), and test_pager().

◆ child2_wnd

HWND child2_wnd
static

Definition at line 30 of file pager.c.

Referenced by child_proc(), and test_pager().

◆ DWORD_PTR

Definition at line 205 of file pager.c.

◆ large_a

const CHAR large_a[]
static
Initial value:
=
"You should have received a copy of the GNU Lesser General Public License along with this ..."

Definition at line 37 of file pager.c.

◆ large_truncated_65_w

const WCHAR large_truncated_65_w[65]
static
Initial value:
=
L"You should have received a copy of the GNU Lesser General Public"
#define L(x)
Definition: ntvdm.h:50

Definition at line 41 of file pager.c.

◆ large_truncated_80_w

const WCHAR large_truncated_80_w[80]
static
Initial value:
=
L"You should have received a copy of the GNU Lesser General Public License along w"

Definition at line 43 of file pager.c.

◆ large_w

const WCHAR large_w[]
static
Initial value:
=
L"You should have received a copy of the GNU Lesser General Public License along with this ..."

Definition at line 39 of file pager.c.

◆ notify_format

INT notify_format
static

Definition at line 31 of file pager.c.

Referenced by test_notifyformat_proc(), and test_wm_notifyformat().

◆ notify_query_received

BOOL notify_query_received
static

Definition at line 32 of file pager.c.

Referenced by test_notifyformat_proc(), and test_wm_notifyformat().

◆ notify_test_info

◆ parent_wnd

HWND parent_wnd
static

Definition at line 30 of file pager.c.

Referenced by create_pager_control(), and test_wm_notifyformat().

◆ sequences

Definition at line 207 of file pager.c.

Referenced by child_proc(), pager_subclass_proc(), parent_wnd_proc(), and test_pager().

◆ set_child_seq

const struct message set_child_seq[]
static
Initial value:
= {
{ 0 }
}
@ optional
Definition: SystemMenu.c:34
GLuint id
Definition: glext.h:5910
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1664
#define WM_CHILDACTIVATE
Definition: winuser.h:1641
#define WM_SIZE
Definition: winuser.h:1614
#define WM_NCCALCSIZE
Definition: winuser.h:1688
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1665

Definition at line 209 of file pager.c.

Referenced by test_pager().

◆ set_pos_empty_seq

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

Definition at line 265 of file pager.c.

Referenced by test_pager().

◆ set_pos_seq

const struct message set_pos_seq[]
static
Initial value:

Definition at line 241 of file pager.c.

Referenced by test_pager().

◆ SUBCLASSPROC

SUBCLASSPROC

Definition at line 205 of file pager.c.

◆ switch_child_seq

const struct message switch_child_seq[]
static
Initial value:

Definition at line 227 of file pager.c.

Referenced by test_pager().

◆ te_a

const CHAR te_a[] = {'t', 'e', 0, 0}
static

Definition at line 36 of file pager.c.

◆ test_a

const CHAR test_a[] = "test"
static

Definition at line 33 of file pager.c.

Referenced by test_notify_proc().

◆ test_convert_receive_data

const struct notify_test_receive test_convert_receive_data[]
static
Initial value:
=
{
{L"", sizeof(L""), ARRAY_SIZE(buffer), NULL, test_a, sizeof(test_a), -1, test_w, ARRAY_SIZE(buffer)},
{L"", sizeof(L""), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, test_w, ARRAY_SIZE(buffer)},
{NULL, sizeof(L""), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, NULL, ARRAY_SIZE(buffer)},
{L"", sizeof(L""), ARRAY_SIZE(buffer), "", 0, 0, 1, L"", 1},
}
static const CHAR large_a[]
Definition: pager.c:37
static const WCHAR large_truncated_65_w[65]
Definition: pager.c:41

Definition at line 131 of file pager.c.

Referenced by notify_generic_text_handler(), and test_notify_generic_text_helper().

◆ test_convert_send_data

const struct notify_test_send test_convert_send_data[]
static
Initial value:
=
{
}

Definition at line 121 of file pager.c.

Referenced by notify_generic_text_handler(), and test_notify_generic_text_helper().

◆ test_datetime_format_data

const struct notify_test_datetime_format test_datetime_format_data[]
static
Initial value:
=
{
{NULL, NULL, NULL, 0, test_a, L"", -1, test_w},
{NULL, NULL, test_a, sizeof(test_a), NULL, test_w, -1, test_w},
{NULL, NULL, test_a, 2, test_a, (WCHAR *)te_a, -1, test_w},
}
static const CHAR te_a[]
Definition: pager.c:36
static const WCHAR large_w[]
Definition: pager.c:39

Referenced by notify_datetime_handler(), and test_wm_notify_datetime().

◆ test_dont_convert_receive_data

const struct notify_test_receive test_dont_convert_receive_data[]
static
Initial value:
=
{
{L"", sizeof(L""), ARRAY_SIZE(buffer), NULL, test_a, sizeof(test_a), -1, test_a, ARRAY_SIZE(buffer)},
{L"", sizeof(L""), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, test_a, ARRAY_SIZE(buffer)},
}

Definition at line 140 of file pager.c.

Referenced by notify_generic_text_handler(), and test_notify_generic_text_helper().

◆ test_dont_convert_send_data

const struct notify_test_send test_dont_convert_send_data[]
static
Initial value:
=
{
}

Definition at line 126 of file pager.c.

Referenced by notify_generic_text_handler(), and test_notify_generic_text_helper().

◆ test_tooltip_data

const struct notify_test_tooltip test_tooltip_data[]
static
Initial value:
=
{
{NULL, 0, NULL, NULL, L"", -1, L""},
{test_a, sizeof(test_a), NULL, NULL, test_w, -1, test_w},
{test_a, sizeof(test_a), test_a, NULL, test_w, -1, test_w},
{test_a, sizeof(test_a), (CHAR *)1, (HMODULE)0xdeadbeef, L"", -1, (WCHAR *)1, (HMODULE)0xdeadbeef},
{test_a, sizeof(test_a), test_a, (HMODULE)0xdeadbeef, test_w, -1, test_w, (HMODULE)0xdeadbeef},
{NULL, 0, test_a, NULL, test_w, -1, test_w},
{test_a, 2, test_a, NULL, test_w, -1, test_w},
{NULL, 0, NULL, NULL, test_w, -1, test_w, NULL, test_a, test_w, sizeof(test_w)},
{NULL, 0, NULL, NULL, L"", -1, L"", NULL, "", NULL, 0, test_w},
}
static const WCHAR large_truncated_80_w[80]
Definition: pager.c:43
HANDLE HMODULE
Definition: typedefs.h:77

Referenced by notify_tooltip_handler(), and test_wm_notify_tooltip().

◆ test_w

const WCHAR test_w[] = L"test"
static

◆ UINT_PTR

Definition at line 205 of file pager.c.