ReactOS 0.4.15-dev-7918-g2a2556c
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 WCHAR test_w [] = {'t', 'e', 's', 't', 0}
 
static CHAR test_a [] = {'t', 'e', 's', 't', 0}
 
static CHAR te_a [] = {'t', 'e', 0, 0}
 
static WCHAR empty_w [] = {0}
 
static CHAR empty_a [] = {0}
 
static CHAR large_a [] = "You should have received a copy of the GNU Lesser General Public License along with this ..."
 
static WCHAR large_w []
 
static WCHAR large_truncated_65_w [65]
 
static 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 216 of file pager.c.

◆ CHILD2_ID

#define CHILD2_ID   2

Definition at line 217 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 75 of file pager.c.

76{
79};
@ TVITEM_NEW_HANDLER
Definition: pager.c:77
@ TVITEM_OLD_HANDLER
Definition: pager.c:78

◆ 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 63 of file pager.c.

64{
65 CONVERT_SEND = 0x01,
66 DONT_CONVERT_SEND = 0x02,
67 CONVERT_RECEIVE = 0x04,
69 SEND_EMPTY_IF_NULL = 0x10,
72 ZERO_SEND = 0x80
73};
@ CONVERT_RECEIVE
Definition: pager.c:67
@ ZERO_SEND
Definition: pager.c:72
@ DONT_SEND_EMPTY_IF_NULL
Definition: pager.c:70
@ SEND_EMPTY_IF_NULL
Definition: pager.c:69
@ SET_NULL_IF_NO_MASK
Definition: pager.c:71
@ CONVERT_SEND
Definition: pager.c:65
@ DONT_CONVERT_RECEIVE
Definition: pager.c:68
@ DONT_CONVERT_SEND
Definition: pager.c:66

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 401 of file pager.c.

402{
403 static LONG defwndproc_counter;
404 struct message msg = { 0 };
405 LRESULT ret;
406
407 msg.message = message;
408 msg.flags = sent | wparam | lparam;
409 if (defwndproc_counter)
410 msg.flags |= defwinproc;
411 msg.wParam = wParam;
412 msg.lParam = lParam;
413
414 if (hwnd == child1_wnd)
415 msg.id = CHILD1_ID;
416 else if (hwnd == child2_wnd)
417 msg.id = CHILD2_ID;
418 else
419 msg.id = 0;
420
422
423 defwndproc_counter++;
425 defwndproc_counter--;
426
427 return ret;
428}
@ 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:216
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:222
static HWND child1_wnd
Definition: pager.c:30
#define CHILD2_ID
Definition: pager.c:217
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 387 of file pager.c.

388{
389 WNDPROC oldproc;
390 HWND hwnd;
391 RECT rect;
392
395 0, 0, 100, 100, parent_wnd, 0, GetModuleHandleA(0), 0 );
398 return hwnd;
399}
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:374
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:4498
& rect
Definition: startmenu.cpp:1413
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
#define SetWindowLongPtrA
Definition: winuser.h:5345
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4315
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906

Referenced by test_pager().

◆ create_parent_window()

static HWND create_parent_window ( void  )
static

Definition at line 364 of file pager.c.

365{
367 return NULL;
368
369 return CreateWindowA("Pager test parent class", "Pager test parent window",
371 0, 0, 200, 200, 0, NULL, GetModuleHandleA(NULL), NULL );
372}
#define NULL
Definition: types.h:112
static BOOL register_parent_wnd_class(void)
Definition: pager.c:347
#define WS_OVERLAPPED
Definition: pedump.c:615

◆ heap_strdup()

static CHAR * heap_strdup ( const CHAR str)
static

Definition at line 285 of file pager.c.

286{
287 int len = lstrlenA(str) + 1;
288 CHAR *ret = heap_alloc(len * sizeof(CHAR));
289 lstrcpyA(ret, str);
290 return ret;
291}
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 1312 of file pager.c.

1313{
1314 HMODULE mod = LoadLibraryA("comctl32.dll");
1315
1316#define X(f) p##f = (void*)GetProcAddress(mod, #f);
1318#undef X
1319
1320 pSetWindowSubclass = (void*)GetProcAddress(mod, (LPSTR)410);
1321}
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define GetProcAddress(x, y)
Definition: compat.h:753
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
static int mod
Definition: i386-dis.c:1288
#define X(f)
char * LPSTR
Definition: xmlstorage.h:182

◆ notify_datetime_handler()

static void notify_datetime_handler ( NMDATETIMEFORMATA nm)
static

Definition at line 689 of file pager.c.

690{
692 if (data->expect_pszformat)
693 ok(!lstrcmpA(data->expect_pszformat, nm->pszFormat), "Sub test %d expect %s, got %s\n",
694 notify_test_info.sub_test_id, data->expect_pszformat, nm->pszFormat);
695 ok(nm->pszDisplay == nm->szDisplay, "Test %d expect %p, got %p\n", notify_test_info.sub_test_id, nm->szDisplay,
696 nm->pszDisplay);
697 if (data->write_szdisplay) memcpy(nm->szDisplay, data->write_szdisplay, data->write_szdisplay_size);
698 if (data->write_pszdisplay) nm->pszDisplay = data->write_pszdisplay;
699}
#define ok(value,...)
Definition: atltest.h:57
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
#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:90

Referenced by test_notify_proc().

◆ notify_generic_text_handler()

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

Definition at line 614 of file pager.c.

615{
616 const struct notify_test_send *send_data;
617 const struct notify_test_receive *receive_data;
618
620 {
621 case CONVERT_SEND:
623 {
627 ok(!lstrcmpA(*text, empty_a), "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
630 ok(!lstrcmpA(send_data->expect_text, *text), "Code 0x%08x test 0x%08x sub test %d expect %s, got %s\n",
632 (CHAR *)send_data->expect_text, *text);
633 else
634 ok(!lstrcmpW((WCHAR *)send_data->expect_text, (WCHAR *)*text),
635 "Code 0x%08x test 0x%08x sub test %d expect %s, got %s\n", notify_test_info.unicode,
638 if (text_max)
639 ok(*text_max == send_data->send_text_max, "Code 0x%08x test 0x%08x sub test %d expect %d, got %d\n",
641 send_data->send_text_max, *text_max);
642 break;
643 }
644 case CONVERT_RECEIVE:
646 {
649 if (text_max)
650 ok(*text_max == receive_data->send_text_max, "Code 0x%08x test 0x%08x sub test %d expect %d, got %d\n",
652 receive_data->send_text_max, *text_max);
653
654 if (receive_data->write_text)
655 memcpy(*text, receive_data->write_text, receive_data->write_text_size);
656 /* 64bit Windows will try to free the text pointer even if it's application provided when handling
657 * HDN_GETDISPINFOW. Deliberate leak here. */
659 *text = heap_strdup(receive_data->write_pointer);
660 else
661 *text = receive_data->write_pointer;
662 if (text_max && receive_data->write_text_max != -1) *text_max = receive_data->write_text_max;
663 break;
664 }
666 ok(!lstrcmpA(*text, empty_a), "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
668 break;
670 ok(!*text, "Code 0x%08x test 0x%08x sub test %d expect null text\n", notify_test_info.unicode,
672 break;
673 }
674}
const WCHAR * text
Definition: package.c:1799
#define wine_dbgstr_w
Definition: kernel32.h:34
if(dx< 0)
Definition: linetemp.h:194
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static CHAR empty_a[]
Definition: pager.c:38
static const struct notify_test_send test_convert_send_data[]
Definition: pager.c:136
static const struct notify_test_receive test_convert_receive_data[]
Definition: pager.c:146
static const struct notify_test_receive test_dont_convert_receive_data[]
Definition: pager.c:155
static const struct notify_test_send test_dont_convert_send_data[]
Definition: pager.c:141
static CHAR * heap_strdup(const CHAR *str)
Definition: pager.c:285
#define HDN_GETDISPINFOW
Definition: commctrl.h:854
static int receive_data(SOCKET sock, SecBuffer *buf)
Definition: schannel.c:604
DWORD flags
Definition: pager.c:93
UINT test_id
Definition: pager.c:89
UINT unicode
Definition: pager.c:83
void * expect_text
Definition: pager.c:103
INT send_text_max
Definition: pager.c:101
__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 676 of file pager.c.

677{
679 ok(nm->lpszText == nm->szText, "Sub test %d expect %p, got %p\n", notify_test_info.sub_test_id, nm->szText,
680 nm->lpszText);
681 if (data->expect_sztext)
682 ok(!lstrcmpA(data->expect_sztext, nm->szText), "Sub test %d expect %s, got %s\n", notify_test_info.sub_test_id,
683 data->expect_sztext, nm->szText);
684 if (data->write_sztext) memcpy(nm->szText, data->write_sztext, data->write_sztext_size);
685 if (data->write_lpsztext) nm->lpszText = data->write_lpsztext;
686 if (data->write_hinst) nm->hinst = data->write_hinst;
687}
static const struct notify_test_tooltip test_tooltip_data[]
char szText[80]
Definition: commctrl.h:1898
HINSTANCE hinst
Definition: commctrl.h:1899

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 374 of file pager.c.

375{
377 struct message msg = { 0 };
378
379 msg.message = message;
380 msg.flags = sent|wparam|lparam;
381 msg.wParam = wParam;
382 msg.lParam = lParam;
384 return CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
385}
#define GetWindowLongPtrA
Definition: winuser.h:4828
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 293 of file pager.c.

294{
295 static LONG defwndproc_counter = 0;
296 LRESULT ret;
297 struct message msg;
298
299 /* log system messages, except for painting */
300 if (message < WM_USER &&
301 message != WM_PAINT &&
303 message != WM_NCPAINT &&
305 message != WM_GETTEXT &&
306 message != WM_GETICON &&
308 {
309 msg.message = message;
310 msg.flags = sent|wparam|lparam|parent;
311 if (defwndproc_counter) msg.flags |= defwinproc;
312 msg.wParam = wParam;
313 msg.lParam = lParam;
314 if (message == WM_NOTIFY && lParam) msg.id = ((NMHDR*)lParam)->code;
316 }
317
318 if (message == WM_NOTIFY)
319 {
320 NMHDR *nmhdr = (NMHDR *)lParam;
321
322 switch (nmhdr->code)
323 {
324 case PGN_CALCSIZE:
325 {
326 NMPGCALCSIZE *nmpgcs = (NMPGCALCSIZE *)lParam;
328
329 if (style & PGS_HORZ)
330 ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
331 else
332 ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
333 break;
334 }
335 default:
336 ;
337 }
338 }
339
340 defwndproc_counter++;
342 defwndproc_counter--;
343
344 return ret;
345}
r parent
Definition: btrfs.c:3010
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PGN_CALCSIZE
Definition: commctrl.h:4580
#define PGF_CALCWIDTH
Definition: commctrl.h:4582
#define PGF_CALCHEIGHT
Definition: commctrl.h:4583
#define PGS_HORZ
Definition: commctrl.h:4503
#define WM_NOTIFY
Definition: richedit.h:61
DWORD dwFlag
Definition: commctrl.h:4587
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
#define WM_PAINT
Definition: winuser.h:1620
#define WM_ERASEBKGND
Definition: winuser.h:1625
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_NCHITTEST
Definition: winuser.h:1686
#define WM_GETTEXT
Definition: winuser.h:1618
#define WM_DEVICECHANGE
Definition: winuser.h:1811
#define WM_USER
Definition: winuser.h:1895
#define GWL_STYLE
Definition: winuser.h:852
#define WM_NCPAINT
Definition: winuser.h:1687

Referenced by register_parent_wnd_class().

◆ register_child_wnd_class()

static BOOL register_child_wnd_class ( void  )
static

Definition at line 430 of file pager.c.

431{
432 WNDCLASSA cls;
433
434 cls.style = 0;
436 cls.cbClsExtra = 0;
437 cls.cbWndExtra = 0;
439 cls.hIcon = 0;
442 cls.lpszMenuName = NULL;
443 cls.lpszClassName = "Pager test child class";
444 return RegisterClassA(&cls);
445}
static LRESULT WINAPI child_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:401
HBRUSH hbrBackground
Definition: winuser.h:3170
HICON hIcon
Definition: winuser.h:3168
HINSTANCE hInstance
Definition: winuser.h:3167
HCURSOR hCursor
Definition: winuser.h:3169
int cbWndExtra
Definition: winuser.h:3166
UINT style
Definition: winuser.h:3163
LPCSTR lpszMenuName
Definition: winuser.h:3171
LPCSTR lpszClassName
Definition: winuser.h:3172
WNDPROC lpfnWndProc
Definition: winuser.h:3164
int cbClsExtra
Definition: winuser.h:3165
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:2090
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by test_pager().

◆ register_notifyformat_class()

static BOOL register_notifyformat_class ( void  )
static

Definition at line 545 of file pager.c.

546{
547 static const WCHAR class_w[] = {'P', 'a', 'g', 'e', 'r', ' ', 'n', 'o', 't', 'i', 'f', 'y', 'f',
548 'o', 'r', 'm', 'a', 't', ' ', 'c', 'l', 'a', 's', 's', 0};
549 WNDCLASSW cls = {0};
550
553 cls.lpszClassName = class_w;
554 return RegisterClassW(&cls);
555}
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:525
LPCWSTR lpszClassName
Definition: winuser.h:3185
HINSTANCE hInstance
Definition: winuser.h:3180
WNDPROC lpfnWndProc
Definition: winuser.h:3177
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 347 of file pager.c.

348{
349 WNDCLASSA cls;
350
351 cls.style = 0;
353 cls.cbClsExtra = 0;
354 cls.cbWndExtra = 0;
356 cls.hIcon = 0;
359 cls.lpszMenuName = NULL;
360 cls.lpszClassName = "Pager test parent class";
361 return RegisterClassA(&cls);
362}
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:293

Referenced by create_parent_window().

◆ register_test_notify_class()

static BOOL register_test_notify_class ( void  )
static

Definition at line 923 of file pager.c.

924{
925 WNDCLASSA cls = {0};
926
929 cls.lpszClassName = "Pager notify class";
930 return RegisterClassA(&cls);
931}
static LRESULT WINAPI test_notify_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: pager.c:701

◆ send_notify()

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

Definition at line 933 of file pager.c.

934{
935 NMHDR *hdr = (NMHDR *)lParam;
936
937 notify_test_info.unicode = unicode;
940 notify_test_info.ansi = ansi;
942
943 hdr->code = unicode;
944 hdr->idFrom = 1;
945 hdr->hwndFrom = child1_wnd;
946
947 SendMessageW(pager, WM_NOTIFY, hdr->idFrom, lParam);
948 ok(notify_test_info.received, "Expect notification received\n");
949 ok(hdr->code == code_change ? ansi : unicode, "Expect 0x%08x, got 0x%08x\n", hdr->code,
950 code_change ? ansi : unicode);
951}
#define FALSE
Definition: types.h:117
char hdr[14]
Definition: iptest.cpp:33
HWND hwnd_from
Definition: pager.c:86
BOOL received
Definition: pager.c:88
UINT_PTR id_from
Definition: pager.c:85
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 1323 of file pager.c.

1324{
1326
1328
1329 iccex.dwSize = sizeof(iccex);
1331 pInitCommonControlsEx(&iccex);
1332
1334
1336 ok(parent_wnd != NULL, "Failed to create parent window!\n");
1337
1338 test_pager();
1341
1343}
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
static HWND create_parent_window(void)
Definition: pager.c:364
#define NUM_MSG_SEQUENCES
Definition: pager.c:27
static void test_wm_notifyformat(void)
Definition: pager.c:557
static void test_wm_notify(void)
Definition: pager.c:1170
static void test_pager(void)
Definition: pager.c:447
static void init_functions(void)
Definition: pager.c:1312
#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 954 of file pager.c.

955{
956 const struct notify_test_send *send_data;
957 const struct notify_test_receive *receive_data;
959 INT i;
960
963
964 if (para->flags & (CONVERT_SEND | DONT_CONVERT_SEND))
965 {
966 if (para->flags & CONVERT_SEND)
967 {
969 send_data = test_convert_send_data;
971 }
972 else
973 {
975 send_data = test_dont_convert_send_data;
977 }
978
979 for (i = 0; i < array_size; i++)
980 {
981 const struct notify_test_send *data = send_data + i;
983
984 memset(para->ptr, 0, para->size);
985 if (para->mask) *para->mask = para->required_mask;
986 if (data->send_text)
987 {
988 memcpy(buffer, data->send_text, data->send_text_size);
989 *para->text = buffer;
990 }
991 if (para->text_max) *para->text_max = data->send_text_max;
992 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
993 }
994 }
995
997 {
998 if (para->flags & CONVERT_RECEIVE)
999 {
1003 }
1004 else
1005 {
1009 }
1010
1011 for (i = 0; i < array_size; i++)
1012 {
1013 const struct notify_test_receive *data = receive_data + i;
1015
1016 memset(para->ptr, 0, para->size);
1017 if (para->mask) *para->mask = para->required_mask;
1018 if (data->send_text)
1019 {
1020 memcpy(buffer, data->send_text, data->send_text_size);
1021 *para->text = buffer;
1022 }
1023 if (para->text_max) *para->text_max = data->send_text_max;
1024 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
1025 if (data->return_text)
1026 {
1027 if (para->flags & CONVERT_RECEIVE)
1028 ok(!lstrcmpW(data->return_text, *para->text), "Code 0x%08x sub test %d expect %s, got %s\n",
1029 para->code_unicode, i, wine_dbgstr_w((WCHAR *)data->return_text), wine_dbgstr_w(*para->text));
1030 else
1031 ok(!lstrcmpA(data->return_text, (CHAR *)*para->text), "Code 0x%08x sub test %d expect %s, got %s\n",
1032 para->code_unicode, i, (CHAR *)data->return_text, (CHAR *)*para->text);
1033 }
1034 if (para->text_max)
1035 ok(data->return_text_max == *para->text_max, "Code 0x%08x sub test %d expect %d, got %d\n",
1036 para->code_unicode, i, data->return_text_max, *para->text_max);
1037 }
1038 }
1039
1040 /* Extra tests for other behavior flags that are not worth it to create their own test arrays */
1041 memset(para->ptr, 0, para->size);
1042 if (para->mask) *para->mask = para->required_mask;
1043 if (para->text_max) *para->text_max = 1;
1044 if (para->flags & SEND_EMPTY_IF_NULL)
1046 else
1048 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
1049
1051 memset(para->ptr, 0, para->size);
1052 memset(buffer, 0, sizeof(buffer));
1053 *para->text = buffer;
1054 if (para->text_max) *para->text_max = ARRAY_SIZE(buffer);
1055 send_notify(pager, para->code_unicode, para->code_ansi, (LPARAM)para->ptr, TRUE);
1056 if(para->flags & SET_NULL_IF_NO_MASK)
1057 ok(!*para->text, "Expect null text\n");
1058}
#define ARRAY_SIZE(A)
Definition: main.h:33
#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:60
static void send_notify(HWND pager, UINT unicode, UINT ansi, LPARAM lParam, BOOL code_change)
Definition: pager.c:933
static UINT array_size
Definition: msctf.c:67
#define memset(x, y, z)
Definition: compat.h:39
UINT handler_id
Definition: pager.c:91
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 701 of file pager.c.

702{
703 static const WCHAR test[] = {'t', 'e', 's', 't', 0};
704 switch (message)
705 {
706 case WM_NOTIFY:
707 {
708 NMHDR *hdr = (NMHDR *)lParam;
709
710 /* Not notifications we want to test */
711 if (!notify_test_info.unicode) break;
712 ok(!notify_test_info.received, "Extra notification received\n");
713
714 ok(wParam == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
715 ok(hdr->code == notify_test_info.ansi, "Expect 0x%08x, got 0x%08x\n", notify_test_info.ansi, hdr->code);
716 ok(hdr->idFrom == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
717 ok(hdr->hwndFrom == notify_test_info.hwnd_from, "Expect %p, got %p\n", notify_test_info.hwnd_from, hdr->hwndFrom);
718
719 if (hdr->code != notify_test_info.ansi)
720 {
721 skip("Notification code mismatch, skipping lParam check\n");
722 return 0;
723 }
724 switch (hdr->code)
725 {
726 /* ComboBoxEx */
727 case CBEN_INSERTITEM:
728 case CBEN_DELETEITEM:
729 {
730 NMCOMBOBOXEXW *nmcbe = (NMCOMBOBOXEXW *)hdr;
732 break;
733 }
734 case CBEN_DRAGBEGINA:
735 {
736 NMCBEDRAGBEGINA *nmcbedb = (NMCBEDRAGBEGINA *)hdr;
737 ok(!lstrcmpA(nmcbedb->szText, test_a), "Expect %s, got %s\n", nmcbedb->szText, test_a);
738 break;
739 }
740 case CBEN_ENDEDITA:
741 {
742 NMCBEENDEDITA *nmcbeed = (NMCBEENDEDITA *)hdr;
743 ok(!lstrcmpA(nmcbeed->szText, test_a), "Expect %s, got %s\n", nmcbeed->szText, test_a);
744 break;
745 }
747 {
748 NMCOMBOBOXEXA *nmcbe = (NMCOMBOBOXEXA *)hdr;
750 break;
751 }
752 /* Date and Time Picker */
753 case DTN_FORMATA:
754 {
756 break;
757 }
758 case DTN_FORMATQUERYA:
759 {
762 break;
763 }
764 case DTN_WMKEYDOWNA:
765 {
768 break;
769 }
770 case DTN_USERSTRINGA:
771 {
774 break;
775 }
776 /* Header */
777 case HDN_BEGINDRAG:
778 case HDN_ENDDRAG:
781 case HDN_DROPDOWN:
782 case HDN_FILTERCHANGE:
783 case HDN_ITEMKEYDOWN:
786 {
787 NMHEADERW *nmhd = (NMHEADERW *)hdr;
788 ok(!lstrcmpW(nmhd->pitem->pszText, test_w), "Expect %s, got %s\n", wine_dbgstr_w(test_w),
789 wine_dbgstr_w(nmhd->pitem->pszText));
790 ok(!lstrcmpW(((HD_TEXTFILTERW *)nmhd->pitem->pvFilter)->pszText, test_w), "Expect %s, got %s\n",
792 break;
793 }
794 case HDN_BEGINTRACKA:
796 case HDN_ENDTRACKA:
797 case HDN_ITEMCHANGEDA:
799 case HDN_ITEMCLICKA:
801 case HDN_TRACKA:
802 {
803 NMHEADERA *nmhd = (NMHEADERA *)hdr;
804 ok(!lstrcmpA(nmhd->pitem->pszText, test_a), "Expect %s, got %s\n", test_a, nmhd->pitem->pszText);
805 ok(!lstrcmpA(((HD_TEXTFILTERA *)nmhd->pitem->pvFilter)->pszText, test_a), "Expect %s, got %s\n", test_a,
806 ((HD_TEXTFILTERA *)nmhd->pitem->pvFilter)->pszText);
807 break;
808 }
809 case HDN_GETDISPINFOA:
810 {
811 NMHDDISPINFOA *nmhddi = (NMHDDISPINFOA *)hdr;
813 break;
814 }
815 /* List View */
818 case LVN_GETDISPINFOA:
819 case LVN_SETDISPINFOA:
820 {
821 NMLVDISPINFOA *nmlvdi = (NMLVDISPINFOA *)hdr;
823 break;
824 }
825 case LVN_GETINFOTIPA:
826 {
827 NMLVGETINFOTIPA *nmlvgit = (NMLVGETINFOTIPA *)hdr;
828 notify_generic_text_handler(&nmlvgit->pszText, &nmlvgit->cchTextMax);
829 break;
830 }
832 case LVN_ODFINDITEMA:
833 {
834 NMLVFINDITEMA *nmlvfi = (NMLVFINDITEMA *)hdr;
836 break;
837 }
838 /* Toolbar */
839 case TBN_SAVE:
840 {
841 NMTBSAVE *nmtbs = (NMTBSAVE *)hdr;
843 break;
844 }
845 case TBN_RESTORE:
846 {
847 NMTBRESTORE *nmtbr = (NMTBRESTORE *)hdr;
849 break;
850 }
852 {
853 NMTOOLBARA *nmtb = (NMTOOLBARA *)hdr;
855 break;
856 }
857 case TBN_GETDISPINFOW:
858 {
859 NMTBDISPINFOW *nmtbdi = (NMTBDISPINFOW *)hdr;
860 notify_generic_text_handler((CHAR **)&nmtbdi->pszText, &nmtbdi->cchText);
861 break;
862 }
863 case TBN_GETINFOTIPA:
864 {
865 NMTBGETINFOTIPA *nmtbgit = (NMTBGETINFOTIPA *)hdr;
866 notify_generic_text_handler(&nmtbgit->pszText, &nmtbgit->cchTextMax);
867 break;
868 }
869 /* Tooltip */
870 case TTN_GETDISPINFOA:
871 {
873 break;
874 }
875 /* Tree View */
878 case TVN_GETDISPINFOA:
879 case TVN_SETDISPINFOA:
880 {
881 NMTVDISPINFOA *nmtvdi = (NMTVDISPINFOA *)hdr;
883 break;
884 }
885 case TVN_GETINFOTIPA:
886 {
887 NMTVGETINFOTIPA *nmtvgit = (NMTVGETINFOTIPA *)hdr;
888 notify_generic_text_handler(&nmtvgit->pszText, &nmtvgit->cchTextMax);
889 break;
890 }
891 case TVN_SINGLEEXPAND:
892 case TVN_BEGINDRAGA:
893 case TVN_BEGINRDRAGA:
896 case TVN_DELETEITEMA:
897 case TVN_SELCHANGINGA:
898 case TVN_SELCHANGEDA:
899 {
900 NMTREEVIEWA *nmtv = (NMTREEVIEWA *)hdr;
903 else
905 break;
906 }
907
908 default:
909 ok(0, "Unexpected message 0x%08x\n", hdr->code);
910 }
912 ok(!lstrcmpA(test_a, "test"), "test_a got modified\n");
913 ok(!lstrcmpW(test_w, test), "test_w got modified\n");
914 return 0;
915 }
916 case WM_NOTIFYFORMAT:
917 if (lParam == NF_QUERY) return NFR_ANSI;
918 break;
919 }
921}
#define skip(...)
Definition: atltest.h:64
static CHAR test_a[]
Definition: pager.c:34
static void notify_generic_text_handler(CHAR **text, INT *text_max)
Definition: pager.c:614
static WCHAR test_w[]
Definition: pager.c:33
static void notify_tooltip_handler(NMTTDISPINFOA *nm)
Definition: pager.c:676
static void notify_datetime_handler(NMDATETIMEFORMATA *nm)
Definition: pager.c:689
#define TVN_ENDLABELEDITA
Definition: commctrl.h:3711
#define TTN_GETDISPINFOA
Definition: commctrl.h:1872
#define LVN_GETDISPINFOA
Definition: commctrl.h:3153
#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:3699
#define TVN_BEGINLABELEDITA
Definition: commctrl.h:3709
#define TBN_SAVE
Definition: commctrl.h:1345
#define LVN_GETINFOTIPA
Definition: commctrl.h:3222
#define HDN_ITEMKEYDOWN
Definition: commctrl.h:862
#define CBEN_DRAGBEGINA
Definition: commctrl.h:3880
#define DTN_USERSTRINGA
Definition: commctrl.h:4373
#define HDN_OVERFLOWCLICK
Definition: commctrl.h:864
#define TVN_BEGINRDRAGA
Definition: commctrl.h:3705
#define CBEN_ENDEDITA
Definition: commctrl.h:3875
#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:3701
#define LVN_INCREMENTALSEARCHA
Definition: commctrl.h:3163
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:837
#define LVN_BEGINLABELEDITA
Definition: commctrl.h:3135
#define HDN_ITEMCLICKA
Definition: commctrl.h:841
#define CBEN_GETDISPINFOA
Definition: commctrl.h:3871
#define HDN_ENDTRACKA
Definition: commctrl.h:849
#define DTN_WMKEYDOWNA
Definition: commctrl.h:4393
#define TVN_SELCHANGINGA
Definition: commctrl.h:3645
#define HDN_ENDDRAG
Definition: commctrl.h:856
#define LVN_SETDISPINFOA
Definition: commctrl.h:3155
#define HDN_FILTERCHANGE
Definition: commctrl.h:857
#define LVN_ENDLABELEDITA
Definition: commctrl.h:3137
#define TVN_DELETEITEMA
Definition: commctrl.h:3707
#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:3873
#define TVN_BEGINDRAGA
Definition: commctrl.h:3703
#define TVN_GETDISPINFOA
Definition: commctrl.h:3654
#define LVN_ODFINDITEMA
Definition: commctrl.h:3144
#define CBEN_INSERTITEM
Definition: commctrl.h:3872
#define DTN_FORMATQUERYA
Definition: commctrl.h:4435
#define DTN_FORMATA
Definition: commctrl.h:4413
#define HDN_TRACKA
Definition: commctrl.h:851
#define TVN_SELCHANGEDA
Definition: commctrl.h:3647
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:839
#define TVN_SETDISPINFOA
Definition: commctrl.h:3656
#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:3716
#define TVN_GETINFOTIPA
Definition: commctrl.h:3714
#define test
Definition: rosglue.h:37
char szText[CBEMAXSTRLEN]
Definition: commctrl.h:3903
char szText[CBEMAXSTRLEN]
Definition: commctrl.h:3922
COMBOBOXEXITEMA ceItem
Definition: commctrl.h:3859
COMBOBOXEXITEMW ceItem
Definition: commctrl.h:3864
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:3174
int cchTextMax
Definition: commctrl.h:2349
LPSTR pszText
Definition: commctrl.h:2348
HDITEMA * pitem
Definition: commctrl.h:884
HDITEMW * pitem
Definition: commctrl.h:891
LVFINDINFOA lvfi
Definition: commctrl.h:3095
TBBUTTON tbButton
Definition: commctrl.h:1373
TBBUTTON tbButton
Definition: commctrl.h:1362
LPSTR pszText
Definition: commctrl.h:1443
TVITEMA itemOld
Definition: commctrl.h:3629
TVITEMA itemNew
Definition: commctrl.h:3630
TVITEMA item
Definition: commctrl.h:3667
LPSTR pszText
Definition: commctrl.h:3307
int cchTextMax
Definition: commctrl.h:3308
#define NFR_ANSI
Definition: winuser.h:2458
#define NF_QUERY
Definition: winuser.h:2460

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 525 of file pager.c.

526{
527 switch (message)
528 {
529 case WM_NOTIFYFORMAT:
530 if (lParam == NF_QUERY)
531 {
533 return notify_format;
534 }
535 else if (lParam == NF_REQUERY)
536 return SendMessageA(GetParent(hwnd), WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
537 else
538 return 0;
539 default:
542 }
543}
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:2461
HWND WINAPI GetParent(_In_ HWND)
#define NFR_UNICODE
Definition: winuser.h:2459

Referenced by register_notifyformat_class().

◆ test_pager()

static void test_pager ( void  )
static

Definition at line 447 of file pager.c.

448{
449 HWND pager;
450 RECT rect, rect2;
451
453 ok(pager != NULL, "Fail to create pager\n");
454
456
457 child1_wnd = CreateWindowA( "Pager test child class", "button", WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 300, 300,
458 pager, 0, GetModuleHandleA(0), 0 );
459 child2_wnd = CreateWindowA("Pager test child class", "button", WS_CHILD | WS_BORDER, 0, 0, 300, 300,
460 pager, 0, GetModuleHandleA(0), 0);
461
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
471 ok_sequence(sequences, PAGER_SEQ_INDEX, switch_child_seq, "switch to invisible child", FALSE);
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 ok(!IsWindowVisible(child2_wnd), "Child window 2 is visible\n");
476
479 ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "switch to visible child", FALSE);
480 GetWindowRect(pager, &rect);
481 ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
482 "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
483
485 SendMessageA( pager, PGM_SETPOS, 0, 10 );
487 GetWindowRect( pager, &rect );
488 ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
489 "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
490
492 SendMessageA( pager, PGM_SETPOS, 0, 10 );
494
496 SendMessageA( pager, PGM_SETPOS, 0, 9 );
498
499 DestroyWindow( pager );
500
501 /* Test if resizing works */
503 ok(pager != NULL, "failed to create pager control\n");
504
505 GetWindowRect( pager, &rect );
506 MoveWindow( pager, 0, 0, 200, 100, TRUE );
507 GetWindowRect( pager, &rect2 );
508 ok(rect2.right - rect2.left > rect.right - rect.left, "expected pager window to resize, %s\n",
510
511 DestroyWindow( pager );
512
514 ok(pager != NULL, "failed to create pager control\n");
515
516 GetWindowRect( pager, &rect );
517 MoveWindow( pager, 0, 0, 100, 200, TRUE );
518 GetWindowRect( pager, &rect2 );
519 ok(rect2.bottom - rect2.top > rect.bottom - rect.top, "expected pager window to resize, %s\n",
521
522 DestroyWindow( pager );
523}
#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:97
RECT rect2
Definition: edittest.c:51
static const struct message set_child_seq[]
Definition: pager.c:224
static const struct message set_pos_seq[]
Definition: pager.c:256
static const struct message switch_child_seq[]
Definition: pager.c:242
static HWND create_pager_control(DWORD style)
Definition: pager.c:387
static BOOL register_child_wnd_class(void)
Definition: pager.c:430
static const struct message set_pos_empty_seq[]
Definition: pager.c:280
#define PGM_SETPOS
Definition: commctrl.h:4537
#define PGM_SETCHILD
Definition: commctrl.h:4516
#define CCS_NORESIZE
Definition: commctrl.h:2245
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 1170 of file pager.c.

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

◆ test_wm_notify_comboboxex()

static void test_wm_notify_comboboxex ( HWND  pager)
static

Definition at line 1060 of file pager.c.

1061{
1062 static NMCBEDRAGBEGINW nmcbedb;
1063 static NMCBEENDEDITW nmcbeed;
1064
1065 /* CBEN_DRAGBEGIN */
1066 memset(&nmcbedb, 0, sizeof(nmcbedb));
1067 memcpy(nmcbedb.szText, test_w, sizeof(test_w));
1069 ok(!lstrcmpW(nmcbedb.szText, test_w), "Expect %s, got %s\n", wine_dbgstr_w(test_w), wine_dbgstr_w(nmcbedb.szText));
1070
1071 /* CBEN_ENDEDIT */
1072 memset(&nmcbeed, 0, sizeof(nmcbeed));
1073 memcpy(nmcbeed.szText, test_w, sizeof(test_w));
1074 send_notify(pager, CBEN_ENDEDITW, CBEN_ENDEDITA, (LPARAM)&nmcbeed, FALSE);
1075 ok(!lstrcmpW(nmcbeed.szText, test_w), "Expect %s, got %s\n", wine_dbgstr_w(test_w), wine_dbgstr_w(nmcbeed.szText));
1076}
#define CBEN_ENDEDITW
Definition: commctrl.h:3876
#define CBEN_DRAGBEGINW
Definition: commctrl.h:3881
WCHAR szText[CBEMAXSTRLEN]
Definition: commctrl.h:3897
WCHAR szText[CBEMAXSTRLEN]
Definition: commctrl.h:3914

◆ test_wm_notify_datetime()

static void test_wm_notify_datetime ( HWND  pager)
static

Definition at line 1078 of file pager.c.

1079{
1080 const struct notify_test_datetime_format *data;
1081 NMDATETIMEFORMATW nmdtf;
1082 INT i;
1083
1084 for (i = 0; i < ARRAY_SIZE(test_datetime_format_data); i++)
1085 {
1088
1089 memset(&nmdtf, 0, sizeof(nmdtf));
1090 if(data->send_pszformat) nmdtf.pszFormat = data->send_pszformat;
1091 nmdtf.pszDisplay = nmdtf.szDisplay;
1092 send_notify(pager, DTN_FORMATW, DTN_FORMATA, (LPARAM)&nmdtf, TRUE);
1093 if (data->return_szdisplay)
1094 ok(!lstrcmpW(nmdtf.szDisplay, data->return_szdisplay), "Sub test %d expect %s, got %s\n", i,
1095 wine_dbgstr_w(data->return_szdisplay), wine_dbgstr_w(nmdtf.szDisplay));
1096 if (data->return_pszdisplay)
1097 ok(!lstrcmpW(nmdtf.pszDisplay, data->return_pszdisplay), "Sub test %d expect %s, got %s\n", i,
1098 wine_dbgstr_w(data->return_pszdisplay), wine_dbgstr_w(nmdtf.pszDisplay));
1099 }
1100}
#define DTN_FORMATW
Definition: commctrl.h:4414
WCHAR szDisplay[64]
Definition: commctrl.h:4428

◆ test_wm_notify_header()

static void test_wm_notify_header ( HWND  pager)
static

Definition at line 1102 of file pager.c.

1103{
1104 NMHEADERW nmh = {{0}};
1105 HDITEMW hdi = {0};
1106 HD_TEXTFILTERW hdtf = {0};
1107
1108 hdi.mask = HDI_TEXT | HDI_FILTER;
1109 hdi.pszText = test_w;
1110 hdtf.pszText = test_w;
1111 nmh.pitem = &hdi;
1112 nmh.pitem->pvFilter = &hdtf;
1129 send_notify(pager, HDN_TRACKW, HDN_TRACKA, (LPARAM)&nmh, TRUE);
1130}
#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 1132 of file pager.c.

1133{
1134 NMTTDISPINFOW nmttdi;
1135 const struct notify_test_tooltip *data;
1136 INT i;
1137
1138 for (i = 0; i < ARRAY_SIZE(test_tooltip_data); i++)
1139 {
1142
1143 memset(&nmttdi, 0, sizeof(nmttdi));
1144 if (data->send_sztext) memcpy(nmttdi.szText, data->send_sztext, data->send_sztext_size);
1145 if (data->send_lpsztext) nmttdi.lpszText = data->send_lpsztext;
1147 if (data->return_sztext)
1148 {
1149 if (data->return_sztext_size == -1)
1150 ok(!lstrcmpW(nmttdi.szText, data->return_sztext), "Sub test %d expect %s, got %s\n", i,
1151 wine_dbgstr_w(data->return_sztext), wine_dbgstr_w(nmttdi.szText));
1152 else
1153 ok(!memcmp(nmttdi.szText, data->return_sztext, data->return_sztext_size), "Wrong szText content\n");
1154 }
1155 if (data->return_lpsztext)
1156 {
1157 if (IS_INTRESOURCE(data->return_lpsztext))
1158 ok(nmttdi.lpszText == data->return_lpsztext, "Sub test %d expect %s, got %s\n", i,
1159 wine_dbgstr_w(data->return_lpsztext), wine_dbgstr_w(nmttdi.lpszText));
1160 else
1161 ok(!lstrcmpW(nmttdi.lpszText, data->return_lpsztext), "Test %d expect %s, got %s\n", i,
1162 wine_dbgstr_w(data->return_lpsztext), wine_dbgstr_w(nmttdi.lpszText));
1163 }
1164 if (data->return_hinst)
1165 ok(nmttdi.hinst == data->return_hinst, "Sub test %d expect %p, got %p\n", i, data->return_hinst,
1166 nmttdi.hinst);
1167 }
1168}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TTN_GETDISPINFOW
Definition: commctrl.h:1873
HINSTANCE hinst
Definition: commctrl.h:1908
WCHAR szText[80]
Definition: commctrl.h:1907
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

◆ test_wm_notifyformat()

static void test_wm_notifyformat ( void  )
static

Definition at line 557 of file pager.c.

558{
559 static const WCHAR class_w[] = {'P', 'a', 'g', 'e', 'r', ' ', 'n', 'o', 't', 'i', 'f', 'y', 'f',
560 'o', 'r', 'm', 'a', 't', ' ', 'c', 'l', 'a', 's', 's', 0};
561 static const WCHAR parent_w[] = {'p', 'a', 'r', 'e', 'n', 't', 0};
562 static const WCHAR pager_w[] = {'p', 'a', 'g', 'e', 'r', 0};
563 static const WCHAR child_w[] = {'c', 'h', 'i', 'l', 'd', 0};
564 static const INT formats[] = {NFR_UNICODE, NFR_ANSI};
565 HWND parent, pager, child;
566 LRESULT ret;
567 BOOL bret;
568 INT i;
569
571 ok(bret, "Register test class failed, error 0x%08x\n", GetLastError());
572
573 for (i = 0; i < ARRAY_SIZE(formats); i++)
574 {
576 parent = CreateWindowW(class_w, parent_w, WS_OVERLAPPED, 0, 0, 100, 100, 0, 0, GetModuleHandleW(0), 0);
577 ok(parent != NULL, "CreateWindow failed\n");
578 pager = CreateWindowW(WC_PAGESCROLLERW, pager_w, WS_CHILD, 0, 0, 100, 100, parent, 0, GetModuleHandleW(0), 0);
579 ok(pager != NULL, "CreateWindow failed\n");
580 child = CreateWindowW(class_w, child_w, WS_CHILD, 0, 0, 100, 100, pager, 0, GetModuleHandleW(0), 0);
581 ok(child != NULL, "CreateWindow failed\n");
583
584 /* Test parent */
586 ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent, NF_REQUERY);
587 ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
588 ok(notify_query_received, "Didn't receive notify\n");
589
590 /* Send NF_QUERY directly to parent */
592 ret = SendMessageW(parent, WM_NOTIFYFORMAT, (WPARAM)pager, NF_QUERY);
593 ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
594 ok(notify_query_received, "Didn't receive notify\n");
595
596 /* Pager send notifications to its parent regardless of wParam */
598 ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent_wnd, NF_REQUERY);
599 ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
600 ok(notify_query_received, "Didn't receive notify\n");
601
602 /* Pager always wants Unicode notifications from children */
603 ret = SendMessageW(child, WM_NOTIFYFORMAT, (WPARAM)pager, NF_REQUERY);
604 ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
605 ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)child, NF_QUERY);
606 ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
607
609 }
610
612}
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:545
#define WC_PAGESCROLLERW
Definition: commctrl.h:4497
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Variable Documentation

◆ buffer

WCHAR buffer[64]
static

Definition at line 60 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 220 of file pager.c.

◆ empty_a

CHAR empty_a[] = {0}
static

Definition at line 38 of file pager.c.

Referenced by notify_generic_text_handler().

◆ empty_w

WCHAR empty_w[] = {0}
static

Definition at line 37 of file pager.c.

◆ large_a

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

Definition at line 39 of file pager.c.

◆ large_truncated_65_w

WCHAR large_truncated_65_w[65]
static
Initial value:
=
{
'Y', 'o', 'u', ' ', 's', 'h', 'o', 'u', 'l', 'd', ' ', 'h', 'a', 'v', 'e', ' ', 'r', 'e', 'c', 'e', 'i', 'v',
'e', 'd', ' ', 'a', ' ', 'c', 'o', 'p', 'y', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'G', 'N', 'U', ' ', 'L',
'e', 's', 's', 'e', 'r', ' ', 'G', 'e', 'n', 'e', 'r', 'a', 'l', ' ', 'P', 'u', 'b', 'l', 'i', 'c', 0
}

Definition at line 47 of file pager.c.

◆ large_truncated_80_w

WCHAR large_truncated_80_w[80]
static
Initial value:
=
{
'Y', 'o', 'u', ' ', 's', 'h', 'o', 'u', 'l', 'd', ' ', 'h', 'a', 'v', 'e', ' ', 'r', 'e', 'c', 'e',
'i', 'v', 'e', 'd', ' ', 'a', ' ', 'c', 'o', 'p', 'y', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'G',
'N', 'U', ' ', 'L', 'e', 's', 's', 'e', 'r', ' ', 'G', 'e', 'n', 'e', 'r', 'a', 'l', ' ', 'P', 'u',
'b', 'l', 'i', 'c', ' ', 'L', 'i', 'c', 'e', 'n', 's', 'e', ' ', 'a', 'l', 'o', 'n', 'g', ' ', 'w'
}

Definition at line 53 of file pager.c.

◆ large_w

WCHAR large_w[]
static
Initial value:
=
{
'Y', 'o', 'u', ' ', 's', 'h', 'o', 'u', 'l', 'd', ' ', 'h', 'a', 'v', 'e', ' ', 'r', 'e', 'c', 'e', 'i', 'v', 'e',
'd', ' ', 'a', ' ', 'c', 'o', 'p', 'y', ' ', 'o', 'f', ' ', 't', 'h', 'e', ' ', 'G', 'N', 'U', ' ', 'L', 'e', 's',
's', 'e', 'r', ' ', 'G', 'e', 'n', 'e', 'r', 'a', 'l', ' ', 'P', 'u', 'b', 'l', 'i', 'c', ' ', 'L', 'i', 'c', 'e',
'n', 's', 'e', ' ', 'a', 'l', 'o', 'n', 'g', ' ', 'w', 'i', 't', 'h', ' ', 't', 'h', 'i', 's', ' ', '.', '.', '.', 0
}

Definition at line 40 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 222 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:1661
#define WM_CHILDACTIVATE
Definition: winuser.h:1638
#define WM_SIZE
Definition: winuser.h:1611
#define WM_NCCALCSIZE
Definition: winuser.h:1685
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1662

Definition at line 224 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 280 of file pager.c.

Referenced by test_pager().

◆ set_pos_seq

const struct message set_pos_seq[]
static
Initial value:

Definition at line 256 of file pager.c.

Referenced by test_pager().

◆ SUBCLASSPROC

SUBCLASSPROC

Definition at line 220 of file pager.c.

◆ switch_child_seq

const struct message switch_child_seq[]
static
Initial value:

Definition at line 242 of file pager.c.

Referenced by test_pager().

◆ te_a

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

Definition at line 36 of file pager.c.

◆ test_a

CHAR test_a[] = {'t', 'e', 's', 't', 0}
static

Definition at line 34 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:
=
{
{empty_w, sizeof(empty_w), ARRAY_SIZE(buffer), empty_a, 0, 0, 1, empty_w, 1},
}
static CHAR large_a[]
Definition: pager.c:39
static WCHAR empty_w[]
Definition: pager.c:37
static WCHAR large_truncated_65_w[65]
Definition: pager.c:47

Definition at line 146 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 136 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, empty_w, -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 CHAR te_a[]
Definition: pager.c:36
static WCHAR large_w[]
Definition: pager.c:40

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:

Definition at line 155 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 141 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, empty_w, -1, empty_w},
{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, empty_w, -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)},
}
static WCHAR large_truncated_80_w[80]
Definition: pager.c:53
HANDLE HMODULE
Definition: typedefs.h:77

Referenced by notify_tooltip_handler(), and test_wm_notify_tooltip().

◆ test_w

WCHAR test_w[] = {'t', 'e', 's', 't', 0}
static

◆ UINT_PTR

Definition at line 220 of file pager.c.