ReactOS 0.4.16-dev-329-g9223134
propsheet.c
Go to the documentation of this file.
1/* Unit test suite for property sheet control.
2 *
3 * Copyright 2006 Huw Davies
4 * Copyright 2009 Jan de Mooij
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <windows.h>
22#include <commctrl.h>
23#include "msg.h"
24
25#include "resources.h"
26#include "wine/test.h"
27
28#ifdef __REACTOS__
29#undef WC_DIALOG
30#define WC_DIALOG (MAKEINTATOM(0x8002))
31#endif
32
35
36static BOOL rtl;
37static LONG active_page = -1;
38
39#define IDC_APPLY_BUTTON 12321
40
41static HPROPSHEETPAGE (WINAPI *pCreatePropertySheetPageA)(const PROPSHEETPAGEA *desc);
43static BOOL (WINAPI *pDestroyPropertySheetPage)(HPROPSHEETPAGE proppage);
44static INT_PTR (WINAPI *pPropertySheetA)(const PROPSHEETHEADERA *header);
45
46static void detect_locale(void)
47{
48 DWORD reading_layout;
50 (void *)&reading_layout, sizeof(reading_layout)) && reading_layout == 1;
51}
52
53/* try to make sure pending X events have been processed before continuing */
54static void flush_events(void)
55{
56 MSG msg;
57 int diff = 200;
58 int min_timeout = 100;
59 DWORD time = GetTickCount() + diff;
60
61 while (diff > 0)
62 {
63 if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
64 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
65 diff = time - GetTickCount();
66 }
67}
68
69
71{
72 switch(msg)
73 {
74 case PSCB_PRECREATE:
75 {
76 HMODULE module = GetModuleHandleA("comctl32.dll");
78 HRSRC hrsrc;
79
80 hrsrc = FindResourceA(module, MAKEINTRESOURCEA(1006 /* IDD_PROPSHEET */),
82 size = SizeofResource(module, hrsrc);
83 ok(size != 0, "Failed to get size of propsheet dialog resource\n");
85 ok(buffer_size == 2 * size, "Unexpected template buffer size %u, resource size %u\n",
87 break;
88 }
90 {
91 char caption[256];
92 GetWindowTextA(hwnd, caption, sizeof(caption));
93 ok(!strcmp(caption,"test caption"), "caption: %s\n", caption);
95 return 0;
96 }
97 }
98 return 0;
99}
100
103{
104 switch(msg)
105 {
106 case WM_INITDIALOG:
107 {
108 HWND sheet = GetParent(hwnd);
109 char caption[256];
110 GetWindowTextA(sheet, caption, sizeof(caption));
111 ok(!strcmp(caption,"test caption"), "caption: %s\n", caption);
112 return TRUE;
113 }
114
115 case WM_NOTIFY:
116 {
117 NMHDR *nmhdr = (NMHDR *)lparam;
118 switch(nmhdr->code)
119 {
120 case PSN_APPLY:
121 return TRUE;
122 default:
123 return FALSE;
124 }
125 }
126 case WM_NCDESTROY:
127 ok(!SendMessageA(sheethwnd, PSM_INDEXTOHWND, 400, 0),"Should always be 0\n");
128 return TRUE;
129
130 default:
131 return FALSE;
132 }
133}
134
135static void test_title(void)
136{
137 HPROPSHEETPAGE hpsp[1];
138 PROPSHEETPAGEA psp;
140 HWND hdlg;
141 DWORD style;
142
143 memset(&psp, 0, sizeof(psp));
144 psp.dwSize = sizeof(psp);
145 psp.dwFlags = 0;
147 U(psp).pszTemplate = "prop_page1";
148 U2(psp).pszIcon = NULL;
150 psp.lParam = 0;
151
152 hpsp[0] = pCreatePropertySheetPageA(&psp);
153
154 memset(&psh, 0, sizeof(psh));
157 psh.pszCaption = "test caption";
158 psh.nPages = 1;
160 U3(psh).phpage = hpsp;
162
163 hdlg = (HWND)pPropertySheetA(&psh);
164 ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle value %p\n", hdlg);
165
169 "got unexpected style: %x\n", style);
170
171 DestroyWindow(hdlg);
172}
173
174static void test_nopage(void)
175{
176 HPROPSHEETPAGE hpsp[1];
177 PROPSHEETPAGEA psp;
179 HWND hdlg, hpage;
180 MSG msg;
181
182 memset(&psp, 0, sizeof(psp));
183 psp.dwSize = sizeof(psp);
184 psp.dwFlags = 0;
186 U(psp).pszTemplate = "prop_page1";
187 U2(psp).pszIcon = NULL;
189 psp.lParam = 0;
190
191 hpsp[0] = pCreatePropertySheetPageA(&psp);
192
193 memset(&psh, 0, sizeof(psh));
196 psh.pszCaption = "test caption";
197 psh.nPages = 1;
199 U3(psh).phpage = hpsp;
201
202 hdlg = (HWND)pPropertySheetA(&psh);
203 ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle value %p\n", hdlg);
204
205 ShowWindow(hdlg,SW_NORMAL);
206 SendMessageA(hdlg, PSM_REMOVEPAGE, 0, 0);
207 hpage = /* PropSheet_GetCurrentPageHwnd(hdlg); */
209 active_page = /* PropSheet_HwndToIndex(hdlg, hpage)); */
210 (int)SendMessageA(hdlg, PSM_HWNDTOINDEX, (WPARAM)hpage, 0);
211 ok(hpage == NULL, "expected no current page, got %p, index=%d\n", hpage, active_page);
212 flush_events();
214
215 /* Check that the property sheet was fully redrawn */
217 "expected no pending WM_PAINT messages\n");
218 DestroyWindow(hdlg);
219}
220
222{
223 switch(msg)
224 {
225 case PSCB_INITIALIZED:
226 {
227 ok(IsWindowEnabled(parenthwnd) == 0, "parent window should be disabled\n");
229 return FALSE;
230 }
231 }
232 return FALSE;
233}
234
236{
237 WNDCLASSA cls;
238
239 cls.style = 0;
241 cls.cbClsExtra = 0;
242 cls.cbWndExtra = 0;
244 cls.hIcon = 0;
247 cls.lpszMenuName = NULL;
248 cls.lpszClassName = "parent class";
249 RegisterClassA(&cls);
250}
251
252static void test_disableowner(void)
253{
254 HPROPSHEETPAGE hpsp[1];
255 PROPSHEETPAGEA psp;
257 INT_PTR p;
258
260 parenthwnd = CreateWindowA("parent class", "", WS_CAPTION | WS_SYSMENU | WS_VISIBLE, 100, 100, 100, 100, GetDesktopWindow(), NULL, GetModuleHandleA(NULL), 0);
261
262 memset(&psp, 0, sizeof(psp));
263 psp.dwSize = sizeof(psp);
264 psp.dwFlags = 0;
266 U(psp).pszTemplate = "prop_page1";
267 U2(psp).pszIcon = NULL;
268 psp.pfnDlgProc = NULL;
269 psp.lParam = 0;
270
271 hpsp[0] = pCreatePropertySheetPageA(&psp);
272
273 memset(&psh, 0, sizeof(psh));
276 psh.pszCaption = "test caption";
277 psh.nPages = 1;
279 U3(psh).phpage = hpsp;
281
282 p = pPropertySheetA(&psh);
283 ok(p == 0, "Expected 0, got %ld\n", p);
284 ok(IsWindowEnabled(parenthwnd) != 0, "parent window should be enabled\n");
286}
287
289{
290 switch(msg){
291 case WM_NOTIFY:
292 {
294 switch(hdr->code){
295 case PSN_SETACTIVE:
296 active_page = /* PropSheet_HwndToIndex(hdr->hwndFrom, hwnd); */
297 (int)SendMessageA(hdr->hwndFrom, PSM_HWNDTOINDEX, (WPARAM)hwnd, 0);
298 return TRUE;
299 case PSN_KILLACTIVE:
300 /* prevent navigation away from the fourth page */
301 if(active_page == 3){
303 return TRUE;
304 }
305 }
306 break;
307 }
308 }
309 return FALSE;
310}
311
313
315{
316 switch (msg)
317 {
318 case DM_SETDEFID:
319 ok( IsWindowEnabled( GetDlgItem(hwnd, wp) ), "button is not enabled\n" );
320 break;
321 }
322 return CallWindowProcW( old_nav_dialog_proc, hwnd, msg, wp, lp );
323}
324
326{
327 static BOOL done;
328 if (code == HCBT_CREATEWND)
329 {
331
332 /* The first dialog created will be the parent dialog */
333 if (!done && c->lpcs->lpszClass == (LPWSTR)WC_DIALOG)
334 {
336 done = TRUE;
337 }
338 }
339
340 return CallNextHookEx( NULL, code, wp, lp );
341}
342
343static void test_wiznavigation(void)
344{
345 HPROPSHEETPAGE hpsp[4];
346 PROPSHEETPAGEA psp[4];
348 HWND hdlg, control;
349 LONG_PTR controlID;
350 DWORD style;
351 LRESULT defidres;
352 BOOL hwndtoindex_supported = TRUE;
353 const INT nextID = 12324;
354 const INT backID = 12323;
355 HHOOK hook;
356
357 /* set up a hook proc in order to subclass the main dialog early on */
359
360 /* create the property sheet pages */
361 memset(psp, 0, sizeof(PROPSHEETPAGEA) * 4);
362
363 psp[0].dwSize = sizeof(PROPSHEETPAGEA);
365 U(psp[0]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_INTRO);
366 psp[0].pfnDlgProc = nav_page_proc;
367 hpsp[0] = pCreatePropertySheetPageA(&psp[0]);
368
369 psp[1].dwSize = sizeof(PROPSHEETPAGEA);
371 U(psp[1]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_EDIT);
372 psp[1].pfnDlgProc = nav_page_proc;
373 hpsp[1] = pCreatePropertySheetPageA(&psp[1]);
374
375 psp[2].dwSize = sizeof(PROPSHEETPAGEA);
377 U(psp[2]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_RADIO);
378 psp[2].pfnDlgProc = nav_page_proc;
379 hpsp[2] = pCreatePropertySheetPageA(&psp[2]);
380
381 psp[3].dwSize = sizeof(PROPSHEETPAGEA);
383 U(psp[3]).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_EXIT);
384 psp[3].pfnDlgProc = nav_page_proc;
385 hpsp[3] = pCreatePropertySheetPageA(&psp[3]);
386
387 /* set up the property sheet dialog */
388 memset(&psh, 0, sizeof(psh));
391 psh.pszCaption = "A Wizard";
392 psh.nPages = 4;
394 U3(psh).phpage = hpsp;
395 hdlg = (HWND)pPropertySheetA(&psh);
396 ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
397
398 ok(active_page == 0, "Active page should be 0. Is: %d\n", active_page);
399
403 "got unexpected style: %x\n", style);
404
405 control = GetFocus();
406 controlID = GetWindowLongPtrA(control, GWLP_ID);
407 ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID);
408
409 /* simulate pressing the Next button */
411 if (!active_page) hwndtoindex_supported = FALSE;
412 if (hwndtoindex_supported)
413 ok(active_page == 1, "Active page should be 1 after pressing Next. Is: %d\n", active_page);
414
415 control = GetFocus();
416 controlID = GetWindowLongPtrA(control, GWLP_ID);
417 ok(controlID == IDC_PS_EDIT1, "Focus should be set to the first item on the second page. Expected: %d, Found: %ld\n", IDC_PS_EDIT1, controlID);
418
419 defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
420 ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres));
421
422 /* set the focus to the second edit box on this page */
424
425 /* press next again */
427 if (hwndtoindex_supported)
428 ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page);
429
430 control = GetFocus();
431 controlID = GetWindowLongPtrA(control, GWLP_ID);
432 ok(controlID == IDC_PS_RADIO1, "Focus should have been set to item on third page. Expected: %d, Found %ld\n", IDC_PS_RADIO1, controlID);
433
434 /* back button */
436 if (hwndtoindex_supported)
437 ok(active_page == 1, "Active page should be 1 after pressing Back. Is: %d\n", active_page);
438
439 control = GetFocus();
440 controlID = GetWindowLongPtrA(control, GWLP_ID);
441 ok(controlID == IDC_PS_EDIT1, "Focus should have been set to the first item on second page. Expected: %d, Found %ld\n", IDC_PS_EDIT1, controlID);
442
443 defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
444 ok(defidres == MAKELRESULT(backID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", backID, LOWORD(defidres));
445
446 /* press next twice */
448 if (hwndtoindex_supported)
449 ok(active_page == 2, "Active page should be 2 after pressing Next. Is: %d\n", active_page);
451 if (hwndtoindex_supported)
452 ok(active_page == 3, "Active page should be 3 after pressing Next. Is: %d\n", active_page);
453 else
454 active_page = 3;
455
456 control = GetFocus();
457 controlID = GetWindowLongPtrA(control, GWLP_ID);
458 ok(controlID == nextID, "Focus should have been set to the Next button. Expected: %d, Found: %ld\n", nextID, controlID);
459
460 /* try to navigate away, but shouldn't be able to */
462 ok(active_page == 3, "Active page should still be 3 after pressing Back. Is: %d\n", active_page);
463
464 defidres = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
465 ok(defidres == MAKELRESULT(nextID, DC_HASDEFID), "Expected default button ID to be %d, is %d\n", nextID, LOWORD(defidres));
466
467 DestroyWindow(hdlg);
469}
470
471static void test_buttons(void)
472{
473 HPROPSHEETPAGE hpsp[1];
474 PROPSHEETPAGEA psp;
476 HWND hdlg;
477 HWND button;
478 RECT rc;
479 int prevRight, top;
480
481 memset(&psp, 0, sizeof(psp));
482 psp.dwSize = sizeof(psp);
483 psp.dwFlags = 0;
485 U(psp).pszTemplate = "prop_page1";
486 U2(psp).pszIcon = NULL;
488 psp.lParam = 0;
489
490 hpsp[0] = pCreatePropertySheetPageA(&psp);
491
492 memset(&psh, 0, sizeof(psh));
495 psh.pszCaption = "test caption";
496 psh.nPages = 1;
498 U3(psh).phpage = hpsp;
500
501 hdlg = (HWND)pPropertySheetA(&psh);
502 ok(hdlg != INVALID_HANDLE_VALUE, "got null handle\n");
503
504 /* OK button */
505 button = GetDlgItem(hdlg, IDOK);
506 GetWindowRect(button, &rc);
507 prevRight = rc.right;
508 top = rc.top;
509
510 /* Cancel button */
511 button = GetDlgItem(hdlg, IDCANCEL);
512 GetWindowRect(button, &rc);
513 ok(rc.top == top, "Cancel button should have same top as OK button\n");
514 if (rtl)
515 ok(rc.left < prevRight, "Cancel button should be to the left of OK button\n");
516 else
517 ok(rc.left > prevRight, "Cancel button should be to the right of OK button\n");
518 prevRight = rc.right;
519
521 GetWindowRect(button, &rc);
522 ok(rc.top == top, "Apply button should have same top as OK button\n");
523 if (rtl)
524 ok(rc.left < prevRight, "Apply button should be to the left of Cancel button\n");
525 else
526 ok(rc.left > prevRight, "Apply button should be to the right of Cancel button\n");
527 prevRight = rc.right;
528
529 button = GetDlgItem(hdlg, IDHELP);
530 GetWindowRect(button, &rc);
531 ok(rc.top == top, "Help button should have same top as OK button\n");
532 if (rtl)
533 ok(rc.left < prevRight, "Help button should be to the left of Apply button\n");
534 else
535 ok(rc.left > prevRight, "Help button should be to the right of Apply button\n");
536
537 DestroyWindow(hdlg);
538}
539
541
542static INT_PTR CALLBACK
544{
545 switch (msg)
546 {
547 case WM_COMMAND:
548 switch(LOWORD(wparam))
549 {
551 switch(HIWORD(wparam))
552 {
553 case BN_CLICKED:
555 return TRUE;
556 }
557 break;
558 }
559 break;
560 }
561 return FALSE;
562}
563
565{
566 HWND hdlg, page;
567 PROPSHEETPAGEA psp[1];
569 MSG msg;
571
572 psp[0].dwSize = sizeof (PROPSHEETPAGEA);
573 psp[0].dwFlags = PSP_USETITLE;
576 U2(psp[0]).pszIcon = NULL;
578 psp[0].pszTitle = "Page1";
579 psp[0].lParam = 0;
580
585 U(psh).pszIcon = NULL;
586 psh.pszCaption = "PropertySheet1";
587 psh.nPages = 1;
588 U3(psh).ppsp = psp;
589 U2(psh).nStartPage = 0;
590
591 /* The goal of the test is to make sure that the Add button is pressed
592 * when the ENTER key is pressed and a different control, a combobox,
593 * has the keyboard focus. */
595
596 /* Create the modeless property sheet. */
597 hdlg = (HWND)pPropertySheetA(&psh);
598 ok(hdlg != INVALID_HANDLE_VALUE, "Cannot create the property sheet\n");
599
600 /* Set the Add button as the default button. */
602
603 /* Make sure the default button is the Add button. */
604 result = SendMessageA(hdlg, DM_GETDEFID, 0, 0);
605 ok(DC_HASDEFID == HIWORD(result), "The property sheet does not have a default button\n");
606 ok(IDC_PS_PUSHBUTTON1 == LOWORD(result), "The default button is not the Add button\n");
607
608 /* At this point, the combobox should have keyboard focus, so we press ENTER.
609 * Pull the lever, Kronk! */
612
613 /* Process all the messages in the queue for this thread. */
614 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
615 {
616 /* (!PropSheet_IsDialogMessage(hdlg, &msg)) */
617 if (!((BOOL)SendMessageA(hdlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)&msg)))
618 {
621 }
622 }
623
624 ok(add_button_has_been_pressed, "The Add button has not been pressed!\n");
625
626 DestroyWindow(hdlg);
627}
628
629#define RECEIVER_SHEET_CALLBACK 0
630#define RECEIVER_SHEET_WINPROC 1
631#define RECEIVER_PAGE 2
632
633#define NUM_MSG_SEQUENCES 1
634#define PROPSHEET_SEQ_INDEX 0
635
638
639static const struct message property_sheet_seq[] = {
643 /*{ WM_NCCALCSIZE, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
647 /*{ WM_GETTEXT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
648 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
649 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
650 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
651 { WM_NCCALCSIZE, sent|id|optional, 0, 0, RECEIVER_SHEET_WINPROC },
652 { DM_REPOSITION, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
656 /*{ WM_NCACTIVATE, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
657 { WM_GETTEXT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
658 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
659 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
660 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
661 { WM_GETTEXT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
663 /*{ WM_IME_SETCONTEXT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
664 { WM_IME_NOTIFY, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
667 /*{ WM_IME_SETCONTEXT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
671 /*{ WM_NCCALCSIZE, sent|id, 0, 0, RECEIVER_PAGE },*/
674 { WM_MOVE, sent|id, 0, 0, RECEIVER_PAGE },
675 { WM_SIZE, sent|id, 0, 0, RECEIVER_PAGE },
676 { WM_NOTIFY, sent|id, 0, 0, RECEIVER_PAGE },
677 { WM_STYLECHANGING, sent|id|optional, 0, 0, RECEIVER_SHEET_WINPROC },
678 { WM_STYLECHANGED, sent|id|optional, 0, 0, RECEIVER_SHEET_WINPROC },
679 /*{ WM_GETTEXT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
680 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
681 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
682 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
685 /*{ 0x00000401, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
686 { 0x00000400, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
687 { WM_CHANGEUISTATE, sent|id|optional, 0, 0, RECEIVER_SHEET_WINPROC },
688 { WM_UPDATEUISTATE, sent|id|optional, 0, 0, RECEIVER_SHEET_WINPROC },
689 { WM_UPDATEUISTATE, sent|id|optional, 0, 0, RECEIVER_PAGE },
692 /*{ WM_NCPAINT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
693 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
694 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
695 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
696 { WM_ERASEBKGND, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
699 /*{ WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
700 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
701 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
702 { WM_PAINT, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
703 { WM_PAINT, sent|id, 0, 0, RECEIVER_PAGE },
704 { WM_NCPAINT, sent|id, 0, 0, RECEIVER_PAGE },
705 { WM_ERASEBKGND, sent|id, 0, 0, RECEIVER_PAGE },*/
712 /*{ WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
713 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
714 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
716 { WM_NOTIFY, sent|id|optional, 0, 0, RECEIVER_PAGE },
717 { WM_NOTIFY, sent|id|optional, 0, 0, RECEIVER_PAGE },
720 /*{ WM_NCACTIVATE, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
721 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
722 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
723 { WM_GETICON, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
724 /*{ WM_ACTIVATE, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
725 { WM_ACTIVATE, sent|id, 0, 0, RECEIVER_PAGE },
726 { WM_ACTIVATEAPP, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
727 { WM_ACTIVATEAPP, sent|id, 0, 0, RECEIVER_PAGE },
728 { WM_DESTROY, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },
729 { WM_DESTROY, sent|id, 0, 0, RECEIVER_PAGE },*/
730 /*{ WM_NCDESTROY, sent|id, 0, 0, RECEIVER_PAGE },
731 { WM_NCDESTROY, sent|id, 0, 0, RECEIVER_SHEET_WINPROC },*/
732 { 0 }
733};
734
736{
737 struct message msg = { 0 };
738
739 if (message < WM_USER &&
740 message != WM_GETICON &&
741 message != WM_GETTEXT &&
744 message != WM_PAINT &&
747 (message < WM_NCCREATE || message > WM_NCMBUTTONDBLCLK) &&
748 (message < WM_MOUSEFIRST || message > WM_MOUSEHWHEEL) &&
749 message != 0x90)
750 {
751 msg.message = message;
752 msg.flags = sent|wparam|lparam|id;
753 msg.wParam = wParam;
754 msg.lParam = lParam;
755 msg.id = receiver;
757 }
758}
759
761{
763
765}
766
768{
770
771 switch (msg)
772 {
773 case PSCB_INITIALIZED:
776 return TRUE;
777 }
778
779 return TRUE;
780}
781
784{
786
787 return FALSE;
788}
789
790static void test_messages(void)
791{
792 HPROPSHEETPAGE hpsp[1];
793 PROPSHEETPAGEA psp;
795 HWND hdlg;
796
798
799 memset(&psp, 0, sizeof(psp));
800 psp.dwSize = sizeof(psp);
801 psp.dwFlags = 0;
804 U2(psp).pszIcon = NULL;
806 psp.lParam = 0;
807
808 hpsp[0] = pCreatePropertySheetPageA(&psp);
809
810 memset(&psh, 0, sizeof(psh));
814 psh.pszCaption = "test caption";
815 psh.nPages = 1;
817 U3(psh).phpage = hpsp;
819
820 hdlg = (HWND)pPropertySheetA(&psh);
821 ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
822
823 ShowWindow(hdlg,SW_NORMAL);
824
825 ok_sequence(sequences, PROPSHEET_SEQ_INDEX, property_sheet_seq, "property sheet with custom window proc", TRUE);
826
827 DestroyWindow(hdlg);
828}
829
830static void test_PSM_ADDPAGE(void)
831{
832 HPROPSHEETPAGE hpsp[5];
833 PROPSHEETPAGEA psp;
835 HWND hdlg, tab;
836 BOOL ret;
837 DWORD r;
838
839 memset(&psp, 0, sizeof(psp));
840 psp.dwSize = sizeof(psp);
841 psp.dwFlags = 0;
844 U2(psp).pszIcon = NULL;
846 psp.lParam = 0;
847
848 /* multiple pages with the same data */
849 hpsp[0] = pCreatePropertySheetPageA(&psp);
850 hpsp[1] = pCreatePropertySheetPageA(&psp);
851 hpsp[2] = pCreatePropertySheetPageA(&psp);
852
853 U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR);
854 hpsp[3] = pCreatePropertySheetPageA(&psp);
855
857 hpsp[4] = pCreatePropertySheetPageA(&psp);
858
859 memset(&psh, 0, sizeof(psh));
861 psh.dwFlags = PSH_MODELESS;
862 psh.pszCaption = "test caption";
863 psh.nPages = 1;
865 U3(psh).phpage = hpsp;
866
867 hdlg = (HWND)pPropertySheetA(&psh);
868 ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
869
870 /* add pages one by one */
871 ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[1]);
872 ok(ret == TRUE, "got %d\n", ret);
873
874 /* try with null and invalid value */
875 ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, 0);
876 ok(ret == FALSE, "got %d\n", ret);
877
878if (0)
879{
880 /* crashes on native */
882}
883 /* check item count */
884 tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
885
886 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
887 ok(r == 2, "got %d\n", r);
888
889 ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[2]);
890 ok(ret == TRUE, "got %d\n", ret);
891
892 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
893 ok(r == 3, "got %d\n", r);
894
895 /* add property sheet page that can't be created */
896 ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[3]);
897 ok(ret == TRUE, "got %d\n", ret);
898
899 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
900 ok(r == 4, "got %d\n", r);
901
902 /* select page that can't be created */
903 ret = SendMessageA(hdlg, PSM_SETCURSEL, 3, 1);
904 ok(ret == TRUE, "got %d\n", ret);
905
906 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
907 ok(r == 3, "got %d\n", r);
908
909 /* test PSP_PREMATURE flag with incorrect property sheet page */
910 ret = SendMessageA(hdlg, PSM_ADDPAGE, 0, (LPARAM)hpsp[4]);
911 ok(ret == FALSE, "got %d\n", ret);
912
913 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
914 ok(r == 3, "got %d\n", r);
915
916 pDestroyPropertySheetPage(hpsp[4]);
917 DestroyWindow(hdlg);
918}
919
920static void test_PSM_INSERTPAGE(void)
921{
922 HPROPSHEETPAGE hpsp[5];
923 PROPSHEETPAGEA psp;
925 HWND hdlg, tab;
926 BOOL ret;
927 DWORD r;
928
929 memset(&psp, 0, sizeof(psp));
930 psp.dwSize = sizeof(psp);
931 psp.dwFlags = 0;
934 U2(psp).pszIcon = NULL;
936 psp.lParam = 0;
937
938 /* multiple pages with the same data */
939 hpsp[0] = pCreatePropertySheetPageA(&psp);
940 hpsp[1] = pCreatePropertySheetPageA(&psp);
941 hpsp[2] = pCreatePropertySheetPageA(&psp);
942
943 U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR);
944 hpsp[3] = pCreatePropertySheetPageA(&psp);
945
947 hpsp[4] = pCreatePropertySheetPageA(&psp);
948
949 memset(&psh, 0, sizeof(psh));
951 psh.dwFlags = PSH_MODELESS;
952 psh.pszCaption = "test caption";
953 psh.nPages = 1;
955 U3(psh).phpage = hpsp;
956
957 hdlg = (HWND)pPropertySheetA(&psh);
958 ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
959
960 /* add pages one by one */
961 ret = SendMessageA(hdlg, PSM_INSERTPAGE, 5, (LPARAM)hpsp[1]);
962 ok(ret == TRUE, "got %d\n", ret);
963
964 /* try with invalid values */
965 ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, 0);
966 ok(ret == FALSE, "got %d\n", ret);
967
968if (0)
969{
970 /* crashes on native */
971 ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)INVALID_HANDLE_VALUE);
972}
973
974 ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)INVALID_HANDLE_VALUE, (LPARAM)hpsp[2]);
975 ok(ret == FALSE, "got %d\n", ret);
976
977 /* check item count */
978 tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
979
980 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
981 ok(r == 2, "got %d\n", r);
982
983 ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
984 ok(ret == TRUE, "got %d\n", ret);
985
986 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
987 ok(r == 3, "got %d\n", r);
988
989 /* add property sheet page that can't be created */
990 ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
991 ok(ret == TRUE, "got %d\n", ret);
992
993 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
994 ok(r == 4, "got %d\n", r);
995
996 /* select page that can't be created */
997 ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
998 ok(ret == TRUE, "got %d\n", ret);
999
1000 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
1001 ok(r == 3, "got %d\n", r);
1002
1003 /* test PSP_PREMATURE flag with incorrect property sheet page */
1004 ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
1005 ok(ret == FALSE, "got %d\n", ret);
1006
1007 r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
1008 ok(r == 3, "got %d\n", r);
1009
1010 pDestroyPropertySheetPage(hpsp[4]);
1011 DestroyWindow(hdlg);
1012}
1013
1015{
1016 union
1017 {
1020 } u;
1021 unsigned int addref_called;
1022 unsigned int release_called;
1023};
1024
1026{
1027 struct custom_proppage *cpage = (struct custom_proppage *)psp->lParam;
1028 PROPSHEETPAGEA *psp_orig = &cpage->u.pageA;
1029
1030 ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd);
1031
1032 ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n",
1033 psp->lParam, psp);
1034 ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n");
1035 ok(!lstrcmpA(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n");
1036
1037 switch (msg)
1038 {
1039 case PSPCB_ADDREF:
1040 ok(psp->dwSize > PROPSHEETPAGEA_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize);
1041 cpage->addref_called++;
1042 break;
1043 case PSPCB_RELEASE:
1044 ok(psp->dwSize >= PROPSHEETPAGEA_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize);
1045 cpage->release_called++;
1046 break;
1047 default:
1048 ok(0, "Unexpected message %u\n", msg);
1049 }
1050
1051 return 1;
1052}
1053
1055{
1056 struct custom_proppage *cpage = (struct custom_proppage *)psp->lParam;
1057 PROPSHEETPAGEW *psp_orig = &cpage->u.pageW;
1058
1059 ok(hwnd == NULL, "Expected NULL hwnd, got %p\n", hwnd);
1060 ok(psp->lParam && psp->lParam != (LPARAM)psp, "Expected newly allocated page description, got %lx, %p\n",
1061 psp->lParam, psp);
1062 ok(psp_orig->pszTitle == psp->pszTitle, "Expected same page title pointer\n");
1063 ok(!lstrcmpW(psp_orig->pszTitle, psp->pszTitle), "Expected same page title string\n");
1064
1065 switch (msg)
1066 {
1067 case PSPCB_ADDREF:
1068 ok(psp->dwSize > PROPSHEETPAGEW_V1_SIZE, "Expected ADDREF for V2+ only, got size %u\n", psp->dwSize);
1069 cpage->addref_called++;
1070 break;
1071 case PSPCB_RELEASE:
1072 ok(psp->dwSize >= PROPSHEETPAGEW_V1_SIZE, "Unexpected RELEASE, got size %u\n", psp->dwSize);
1073 cpage->release_called++;
1074 break;
1075 default:
1076 ok(0, "Unexpected message %u\n", msg);
1077 }
1078
1079 return 1;
1080}
1081
1083{
1084 static const WCHAR titleW[] = {'T','i','t','l','e',0};
1085 struct custom_proppage page;
1086 HPROPSHEETPAGE hpsp;
1087 BOOL ret;
1088
1089 memset(&page.u.pageA, 0, sizeof(page.u.pageA));
1090 page.u.pageA.dwFlags = PSP_USECALLBACK;
1091 page.u.pageA.pfnDlgProc = page_dlg_proc_messages;
1092 page.u.pageA.pfnCallback = proppage_callback_a;
1093 page.u.pageA.lParam = (LPARAM)&page;
1094 page.u.pageA.pszTitle = "Title";
1095
1096 /* Only minimal size validation is performed */
1097 for (page.u.pageA.dwSize = PROPSHEETPAGEA_V1_SIZE - 1; page.u.pageA.dwSize <= PROPSHEETPAGEA_V4_SIZE + 1; page.u.pageA.dwSize++)
1098 {
1099 page.addref_called = 0;
1100 hpsp = pCreatePropertySheetPageA(&page.u.pageA);
1101
1102 if (page.u.pageA.dwSize < PROPSHEETPAGEA_V1_SIZE)
1103 ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageA.dwSize);
1104 else
1105 {
1106 ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageA.dwSize);
1107 ok(page.addref_called == (page.u.pageA.dwSize > PROPSHEETPAGEA_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n");
1108 }
1109
1110 if (hpsp)
1111 {
1112 page.release_called = 0;
1113 ret = pDestroyPropertySheetPage(hpsp);
1114 ok(ret, "Failed to destroy a page\n");
1115 ok(page.release_called == 1, "Expected RELEASE callback message\n");
1116 }
1117 }
1118
1119 memset(&page.u.pageW, 0, sizeof(page.u.pageW));
1120 page.u.pageW.dwFlags = PSP_USECALLBACK;
1121 page.u.pageW.pfnDlgProc = page_dlg_proc_messages;
1122 page.u.pageW.pfnCallback = proppage_callback_w;
1123 page.u.pageW.lParam = (LPARAM)&page;
1124 page.u.pageW.pszTitle = titleW;
1125
1126 for (page.u.pageW.dwSize = PROPSHEETPAGEW_V1_SIZE - 1; page.u.pageW.dwSize <= PROPSHEETPAGEW_V4_SIZE + 1; page.u.pageW.dwSize++)
1127 {
1128 page.addref_called = 0;
1129 hpsp = pCreatePropertySheetPageW(&page.u.pageW);
1130
1131 if (page.u.pageW.dwSize < PROPSHEETPAGEW_V1_SIZE)
1132 ok(hpsp == NULL, "Expected failure, size %u\n", page.u.pageW.dwSize);
1133 else
1134 {
1135 ok(hpsp != NULL, "Failed to create a page, size %u\n", page.u.pageW.dwSize);
1136 ok(page.addref_called == (page.u.pageW.dwSize > PROPSHEETPAGEW_V1_SIZE) ? 1 : 0, "Expected ADDREF callback message\n");
1137 }
1138
1139 if (hpsp)
1140 {
1141 page.release_called = 0;
1142 ret = pDestroyPropertySheetPage(hpsp);
1143 ok(ret, "Failed to destroy a page\n");
1144 ok(page.release_called == 1, "Expected RELEASE callback message\n");
1145 }
1146 }
1147}
1148
1149static void test_bad_control_class(void)
1150{
1151 PROPSHEETPAGEA psp;
1152 PROPSHEETHEADERA psh;
1153 HPROPSHEETPAGE hpsp;
1154 INT_PTR ret;
1155
1156 memset(&psp, 0, sizeof(psp));
1157 psp.dwSize = sizeof(psp);
1161
1162 hpsp = pCreatePropertySheetPageA(&psp);
1163 ok(hpsp != 0, "CreatePropertySheetPage failed\n");
1164
1165 memset(&psh, 0, sizeof(psh));
1167 psh.nPages = 1;
1169 U3(psh).phpage = &hpsp;
1170
1171 ret = pPropertySheetA(&psh);
1172 ok(ret == 0, "got %ld\n", ret);
1173
1174 /* Need to recreate hpsp otherwise the test fails under Windows */
1175 hpsp = pCreatePropertySheetPageA(&psp);
1176 ok(hpsp != 0, "CreatePropertySheetPage failed\n");
1177 U3(psh).phpage = &hpsp;
1178
1179 psh.dwFlags = PSH_MODELESS;
1180 ret = pPropertySheetA(&psh);
1181 ok(ret != 0, "got %ld\n", ret);
1182
1183 ok(IsWindow((HWND)ret), "bad window handle %#lx\n", ret);
1185}
1186
1187static void init_functions(void)
1188{
1189 HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
1190
1191#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
1196#undef X
1197}
1198
1199START_TEST(propsheet)
1200{
1201 detect_locale();
1202 if (rtl)
1203 {
1204 /* use locale-specific RTL resources when on an RTL locale */
1205 /* without this, propsheets on RTL locales use English LTR resources */
1206 trace("RTL locale detected\n");
1208 }
1209
1211
1213 test_title();
1214 test_nopage();
1217 test_buttons();
1219 test_messages();
1223}
@ sent
Definition: SystemMenu.c:27
@ lparam
Definition: SystemMenu.c:31
@ hook
Definition: SystemMenu.c:35
@ wparam
Definition: SystemMenu.c:30
@ optional
Definition: SystemMenu.c:34
#define add_message(msg)
Definition: SystemMenu.c:98
#define ok_sequence(exp, contx, todo)
Definition: SystemMenu.c:275
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
Arabic default style
Definition: afstyles.h:94
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
#define U(x)
Definition: wordpad.c:45
#define U3(x)
Definition: wordpad.c:47
#define U2(x)
Definition: wordpad.c:46
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:393
#define IDC_APPLY_BUTTON
Definition: comctl32.h:54
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
Definition: propsheet.c:2875
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3086
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
Definition: propsheet.c:3002
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3155
#define GetProcessHeap()
Definition: compat.h:736
HANDLE HWND
Definition: compat.h:19
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CALLBACK
Definition: compat.h:35
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1666
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304
GLuint id
Definition: glext.h:5910
static const WCHAR titleW[]
Definition: htmlelem.c:1067
char hdr[14]
Definition: iptest.cpp:33
__u16 time
Definition: mkdosfs.c:8
static FN_CreatePropertySheetPageW pCreatePropertySheetPageW
Definition: propsheet.c:121
DWORD button
Definition: button.c:166
static int CALLBACK sheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
Definition: propsheet.c:70
static void test_custom_default_button(void)
Definition: propsheet.c:564
static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *psp)
Definition: propsheet.c:1025
static void test_CreatePropertySheetPage(void)
Definition: propsheet.c:1082
static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp)
Definition: propsheet.c:325
static INT_PTR CALLBACK page_with_custom_default_button_dlg_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: propsheet.c:543
static BOOL add_button_has_been_pressed
Definition: propsheet.c:540
static INT_PTR CALLBACK nav_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: propsheet.c:288
#define NUM_MSG_SEQUENCES
Definition: propsheet.c:633
static void test_messages(void)
Definition: propsheet.c:790
#define X(f)
static void test_title(void)
Definition: propsheet.c:135
static void save_message(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, INT receiver)
Definition: propsheet.c:735
static void test_disableowner(void)
Definition: propsheet.c:252
static void test_nopage(void)
Definition: propsheet.c:174
static WNDPROC oldWndProc
Definition: propsheet.c:637
static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *psp)
Definition: propsheet.c:1054
static void test_buttons(void)
Definition: propsheet.c:471
static WNDPROC old_nav_dialog_proc
Definition: propsheet.c:312
static void register_parent_wnd_class(void)
Definition: propsheet.c:235
static void detect_locale(void)
Definition: propsheet.c:46
static HWND parenthwnd
Definition: propsheet.c:33
static INT_PTR CALLBACK page_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: propsheet.c:101
static LONG active_page
Definition: propsheet.c:37
static void test_wiznavigation(void)
Definition: propsheet.c:343
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: propsheet.c:636
#define PROPSHEET_SEQ_INDEX
Definition: propsheet.c:634
static void flush_events(void)
Definition: propsheet.c:54
static INT_PTR CALLBACK page_dlg_proc_messages(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:782
static void test_PSM_INSERTPAGE(void)
Definition: propsheet.c:920
static void test_PSM_ADDPAGE(void)
Definition: propsheet.c:830
#define RECEIVER_SHEET_WINPROC
Definition: propsheet.c:630
#define RECEIVER_PAGE
Definition: propsheet.c:631
#define RECEIVER_SHEET_CALLBACK
Definition: propsheet.c:629
static LRESULT CALLBACK sheet_callback_messages_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:760
static BOOL rtl
Definition: propsheet.c:36
static const struct message property_sheet_seq[]
Definition: propsheet.c:639
static LRESULT CALLBACK new_nav_dialog_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: propsheet.c:314
static void init_functions(void)
Definition: propsheet.c:1187
static HWND sheethwnd
Definition: propsheet.c:34
static int CALLBACK disableowner_callback(HWND hwnd, UINT msg, LPARAM lparam)
Definition: propsheet.c:221
static void test_bad_control_class(void)
Definition: propsheet.c:1149
static int CALLBACK sheet_callback_messages(HWND hwnd, UINT msg, LPARAM lParam)
Definition: propsheet.c:767
#define IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON
Definition: resources.h:39
#define IDD_PROP_PAGE_RADIO
Definition: resources.h:36
#define IDD_PROP_PAGE_MESSAGE_TEST
Definition: resources.h:40
#define IDD_PROP_PAGE_ERROR
Definition: resources.h:41
#define IDD_PROP_PAGE_EXIT
Definition: resources.h:37
#define IDC_PS_PUSHBUTTON1
Definition: resources.h:50
#define IDC_PS_RADIO1
Definition: resources.h:46
#define IDD_PROP_PAGE_EDIT
Definition: resources.h:35
#define IDD_PROP_PAGE_BAD_CONTROL
Definition: resources.h:42
#define IDC_PS_EDIT1
Definition: resources.h:44
#define IDC_PS_COMBO1
Definition: resources.h:49
#define IDD_PROP_PAGE_INTRO
Definition: resources.h:34
static const WCHAR desc[]
Definition: protectdata.c:36
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define LOCALE_USER_DEFAULT
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CAPTION
Definition: pedump.c:624
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
#define RT_DIALOG
Definition: pedump.c:367
long LONG
Definition: pedump.c:60
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define PSM_GETTABCONTROL
Definition: prsht.h:80
#define PROPSHEETHEADERA_V1_SIZE
Definition: prsht.h:290
#define PSH_MODELESS
Definition: prsht.h:50
#define PROPSHEETPAGEA_V1_SIZE
Definition: prsht.h:209
#define PSPCB_ADDREF
Definition: prsht.h:171
#define PSM_ISDIALOGMESSAGE
Definition: prsht.h:96
#define PSCB_PRECREATE
Definition: prsht.h:76
#define PSM_REMOVEPAGE
Definition: prsht.h:166
#define PSM_ADDPAGE
Definition: prsht.h:165
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSP_USETITLE
Definition: prsht.h:26
#define PSM_GETCURRENTPAGEHWND
Definition: prsht.h:81
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSN_APPLY
Definition: prsht.h:117
#define PSBTN_NEXT
Definition: prsht.h:147
#define PROPSHEETPAGEA_V4_SIZE
Definition: prsht.h:212
#define PSBTN_BACK
Definition: prsht.h:146
#define PSPCB_RELEASE
Definition: prsht.h:37
#define PROPSHEETPAGEW_V4_SIZE
Definition: prsht.h:249
#define PSP_USECALLBACK
Definition: prsht.h:30
#define PSP_PREMATURE
Definition: prsht.h:31
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define PSM_SETCURSEL
Definition: prsht.h:167
#define PROPSHEETPAGEW_V1_SIZE
Definition: prsht.h:246
#define PSM_PRESSBUTTON
Definition: prsht.h:100
struct _PROPSHEETPAGEA PROPSHEETPAGEA
#define PSN_SETACTIVE
Definition: prsht.h:115
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
#define PSH_WIZARD
Definition: prsht.h:45
#define TCM_GETITEMCOUNT
Definition: commctrl.h:3973
#define IDHELP
Definition: resource_2.h:8
#define WM_NOTIFY
Definition: richedit.h:61
#define memset(x, y, z)
Definition: compat.h:39
DWORD dwFlags
Definition: prsht.h:259
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:276
DWORD dwSize
Definition: prsht.h:258
HINSTANCE hInstance
Definition: prsht.h:261
HWND hwndParent
Definition: prsht.h:260
LPCSTR pszCaption
Definition: prsht.h:266
DWORD dwFlags
Definition: prsht.h:178
HINSTANCE hInstance
Definition: prsht.h:179
LPARAM lParam
Definition: prsht.h:190
DLGPROC pfnDlgProc
Definition: prsht.h:189
DWORD dwSize
Definition: prsht.h:177
LPCSTR pszTitle
Definition: prsht.h:188
DWORD dwSize
Definition: prsht.h:214
LPARAM lParam
Definition: prsht.h:227
LPCWSTR pszTitle
Definition: prsht.h:225
HBRUSH hbrBackground
Definition: winuser.h:3173
HICON hIcon
Definition: winuser.h:3171
HINSTANCE hInstance
Definition: winuser.h:3170
HCURSOR hCursor
Definition: winuser.h:3172
int cbWndExtra
Definition: winuser.h:3169
UINT style
Definition: winuser.h:3166
LPCSTR lpszMenuName
Definition: winuser.h:3174
LPCSTR lpszClassName
Definition: winuser.h:3175
WNDPROC lpfnWndProc
Definition: winuser.h:3167
int cbClsExtra
Definition: winuser.h:3168
Definition: inflate.c:139
Definition: dialog.c:52
union custom_proppage::@1655 u
PROPSHEETPAGEW pageW
Definition: propsheet.c:1019
unsigned int release_called
Definition: propsheet.c:1022
unsigned int addref_called
Definition: propsheet.c:1021
PROPSHEETPAGEA pageA
Definition: propsheet.c:1018
Definition: tftpd.h:60
UINT message
Definition: SystemMenu.c:42
Definition: module.h:576
UINT code
Definition: winuser.h:3162
LONG right
Definition: windef.h:308
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:888
#define LONG_PTR
Definition: treelist.c:79
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
#define WC_DIALOG
Definition: undocuser.h:11
int ret
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1302
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1691
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define LAYOUT_RTL
Definition: wingdi.h:1371
#define WHITE_BRUSH
Definition: wingdi.h:902
#define LOCALE_IREADINGLAYOUT
Definition: winnls.h:157
#define WM_PAINT
Definition: winuser.h:1623
HWND WINAPI GetFocus(void)
Definition: window.c:1865
#define WM_ERASEBKGND
Definition: winuser.h:1628
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define SetWindowLongPtrA
Definition: winuser.h:5357
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1775
#define DM_SETDEFID
Definition: winuser.h:2102
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_IME_NOTIFY
Definition: winuser.h:1833
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDCANCEL
Definition: winuser.h:834
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1664
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4318
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CHILDACTIVATE
Definition: winuser.h:1641
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1614
#define WM_COMMAND
Definition: winuser.h:1743
#define IDC_ARROW
Definition: winuser.h:687
#define DC_HASDEFID
Definition: winuser.h:2612
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETFOCUS
Definition: winuser.h:1616
#define DS_3DLOOK
Definition: winuser.h:367
#define QS_ALLINPUT
Definition: winuser.h:906
#define WM_GETTEXT
Definition: winuser.h:1621
#define RDW_UPDATENOW
Definition: winuser.h:1223
#define GetWindowLongPtrA
Definition: winuser.h:4831
#define DS_MODALFRAME
Definition: winuser.h:375
#define WM_INITDIALOG
Definition: winuser.h:1742
#define WH_CBT
Definition: winuser.h:35
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define HCBT_CREATEWND
Definition: winuser.h:58
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:833
#define WM_ACTIVATE
Definition: winuser.h:1615
#define WM_SHOWWINDOW
Definition: winuser.h:1631
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define WM_IME_SETCONTEXT
Definition: winuser.h:1832
#define WM_CTLCOLORBTN
Definition: winuser.h:1772
#define WM_SETTEXT
Definition: winuser.h:1620
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define VK_RETURN
Definition: winuser.h:2204
#define MAKELRESULT(l, h)
Definition: winuser.h:4013
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
#define PM_REMOVE
Definition: winuser.h:1199
#define RDW_ERASENOW
Definition: winuser.h:1222
#define DS_SETFONT
Definition: winuser.h:378
struct tagNMHDR * LPNMHDR
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
HWND WINAPI GetParent(_In_ HWND)
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define WM_MOVE
Definition: winuser.h:1613
#define WM_NCDESTROY
Definition: winuser.h:1687
#define DWLP_MSGRESULT
Definition: winuser.h:873
#define GWLP_ID
Definition: winuser.h:863
#define WM_SETCURSOR
Definition: winuser.h:1639
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define WM_USER
Definition: winuser.h:1898
#define WM_ACTIVATEAPP
Definition: winuser.h:1635
#define BN_CLICKED
Definition: winuser.h:1928
#define WM_KEYDOWN
Definition: winuser.h:1718
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909
#define WM_PARENTNOTIFY
Definition: winuser.h:1806
#define DM_GETDEFID
Definition: winuser.h:2101
#define WM_NCMBUTTONDBLCLK
Definition: winuser.h:1703
#define SetWindowLongPtrW
Definition: winuser.h:5358
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:855
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1665
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define WM_CTLCOLORDLG
Definition: winuser.h:1773
#define WM_KILLFOCUS
Definition: winuser.h:1617
#define DS_CONTEXTHELP
Definition: winuser.h:371
#define PM_NOREMOVE
Definition: winuser.h:1198
#define SW_NORMAL
Definition: winuser.h:772
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2142
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184