ReactOS 0.4.16-dev-2491-g3dc6630
dialog.c
Go to the documentation of this file.
1/* Unit test suite for the dialog functions.
2 *
3 * Copyright 2004 Bill Medland
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 *
19 *
20 *
21 * This test suite currently works by building a quite complex hierarchy of
22 * objects in a variety of styles and then performs a limited number of tests
23 * for the previous and next dialog group or tab items.
24 *
25 * The test specifically does not test all possibilities at this time since
26 * there are several cases where the Windows behaviour is rather strange and
27 * significant work would be required to get the Wine code to duplicate the
28 * strangeness, especially since most are in situations that would not
29 * normally be met.
30 */
31
32#include <assert.h>
33#include <stdio.h>
34#include <stdarg.h>
35
36#include "wine/test.h"
37#include "windef.h"
38#include "winbase.h"
39#include "wingdi.h"
40#include "winuser.h"
41#include "winnls.h"
42
43#define MAXHWNDS 1024
45static unsigned int numwnds=1; /* 0 is reserved for null */
46
47/* Global handles */
48static HINSTANCE g_hinst; /* This application's HINSTANCE */
52
55
58
59typedef struct {
61 int parent;
64} h_entry;
65
66static const h_entry hierarchy [] = {
67 /* 0 is reserved for the null window */
69 { 20, 1, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
71 { 60, 2, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
72 /* What happens with groups when the parent is disabled */
74 { 85, 8, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_GROUP, 0},
76 { 86, 9, WS_CHILD | WS_VISIBLE, 0},
77 { 87, 9, WS_CHILD | WS_VISIBLE, 0},
78 { 31, 8, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
80 { 88, 10, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
81 { 11, 10, WS_CHILD, WS_EX_CONTROLPARENT},
82 { 89, 11, WS_CHILD | WS_VISIBLE, 0},
83 { 32, 11, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
84 { 90, 11, WS_CHILD | WS_VISIBLE, 0},
85 { 33, 10, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
86 { 21, 2, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
87 { 61, 2, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
88 { 3, 1, WS_CHILD | WS_VISIBLE | DS_CONTROL, 0},
89 { 22, 3, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
90 { 62, 3, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
92 { 4, 7, WS_CHILD | WS_VISIBLE | DS_CONTROL, 0},
93 { 83, 4, WS_CHILD | WS_VISIBLE, 0},
94 { 5, 4, WS_CHILD | WS_VISIBLE | DS_CONTROL, 0},
95 /* A couple of controls around the main dialog */
96 { 29, 5, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
97 { 81, 5, WS_CHILD | WS_VISIBLE, 0},
98 /* The main dialog with lots of controls */
100 /* At the start of a dialog */
101 /* Disabled controls are skipped */
102 { 63, 6, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 0},
103 /* Invisible controls are skipped */
104 { 64, 6, WS_CHILD | WS_TABSTOP, 0},
105 /* Invisible disabled controls are skipped */
106 { 65, 6, WS_CHILD | WS_DISABLED | WS_TABSTOP, 0},
107 /* Non-tabstop controls are skipped for tabs but not for groups */
108 { 66, 6, WS_CHILD | WS_VISIBLE, 0},
109 /* End of first group, with no tabstops in it */
110 { 23, 6, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
111 /* At last a tabstop */
112 { 67, 6, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
113 /* A group that is totally disabled or invisible */
114 { 24, 6, WS_CHILD | WS_DISABLED | WS_GROUP, 0},
115 { 68, 6, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 0},
116 { 69, 6, WS_CHILD | WS_TABSTOP, 0},
117 /* A valid group in the middle of the dialog (not the first nor last group*/
118 { 25, 6, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
119 /* A non-tabstop item will be skipped for tabs */
120 { 70, 6, WS_CHILD | WS_VISIBLE, 0},
121 /* A disabled item will be skipped for tabs and groups */
122 { 71, 6, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 0},
123 /* A valid item will be found for tabs and groups */
124 { 72, 6, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
125 /* A disabled item to skip when looking for the next group item */
126 { 73, 6, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 0},
127 /* The next group begins with an enabled visible label */
128 { 26, 6, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
129 { 74, 6, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
130 { 75, 6, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
131 /* That group is terminated by a disabled label */
132 { 27, 6, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_GROUP, 0},
133 { 76, 6, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
134 { 77, 6, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
135 /* That group is terminated by an invisible label */
136 { 28, 6, WS_CHILD | WS_GROUP, 0},
137 /* The end of the dialog with item for loop and recursion testing */
138 { 78, 6, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
139 /* No tabstop so skipped for prev tab, but found for prev group */
140 { 79, 6, WS_CHILD | WS_VISIBLE, 0},
141 { 80, 6, WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 0},
142 /* A couple of controls after the main dialog */
143 { 82, 5, WS_CHILD | WS_VISIBLE, 0},
144 { 30, 5, WS_CHILD | WS_VISIBLE | WS_GROUP, 0},
145 /* And around them */
146 { 84, 4, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0},
147 {0, 0, 0, 0}
148};
149
151{
153}
154
156{
157 const h_entry *p = hierarchy;
158
159 while (p->id != 0)
160 {
161 DWORD style, exstyle;
162 char ctrlname[16];
163
164 /* Basically assert that the hierarchy is valid and track the
165 * maximum control number
166 */
167 if (p->id >= numwnds)
168 {
169 if (p->id >= ARRAY_SIZE(hwnd))
170 {
171 trace ("Control %Id is out of range\n", p->id);
172 return FALSE;
173 }
174 else
175 numwnds = p->id+1;
176 }
177 if (p->id <= 0)
178 {
179 trace ("Control %Id is out of range\n", p->id);
180 return FALSE;
181 }
182 if (hwnd[p->id] != 0)
183 {
184 trace ("Control %Id is used more than once\n", p->id);
185 return FALSE;
186 }
187
188 /* Create the control */
189 sprintf (ctrlname, "ctrl%4.4Id", p->id);
190 hwnd[p->id] = CreateWindowExA(p->exstyle, p->parent ? "static" : "GetNextDlgItemWindowClass", ctrlname, p->style, 10, 10, 10, 10, hwnd[p->parent], p->parent ? (HMENU) (2000 + p->id) : 0, hinst, 0);
191 if (!hwnd[p->id])
192 {
193 trace ("Failed to create control %Id\n", p->id);
194 return FALSE;
195 }
196
197 /* Check that the styles are as we specified (except the main one
198 * which is quite frequently messed up). If this keeps breaking then
199 * we could mask out the bits that don't concern us.
200 */
201 if (p->parent)
202 {
204 exstyle = GetWindowLongA(hwnd[p->id], GWL_EXSTYLE);
205 if (style != p->style || exstyle != p->exstyle)
206 {
207 trace ("Style mismatch at %Id: %8.8lx %8.8lx cf %8.8lx %8.8lx\n", p->id, style, exstyle, p->style, p->exstyle);
208 }
209 }
210 p++;
211 }
212
213 return TRUE;
214}
215
216/* Form the lParam of a WM_KEYDOWN message */
217static DWORD KeyDownData (int repeat, int scancode, int extended, int wasdown)
218{
219 return ((repeat & 0x0000FFFF) | ((scancode & 0x00FF) << 16) |
220 (extended ? 0x01000000 : 0) | (wasdown ? 0x40000000 : 0));
221}
222
223/* Form a WM_KEYDOWN VK_TAB message to the specified window */
224static void FormTabMsg (MSG *pMsg, HWND hwnd)
225{
226 pMsg->hwnd = hwnd;
227 pMsg->message = WM_KEYDOWN;
228 pMsg->wParam = VK_TAB;
229 pMsg->lParam = KeyDownData (1, 0x0F, 0, 0);
230 /* pMsg->time is not set. It shouldn't be needed */
231 /* pMsg->pt is ignored */
232}
233
234/* Form a WM_KEYDOWN VK_RETURN message to the specified window */
235static void FormEnterMsg (MSG *pMsg, HWND hwnd)
236{
237 pMsg->hwnd = hwnd;
238 pMsg->message = WM_KEYDOWN;
239 pMsg->wParam = VK_RETURN;
240 pMsg->lParam = KeyDownData (1, 0x1C, 0, 0);
241 /* pMsg->time is not set. It shouldn't be needed */
242 /* pMsg->pt is ignored */
243}
244
245/***********************************************************************
246 *
247 * The actual tests
248 */
249
250typedef struct
251{
252 int isok; /* or is it todo */
253 int test;
254 int dlg;
255 int ctl;
256 int tab;
257 int prev;
258 int res;
260
261static int id (HWND h)
262{
263 unsigned int i;
264 for (i = 0; i < numwnds; i++)
265 if (hwnd[i] == h)
266 return i;
267 return -1;
268}
269
270/* Tests
271 *
272 * Tests 1-8 test the hCtl argument of null or the dialog itself.
273 *
274 * 1. Prev Group of null is null
275 * 2. Prev Tab of null is null
276 * 3. Prev Group of hDlg in hDlg is null
277 * 4. Prev Tab of hDlg in hDlg is null
278 * 5. Next Group of null is first visible enabled child
279 * Check it skips invisible, disabled and both.
280 * 6. Next Tab of null is first visible enabled tabstop
281 * Check it skips invisible, disabled, nontabstop, and in combination.
282 * 7. Next Group of hDlg in hDlg is as of null
283 * 8. Next Tab of hDlg in hDlg is as of null
284 *
285 * Tests 9-14 test descent
286 *
287 * 9. DS_CONTROL does not result in descending the hierarchy for Tab Next
288 * 10. DS_CONTROL does not result in descending the hierarchy for Group Next
289 * 11. WS_EX_CONTROLPARENT results in descending the hierarchy for Tab Next
290 * 12. WS_EX_CONTROLPARENT results in descending the hierarchy for Group Next
291 * 13. WS_EX_CONTROLPARENT results in descending the hierarchy for Tab Prev
292 * 14. WS_EX_CONTROLPARENT results in descending the hierarchy for Group Prev
293 *
294 * Tests 15-24 are the basic Prev/Next Group tests
295 *
296 * 15. Next Group of a visible enabled non-group control is the next visible
297 * enabled non-group control, if there is one before the next group
298 * 16. Next Group of a visible enabled non-group control wraps around to the
299 * beginning of the group on finding a control that starts another group.
300 * Note that the group is in the middle of the dialog.
301 * 17. As 16 except note that the next group is started with a disabled
302 * visible control.
303 * 18. As 16 except note that the next group is started with an invisible
304 * enabled control.
305 * 19. Next Group wraps around the controls of the dialog
306 * 20. Next Group is the same even if the initial control is disabled.
307 * 21. Next Group is the same even if the initial control is invisible.
308 * 22. Next Group is the same even if the initial control has the group style
309 * 23. Next Group returns the initial control if there is no visible enabled
310 * control in the group. (Initial control disabled and not group style).
311 * 24. Prev version of test 16.
312 * Prev Group of a visible enabled non-group control wraps around to the
313 * beginning of the group on finding a control that starts the group.
314 * Note that the group is in the middle of the dialog.
315 *
316 * In tests 25 to 28 the control is sitting under dialogs which do not have
317 * the WS_EX_CONTROLPARENT style and so cannot be reached from the top of
318 * the dialog.
319 *
320 * 25. Next Group of an inaccessible control is as if it were accessible
321 * 26. Prev Group of an inaccessible control begins searching at the highest
322 * level ancestor that did not permit recursion down the hierarchy
323 * 27. Next Tab of an inaccessible control is as if it were accessible
324 * 28. Prev Tab of an inaccessible control begins searching at the highest
325 * level ancestor that did not permit recursion down the hierarchy.
326 *
327 * Tests 29- are the basic Tab tests
328 *
329 * 29. Next Tab of a control is the next visible enabled control with the
330 * Tabstop style (N.B. skips disabled, invisible and non-tabstop)
331 * 30. Prev Tab of a control is the previous visible enabled control with the
332 * Tabstop style (N.B. skips disabled, invisible and non-tabstop)
333 * 31. Next Tab test with at least two layers of descent and finding the
334 * result not at the first control.
335 * 32. Next Tab test with at least two layers of descent with the descent and
336 * control at the start of each level.
337 * 33. Prev Tab test with at least two layers of descent and finding the
338 * result not at the last control.
339 * 34. Prev Tab test with at least two layers of descent with the descent and
340 * control at the end of each level.
341 *
342 * 35. Passing NULL may result in the first child being the one returned.
343 * (group test)
344 * 36. Passing NULL may result in the first child being the one returned.
345 * (tab test)
346 */
347
348static void test_GetNextDlgItem(void)
349{
350 static test_record test [] =
351 {
352 /* isok test dlg ctl tab prev res */
353
354 { 1, 1, 6, 0, 0, 1, 0},
355 { 1, 2, 6, 0, 1, 1, 0},
356 { 1, 3, 6, 6, 0, 1, 0},
357 { 1, 4, 6, 6, 1, 1, 0},
358 { 1, 5, 6, 0, 0, 0, 66},
359 { 1, 6, 6, 0, 1, 0, 67},
360 { 1, 7, 6, 6, 0, 0, 66},
361 { 1, 8, 6, 6, 1, 0, 67},
362
363 { 1, 9, 4, 83, 1, 0, 84},
364 { 1, 10, 4, 83, 0, 0, 5},
365 { 1, 11, 5, 81, 1, 0, 67},
366 { 1, 12, 5, 81, 0, 0, 66},
367 { 1, 13, 5, 82, 1, 1, 78},
368
369 { 1, 14, 5, 82, 0, 1, 79},
370 { 1, 15, 6, 70, 0, 0, 72},
371 { 1, 16, 6, 72, 0, 0, 25},
372 { 1, 17, 6, 75, 0, 0, 26},
373 { 1, 18, 6, 77, 0, 0, 76},
374 { 1, 19, 6, 79, 0, 0, 66},
375 { 1, 20, 6, 71, 0, 0, 72},
376 { 1, 21, 6, 64, 0, 0, 66},
377
378 { 1, 22, 6, 25, 0, 0, 70},
379 { 1, 23, 6, 68, 0, 0, 68},
380 { 1, 24, 6, 25, 0, 1, 72},
381 { 1, 25, 1, 70, 0, 0, 72},
382 /*{ 0, 26, 1, 70, 0, 1, 3}, Crashes Win95*/
383 { 1, 27, 1, 70, 1, 0, 72},
384 /*{ 0, 28, 1, 70, 1, 1, 61}, Crashes Win95*/
385
386 { 1, 29, 6, 67, 1, 0, 72},
387 { 1, 30, 6, 72, 1, 1, 67},
388
389 { 1, 35, 2, 0, 0, 0, 60},
390 { 1, 36, 2, 0, 1, 0, 60},
391
392 { 0, 0, 0, 0, 0, 0, 0} /* End of test */
393 };
394 const test_record *p = test;
395
396 ok (CreateWindows (g_hinst), "Could not create test windows\n");
397
398 while (p->dlg)
399 {
400 HWND a;
401 a = (p->tab ? GetNextDlgTabItem : GetNextDlgGroupItem) (hwnd[p->dlg], hwnd[p->ctl], p->prev);
402 todo_wine_if (!p->isok)
403 ok (a == hwnd[p->res], "Test %d: %s %s item of %d in %d was %d instead of %d\n", p->test, p->prev ? "Prev" : "Next", p->tab ? "Tab" : "Group", p->ctl, p->dlg, id(a), p->res);
404 p++;
405 }
406}
407
408/*
409 * OnMainWindowCreate
410 */
412{
413 g_hwndButton1 = CreateWindowA("button", "Button &1",
415 10, 10, 80, 80, hwnd, (HMENU)100, g_hinst, 0);
416 if (!g_hwndButton1) return FALSE;
417
418 g_hwndButton2 = CreateWindowA("button", "Button &2",
420 110, 10, 80, 80, hwnd, (HMENU)200, g_hinst, 0);
421 if (!g_hwndButton2) return FALSE;
422
423 g_hwndButtonCancel = CreateWindowA("button", "Cancel",
425 210, 10, 80, 80, hwnd, (HMENU)IDCANCEL, g_hinst, 0);
426 if (!g_hwndButtonCancel) return FALSE;
427
428 return TRUE;
429}
430
431
432/*
433 * OnTestDlgCreate
434 */
435
437{
440 "Edit", "Edit",
442 16,33,184,24, hwnd, (HMENU)101, g_hinst, 0);
443 if (!g_hwndTestDlgEdit) return FALSE;
444
447 "button", "Button &1",
449 204,33,30,24, hwnd, (HMENU)201, g_hinst, 0);
450 if (!g_hwndTestDlgBut1) return FALSE;
451
453 | WS_EX_NOPARENTNOTIFY, "button",
454 "Button &2",
456 90,102,80,24, hwnd, (HMENU)IDCANCEL, g_hinst, 0);
457 if (!g_hwndTestDlgBut2) return FALSE;
458
459 return TRUE;
460}
461
464{
465 switch (uiMsg)
466 {
467 /* Add blank case statements for these to ensure we don't use them
468 * by mistake.
469 */
470 case DM_GETDEFID: break;
471 case DM_SETDEFID: break;
472
473 case WM_CREATE:
474 return (OnMainWindowCreate (hwnd,
475 (LPCREATESTRUCTA) lParam) ? 0 : (LRESULT) -1);
476 case WM_COMMAND:
477 if (wParam == IDCANCEL)
478 {
480 return 0;
481 }
482 else if ((wParam == 100 || wParam == 0xFFFF) && lParam)
483 {
485 }
486 break;
487 }
488
489 return DefWindowProcA (hwnd, uiMsg, wParam, lParam);
490}
491
494{
495 switch (uiMsg)
496 {
497 case WM_INITDIALOG:
498 {
499 DWORD dw;
500 HWND hwndOk;
501
504 hwndOk = GetDlgItem(hwnd, LOWORD(dw));
505 assert(hwndOk);
506 EnableWindow(hwndOk, FALSE);
507
510 break;
511 }
512 case WM_COMMAND:
513 if (wParam == IDOK)
514 {
516 EndDialog(hwnd, 0);
517 return 0;
518 }
519 else if (wParam == IDCANCEL)
520 {
521 EndDialog(hwnd, 0);
522 return 0;
523 }
524 break;
525 }
526
527 return DefWindowProcA (hwnd, uiMsg, wParam, lParam);
528}
529
532{
533 switch (uiMsg)
534 {
535 /* Add blank case statements for these to ensure we don't use them
536 * by mistake.
537 */
538 case DM_GETDEFID: break;
539 case DM_SETDEFID: break;
540
541 case WM_CREATE:
542 return (OnTestDlgCreate (hwnd,
543 (LPCREATESTRUCTA) lParam) ? 0 : (LRESULT) -1);
544 case WM_COMMAND:
545 if(LOWORD(wParam) == 300) g_bReceivedCommand = TRUE;
546 }
547
548 return DefDlgProcA (hwnd, uiMsg, wParam, lParam);
549}
550
552{
553 switch(msg)
554 {
555 case WM_CREATE:
556 {
557 static const short sample[] = { 10,1,2,3,4,5 };
559 short *data = cs->lpCreateParams;
560 ok(!memcmp(data, sample, sizeof(sample)), "data mismatch: %d,%d,%d,%d,%d\n", data[0], data[1], data[2], data[3], data[4]);
561 }
562 return 0;
563
564 default:
565 break;
566 }
567
569}
570
571static int wm_char_count;
572
573static BOOL is_cjk(void)
574{
575 int lang_id = PRIMARYLANGID(GetUserDefaultLangID());
576
577 if (lang_id == LANG_CHINESE || lang_id == LANG_JAPANESE || lang_id == LANG_KOREAN)
578 return TRUE;
579 return FALSE;
580}
581
583{
584 switch (msg)
585 {
586 case WM_CHAR:
587 if (is_cjk())
588 ok(wparam == 0x5b57, "Got unexpected wparam %#Ix.\n", wparam);
590 ok(wparam == 0xfffd, "Got unexpected wparam %#Ix.\n", wparam);
591 else
592 ok(wparam == 0x3f, "Got unexpected wparam %#Ix.\n", wparam);
594 return 0;
595 case WM_CLOSE:
597 return 0;
598 case WM_DESTROY:
600 return 0;
601 case WM_GETDLGCODE:
602 return DLGC_WANTCHARS;
603 default:
605 }
606}
607
609{
610 WNDCLASSW cls_w;
611 WNDCLASSA cls;
612
613 cls.style = 0;
615 cls.cbClsExtra = 0;
616 cls.cbWndExtra = 0;
617 cls.hInstance = g_hinst;
618 cls.hIcon = NULL;
620 cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
621 cls.lpszMenuName = NULL;
622 cls.lpszClassName = "GetNextDlgItemWindowClass";
623
624 if (!RegisterClassA (&cls)) return FALSE;
625
627 cls.lpszClassName = "IsDialogMessageWindowClass";
628 if (!RegisterClassA (&cls)) return FALSE;
629
631 cls.lpszClassName = "TESTCONTROL";
632 if (!RegisterClassA (&cls)) return FALSE;
633
634 GetClassInfoA(0, "#32770", &cls);
636 cls.lpszClassName = "WM_NEXTDLGCTLWndClass";
637 if (!RegisterClassA (&cls)) return FALSE;
638
639 memset (&cls_w, 0, sizeof(cls_w));
641 cls_w.hInstance = g_hinst;
642 cls_w.lpszClassName = L"TestIsDialogMessageAClass";
643 if (!RegisterClassW (&cls_w)) return FALSE;
644 return TRUE;
645}
646
647static void test_WM_NEXTDLGCTL(void)
648{
649 HWND child1, child2, child3;
650 MSG msg;
651 DWORD dwVal;
652
655 "WM_NEXTDLGCTLWndClass",
656 "WM_NEXTDLGCTL Message test window",
659 0, 0, 235, 135,
660 NULL, NULL, g_hinst, 0);
661
666
667 /*
668 * Test message DM_SETDEFID
669 */
670
673 dwVal = DefDlgProcA(g_hwndTestDlg, DM_GETDEFID, 0, 0);
674
675 ok ( IDCANCEL == (LOWORD(dwVal)), "Did not set default ID\n" );
676
677 /*
678 * Check whether message WM_NEXTDLGCTL is changing the focus to next control and if
679 * the destination control is a button, style of the button should be changed to
680 * BS_DEFPUSHBUTTON with out making it default.
681 */
682
683 /* Keep the focus on Edit control. */
685 ok((GetFocus() == g_hwndTestDlgEdit), "Focus didn't set on Edit control\n");
686
687 /* Test message WM_NEXTDLGCTL */
689 ok((GetFocus() == g_hwndTestDlgBut1), "Focus didn't move to first button\n");
690
691 /* Check whether the default button ID got changed by sending message "WM_NEXTDLGCTL" */
692 dwVal = DefDlgProcA(g_hwndTestDlg, DM_GETDEFID, 0, 0);
693 ok(IDCANCEL == (LOWORD(dwVal)), "WM_NEXTDLGCTL changed default button\n");
694
695 /*
696 * Check whether the style of the button which got the focus, changed to BS_DEFPUSHBUTTON and
697 * the style of default button changed to BS_PUSHBUTTON.
698 */
699 ok(get_button_style(g_hwndTestDlgBut1) == BS_DEFPUSHBUTTON, "Button1's style not set to BS_DEFPUSHBUTTON\n");
700 ok(get_button_style(g_hwndTestDlgBut2) == BS_PUSHBUTTON, "Button2's style not set to BS_PUSHBUTTON\n");
701
702 /* Move focus to Button2 using "WM_NEXTDLGCTL" */
704 ok((GetFocus() == g_hwndTestDlgBut2), "Focus didn't move to second button\n");
705
706 /* Check whether the default button ID got changed by sending message "WM_NEXTDLGCTL" */
707 dwVal = DefDlgProcA(g_hwndTestDlg, DM_GETDEFID, 0, 0);
708 ok(IDCANCEL == (LOWORD(dwVal)), "WM_NEXTDLGCTL changed default button\n");
709
710 /*
711 * Check whether the style of the button which got the focus, changed to BS_DEFPUSHBUTTON and
712 * the style of button which lost the focus changed to BS_PUSHBUTTON.
713 */
714 ok(get_button_style(g_hwndTestDlgBut1) == BS_PUSHBUTTON, "Button1's style not set to BS_PUSHBUTTON\n");
715 ok(get_button_style(g_hwndTestDlgBut2) == BS_DEFPUSHBUTTON, "Button2's style not set to BS_DEFPUSHBUTTON\n");
716
717 /* Move focus to Edit control using "WM_NEXTDLGCTL" */
719 ok((GetFocus() == g_hwndTestDlgEdit), "Focus didn't move to Edit control\n");
720
721 /* Check whether the default button ID got changed by sending message "WM_NEXTDLGCTL" */
722 dwVal = DefDlgProcA(g_hwndTestDlg, DM_GETDEFID, 0, 0);
723 ok(IDCANCEL == (LOWORD(dwVal)), "WM_NEXTDLGCTL changed default button\n");
724
725 /* test nested default buttons */
726
727 child1 = CreateWindowA("button", "child1", WS_VISIBLE|WS_CHILD, 0, 0, 50, 50,
729 ok(child1 != NULL, "failed to create first child\n");
730 child2 = CreateWindowA("button", "child2", WS_VISIBLE|WS_CHILD, 60, 60, 30, 30,
732 ok(child2 != NULL, "failed to create second child\n");
733 /* create nested child */
734 child3 = CreateWindowA("button", "child3", WS_VISIBLE|WS_CHILD, 10, 10, 10, 10,
735 child1, (HMENU)300, g_hinst, NULL);
736 ok(child3 != NULL, "failed to create subchild\n");
737
739 dwVal = DefDlgProcA( g_hwndTestDlg, DM_GETDEFID, 0, 0);
740 ok(LOWORD(dwVal) == 200, "expected 200, got %lx\n", dwVal);
741
743 dwVal = DefDlgProcA( g_hwndTestDlg, DM_GETDEFID, 0, 0);
744 ok(LOWORD(dwVal) == 300, "expected 300, got %lx\n", dwVal);
746 "expected child3 not to be marked as DLGC_DEFPUSHBUTTON\n");
747
749 FormEnterMsg (&msg, child3);
750 ok(IsDialogMessageA(g_hwndTestDlg, &msg), "Did not handle the ENTER\n");
751 ok(g_bReceivedCommand, "Did not trigger the default Button action\n");
752
753 DestroyWindow(child3);
754 DestroyWindow(child2);
755 DestroyWindow(child1);
757}
758
760{
761 ok(0, "unexpected hook called, code %d\n", code);
763}
764
767{
768 ok(code == MSGF_DIALOGBOX, "unexpected hook called, code %d\n", code);
771}
772
773static void test_IsDialogMessage(void)
774{
775 HHOOK hook;
776 HWND child;
777 BOOL ret;
778 MSG msg;
779
780 g_hwndMain = CreateWindowA("IsDialogMessageWindowClass", "IsDialogMessageWindowClass",
783 NULL, NULL, g_hinst, 0);
784
788
789 if (0)
790 {
791 /* crashes on Windows */
794 }
795
796 /* The focus should initially be nowhere. The first TAB should take it
797 * to the first button. The second TAB should take it to the Cancel
798 * button.
799 */
800
801 /* valid window, invalid message window */
803 FormTabMsg (&msg, (HWND)0xbeefbeef);
804 ok (!IsDialogMessageA(g_hwndMain, &msg), "expected failure\n");
805 ok(g_MSGF_DIALOGBOX, "hook wasn't called\n");
808
811
812 ok (!IsDialogMessageA(NULL, &msg), "expected failure\n");
813 ok (!IsDialogMessageA((HWND)0xbeefbeef, &msg), "expected failure\n");
814
816
817 ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle first TAB\n");
818 ok ((GetFocus() == g_hwndButton1), "Focus did not move to first button\n");
820 ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle second TAB\n");
822 "Focus did not move to cancel button\n");
824 ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle the ENTER\n");
825 ok (g_terminated, "ENTER did not terminate\n");
826
827 /* matching but invalid window handles, NULL */
829
830 FormTabMsg (&msg, NULL);
831 ok (!IsDialogMessageA(msg.hwnd, &msg), "expected failure\n");
832
833 /* matching but invalid window handles, not NULL */
834 FormTabMsg (&msg, (HWND)0xbeefbeef);
835 ok (!IsDialogMessageA(msg.hwnd, &msg), "expected failure\n");
836
839
840 g_hwndMain = CreateWindowA("IsDialogMessageWindowClass", "IsDialogMessageWindowClass", WS_OVERLAPPEDWINDOW,
845 ok(IsDialogMessageA(g_hwndMain, &msg), "Did not handle the ENTER\n");
846 ok(g_button1Clicked, "Did not receive button 1 click notification\n");
847
850 ok(IsDialogMessageA(g_hwndMain, &msg), "Did not handle the ENTER\n");
851 ok(g_button1Clicked, "Did not receive button 1 click notification\n");
852
855 ok(IsDialogMessageA(g_hwndMain, &msg), "Did not handle the ENTER\n");
856 ok(g_button1Clicked, "Did not receive button 1 click notification\n");
857
858 /* Button with id larger than 0xFFFF should also work */
862 ok(IsDialogMessageA(g_hwndMain, &msg), "Did not handle the ENTER\n");
863 ok(g_button1Clicked, "Did not receive button 1 click notification\n");
864
865 /* Test IsDialogMessageA converting a WM_CHAR wparam in ASCII to Unicode */
866 child = CreateWindowW(L"TestIsDialogMessageAClass", L"test", WS_CHILD | WS_VISIBLE, 0, 0, 10,
867 10, g_hwndMain, 0, g_hinst, 0);
868 ok(!!child, "Failed to create a window, error %#lx.\n", GetLastError());
869
870 /* \u5b57 is a 'å­—' in Chinese */
871 PostMessageW(child, WM_CHAR, 0x5b57, 0x1);
873
874 while (GetMessageA(&msg, child, 0, 0) > 0)
875 {
876 if (msg.message == WM_CHAR)
877 {
878 if (is_cjk())
879 ok(msg.wParam != 0x3f && msg.wParam != 0x5b57, "Got unexpected wparam %#Ix.\n", msg.wParam);
881 ok(msg.wParam == 0x97ade5, "Got unexpected wparam %#Ix.\n", msg.wParam);
882 else
883 ok(msg.wParam == 0x3f, "Got unexpected wparam %#Ix.\n", msg.wParam);
885 ok(ret, "IsDialogMessageA failed.\n");
886 }
887 else
888 {
891 }
892 }
893 ok(wm_char_count == 1, "Got unexpected WM_CHAR count %d.\n", wm_char_count);
895}
896
897
900{
901 switch (uiMsg)
902 {
903 case WM_INITDIALOG:
904 g_hwndMain = hDlg;
906 g_hwndButton1 = GetDlgItem(hDlg,200);
907 g_hwndButton2 = GetDlgItem(hDlg,201);
910
911 /* Initially check the second radio button */
914 /* Continue testing after dialog initialization */
915 PostMessageA(hDlg, WM_USER, 0, 0);
917
918 case WM_COMMAND:
919 if (LOWORD(wParam) == IDCANCEL)
920 {
921 EndDialog(hDlg, LOWORD(wParam));
922 return TRUE;
923 }
924 return FALSE;
925
926 case WM_USER:
929 SetFocus(hDlg);
932 return TRUE;
933 }
934
935 return FALSE;
936}
937
940{
941 switch (uiMsg)
942 {
943 case WM_INITDIALOG:
944 SetWindowTextA(GetDlgItem(hDlg, 200), "new caption");
945 return TRUE;
946
947 case WM_COMMAND:
948 if (LOWORD(wParam) == 200)
949 {
950 if (HIWORD(wParam) == EN_SETFOCUS)
952 }
953 return FALSE;
954 }
955
956 return FALSE;
957}
958
960{
961 switch(uMsg) {
962 case WM_INITDIALOG:
963 return TRUE;
964 }
965 return FALSE;
966}
967
970{
971 static HWND hChildDlg;
972
973 switch (uiMsg)
974 {
975 case WM_INITDIALOG:
976 {
977 RECT rectHwnd;
978 struct {
979 DLGTEMPLATE tmplate;
980 WORD menu,class,title;
981 } temp;
982
983 SetFocus( GetDlgItem(hwnd, 200) );
984
985 GetClientRect(hwnd,&rectHwnd);
987 temp.tmplate.dwExtendedStyle = 0;
988 temp.tmplate.cdit = 0;
989 temp.tmplate.x = 0;
990 temp.tmplate.y = 0;
991 temp.tmplate.cx = 0;
992 temp.tmplate.cy = 0;
993 temp.menu = temp.class = temp.title = 0;
994
995 hChildDlg = CreateDialogIndirectParamA(g_hinst, &temp.tmplate,
997 ok(hChildDlg != 0, "Failed to create test dialog.\n");
998
999 return FALSE;
1000 }
1001 case WM_CLOSE:
1002 DestroyWindow(hChildDlg);
1003 return TRUE;
1004 }
1005
1006 return FALSE;
1007}
1008
1009/* Helper for InitialFocusTest */
1010static const char * GetHwndString(HWND hw)
1011{
1012 if (hw == NULL)
1013 return "a null handle";
1014 if (hw == g_hwndMain)
1015 return "the dialog handle";
1017 return "the group box control";
1018 if (hw == g_hwndButton1)
1019 return "the first button";
1020 if (hw == g_hwndButton2)
1021 return "the second button";
1022 if (hw == g_hwndButtonCancel)
1023 return "the cancel button";
1024
1025 return "unknown handle";
1026}
1027
1028static void test_focus(void)
1029{
1030 /* Test 1:
1031 * This test intentionally returns FALSE in response to WM_INITDIALOG
1032 * without setting focus to a control. This is what MFC's CFormView does.
1033 *
1034 * Since the WM_INITDIALOG handler returns FALSE without setting the focus,
1035 * the focus should initially be NULL. Later, when we manually set focus to
1036 * the dialog, the default handler should set focus to the first control that
1037 * is "visible, not disabled, and has the WS_TABSTOP style" (MSDN). Because the
1038 * second radio button has been checked, it should be the first control
1039 * that meets these criteria and should receive the focus.
1040 */
1041
1047
1048 DialogBoxA(g_hinst, "RADIO_TEST_DIALOG", NULL, delayFocusDlgWinProc);
1049
1051 "Error in wrc - Detected WS_TABSTOP as default style for GROUPBOX\n");
1052
1054 "Modal dialogs should not be shown until the message queue first goes empty\n");
1055
1057 "Error in initial focus when WM_INITDIALOG returned FALSE: "
1058 "Expected NULL focus, got %s (%p).\n",
1060
1062 "Error after first SetFocus() when WM_INITDIALOG returned FALSE: "
1063 "Expected the second button (%p), got %s (%p).\n",
1066
1067 /* Test 2:
1068 * This is the same as above, except WM_INITDIALOG is made to return TRUE.
1069 * This should cause the focus to go to the second radio button right away
1070 * and stay there (until the user indicates otherwise).
1071 */
1072
1078
1079 DialogBoxA(g_hinst, "RADIO_TEST_DIALOG", NULL, delayFocusDlgWinProc);
1080
1082 "Error in initial focus when WM_INITDIALOG returned TRUE: "
1083 "Expected the second button (%p), got %s (%p).\n",
1086
1088 "Error after first SetFocus() when WM_INITDIALOG returned TRUE: "
1089 "Expected the second button (%p), got %s (%p).\n",
1092
1093 /* Test 3:
1094 * If the dialog has DS_CONTROL and it's not visible then we shouldn't change focus */
1095 {
1096 HWND hDlg;
1097 HRSRC hResource;
1098 HANDLE hTemplate;
1099 DLGTEMPLATE* pTemplate;
1100 HWND hTextbox;
1101 DWORD selectionStart = 0xdead, selectionEnd = 0xbeef;
1102
1103 hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG", (LPCSTR)RT_DIALOG);
1104 hTemplate = LoadResource(g_hinst, hResource);
1105 pTemplate = LockResource(hTemplate);
1106
1109 ok (hDlg != 0, "Failed to create test dialog.\n");
1110
1111 ok ((g_hwndInitialFocusT1 == 0),
1112 "Focus should not be set for an invisible DS_CONTROL dialog %p.\n", g_hwndInitialFocusT1);
1113
1114 /* Also make sure that WM_SETFOCUS selects the textbox's text */
1115 hTextbox = GetDlgItem(hDlg, 200);
1116 SendMessageA(hTextbox, WM_SETTEXT, 0, (LPARAM)"Hello world");
1117
1118 SendMessageA(hDlg, WM_SETFOCUS, 0, 0);
1119 SendMessageA(hTextbox, EM_GETSEL, (WPARAM)&selectionStart, (LPARAM)&selectionEnd);
1120 ok(selectionStart == 0 && selectionEnd == 11, "Text selection after WM_SETFOCUS is [%li, %li) expected [0, 11)\n", selectionStart, selectionEnd);
1121
1122 /* but WM_ACTIVATE does not */
1123 SendMessageA(hTextbox, EM_SETSEL, 0, 0);
1125 SendMessageA(hTextbox, EM_GETSEL, (WPARAM)&selectionStart, (LPARAM)&selectionEnd);
1126 ok(selectionStart == 0 && selectionEnd == 0, "Text selection after WM_ACTIVATE is [%li, %li) expected [0, 0)\n", selectionStart, selectionEnd);
1127
1128 DestroyWindow(hDlg);
1129 }
1130
1131 /* Test 4:
1132 * If the dialog has no tab-accessible controls, set focus to first control */
1133 {
1134 HWND hDlg;
1135 HRSRC hResource;
1136 HANDLE hTemplate;
1137 DLGTEMPLATE* pTemplate;
1138 HWND hLabel;
1139
1140 hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG_2", (LPCSTR)RT_DIALOG);
1141 hTemplate = LoadResource(g_hinst, hResource);
1142 pTemplate = LockResource(hTemplate);
1143
1145 ok(hDlg != 0, "Failed to create test dialog.\n");
1146 hLabel = GetDlgItem(hDlg, 200);
1147
1148 ok(GetFocus() == hLabel, "Focus not set to label, focus=%p dialog=%p label=%p\n", GetFocus(), hDlg, hLabel);
1149
1150 DestroyWindow(hDlg);
1151
1152 /* Also check focus after WM_ACTIVATE and WM_SETFOCUS */
1153 hDlg = CreateDialogIndirectParamA(g_hinst, pTemplate, NULL, NULL, 0);
1154 ok(hDlg != 0, "Failed to create test dialog.\n");
1155 hLabel = GetDlgItem(hDlg, 200);
1156
1157 SetFocus(NULL);
1159 ok(GetFocus() == NULL, "Focus set on WM_ACTIVATE, focus=%p dialog=%p label=%p\n", GetFocus(), hDlg, hLabel);
1160
1161 SetFocus(NULL);
1162 SendMessageA(hDlg, WM_SETFOCUS, 0, 0);
1163 ok(GetFocus() == hLabel, "Focus not set to label on WM_SETFOCUS, focus=%p dialog=%p label=%p\n", GetFocus(), hDlg, hLabel);
1164
1165 DestroyWindow(hDlg);
1166 }
1167
1168 /* Test 5:
1169 * Select textbox's text on creation */
1170 {
1171 HWND hDlg;
1172 HRSRC hResource;
1173 HANDLE hTemplate;
1174 DLGTEMPLATE* pTemplate;
1175 HWND edit;
1176 DWORD selectionStart = 0xdead, selectionEnd = 0xbeef;
1177
1178 hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG_3", (LPCSTR)RT_DIALOG);
1179 hTemplate = LoadResource(g_hinst, hResource);
1180 pTemplate = LockResource(hTemplate);
1181
1183 ok(hDlg != 0, "Failed to create test dialog.\n");
1184 edit = GetDlgItem(hDlg, 200);
1185
1186 ok(GetFocus() == edit, "Focus not set to edit, focus=%p, dialog=%p, edit=%p\n",
1187 GetFocus(), hDlg, edit);
1188 SendMessageA(edit, EM_GETSEL, (WPARAM)&selectionStart, (LPARAM)&selectionEnd);
1189 ok(selectionStart == 0 && selectionEnd == 11,
1190 "Text selection after WM_SETFOCUS is [%li, %li) expected [0, 11)\n",
1191 selectionStart, selectionEnd);
1192
1193 DestroyWindow(hDlg);
1194 }
1195
1196 /* Test 6:
1197 * Select textbox's text on creation when WM_INITDIALOG creates a child dialog. */
1198 {
1199 HWND hDlg;
1200 HRSRC hResource;
1201 HANDLE hTemplate;
1202 DLGTEMPLATE* pTemplate;
1203 HWND edit;
1204
1205 hResource = FindResourceA(g_hinst,"FOCUS_TEST_DIALOG_3", (LPCSTR)RT_DIALOG);
1206 hTemplate = LoadResource(g_hinst, hResource);
1207 pTemplate = LockResource(hTemplate);
1208
1210 ok(hDlg != 0, "Failed to create test dialog.\n");
1211 edit = GetDlgItem(hDlg, 200);
1212
1213 ok(GetFocus() == edit, "Focus not set to edit, focus=%p, dialog=%p, edit=%p\n",
1214 GetFocus(), hDlg, edit);
1215
1216 DestroyWindow(hDlg);
1217 }
1218}
1219
1220static void test_GetDlgItemText(void)
1221{
1222 char string[64];
1223 BOOL ret;
1224
1225 strcpy(string, "Overwrite Me");
1226 ret = GetDlgItemTextA(NULL, 0, string, ARRAY_SIZE(string));
1227 ok(!ret, "GetDlgItemText(NULL) shouldn't have succeeded\n");
1228
1229 ok(string[0] == '\0' || broken(!strcmp(string, "Overwrite Me")),
1230 "string retrieved using GetDlgItemText should have been NULL terminated\n");
1231}
1232
1234{
1235 if (msg == WM_INITDIALOG)
1236 {
1237 char text[64];
1238 LONG_PTR val;
1239 HWND hwnd;
1240 BOOL ret;
1241
1242 hwnd = GetDlgItem(hdlg, -1);
1243 ok(hwnd != NULL, "Expected dialog item.\n");
1244
1245 *text = 0;
1246 ret = GetDlgItemTextA(hdlg, -1, text, ARRAY_SIZE(text));
1247 ok(ret && !strcmp(text, "Text1"), "Unexpected item text.\n");
1248
1250 ok(val == -1, "Unexpected id.\n");
1251
1253 ok(val == -1, "Unexpected id %Id.\n", val);
1254
1255 hwnd = GetDlgItem(hdlg, -2);
1256 ok(hwnd != NULL, "Expected dialog item.\n");
1257
1259 ok(val == -2, "Unexpected id.\n");
1260
1262 ok(val == -2, "Unexpected id %Id.\n", val);
1263
1264 EndDialog(hdlg, 0xdead);
1265 }
1266
1267 return FALSE;
1268}
1269
1270static void test_GetDlgItem(void)
1271{
1272 HWND hwnd, child1, child2, hwnd2;
1274 BOOL ret;
1275
1276 hwnd = CreateWindowA("button", "parent", WS_VISIBLE, 0, 0, 100, 100, NULL, 0, g_hinst, NULL);
1277 ok(hwnd != NULL, "failed to created window\n");
1278
1279 /* created with the same ID */
1280 child1 = CreateWindowA("button", "child1", WS_VISIBLE|WS_CHILD, 0, 0, 10, 10, hwnd, 0, g_hinst, NULL);
1281 ok(child1 != NULL, "failed to create first child\n");
1282 child2 = CreateWindowA("button", "child2", WS_VISIBLE|WS_CHILD, 0, 0, 10, 10, hwnd, 0, g_hinst, NULL);
1283 ok(child2 != NULL, "failed to create second child\n");
1284
1285 hwnd2 = GetDlgItem(hwnd, 0);
1286 ok(hwnd2 == child1, "expected first child, got %p\n", hwnd2);
1287
1288 hwnd2 = GetTopWindow(hwnd);
1289 ok(hwnd2 == child1, "expected first child to be top, got %p\n", hwnd2);
1290
1291 ret = SetWindowPos(child1, child2, 0, 0, 0, 0, SWP_NOMOVE);
1292 ok(ret, "got %d\n", ret);
1293 hwnd2 = GetTopWindow(hwnd);
1294 ok(hwnd2 == child2, "expected second child to be top, got %p\n", hwnd2);
1295
1296 /* top window from child list is picked */
1297 hwnd2 = GetDlgItem(hwnd, 0);
1298 ok(hwnd2 == child2, "expected second child, got %p\n", hwnd2);
1299
1300 /* Now test how GetDlgItem searches */
1301 DestroyWindow(child2);
1302 child2 = CreateWindowA("button", "child2", WS_VISIBLE|WS_CHILD, 0, 0, 10, 10, child1, 0, g_hinst, NULL);
1303 ok(child2 != NULL, "failed to create second child\n");
1304
1305 /* give child2 an ID */
1306 SetWindowLongA(child2, GWLP_ID, 100);
1307
1308 hwnd2 = GetDlgItem(hwnd, 100);
1309 ok(!hwnd2, "expected child to not be found, got %p\n", hwnd2);
1310
1311 /* make the ID of child2 public with a WS_EX_CONTROLPARENT parent */
1313
1314 hwnd2 = GetDlgItem(hwnd, 100);
1315 ok(!hwnd2, "expected child to not be found, got %p\n", hwnd2);
1316
1317 DestroyWindow(child1);
1318 DestroyWindow(child2);
1320
1321 retval = DialogBoxParamA(g_hinst, "GETDLGITEM_TEST_DIALOG", NULL, getdlgitem_test_dialog_proc, 0);
1322 ok(retval == 0xdead, "Unexpected return value.\n");
1323}
1324
1327{
1328 if (uiMsg == WM_INITDIALOG)
1329 {
1330 DestroyWindow(hDlg);
1331 return TRUE;
1332 }
1333 return FALSE;
1334}
1335
1338{
1339 switch (uiMsg)
1340 {
1341 case WM_INITDIALOG:
1342 PostMessageA(hDlg, WM_CLOSE, 0, 0);
1343 return TRUE;
1344 case WM_CLOSE:
1345 DestroyWindow(hDlg);
1346 return TRUE;
1347 case WM_DESTROY:
1348 PostQuitMessage(0);
1349 return TRUE;
1350 }
1351 return FALSE;
1352}
1353
1356{
1357 if (uiMsg == WM_INITDIALOG)
1358 {
1360 ok(expected == (HWND)wParam,
1361 "Expected wParam to be the handle to the first tabstop control (%p), got %p\n",
1362 expected, (HWND)wParam);
1363
1364 EndDialog(hDlg, LOWORD(SendMessageA(hDlg, DM_GETDEFID, 0, 0)));
1365 return TRUE;
1366 }
1367 return FALSE;
1368}
1369
1372{
1373 switch (uiMsg)
1374 {
1375 case WM_INITDIALOG:
1376 EndDialog(hDlg, LOWORD(SendMessageA(hDlg, DM_GETDEFID, 0, 0)));
1377 return TRUE;
1378 }
1379 return FALSE;
1380}
1381
1384{
1385 static int received_idok;
1386
1387 switch (uiMsg)
1388 {
1389 case WM_INITDIALOG:
1390 {
1391 MSG msg = {hDlg, WM_KEYDOWN, VK_RETURN, 0x011c0001};
1392
1393 received_idok = -1;
1394 IsDialogMessageA(hDlg, &msg);
1395 ok(received_idok == 0xdead, "WM_COMMAND/0xdead not received\n");
1396
1397 received_idok = -2;
1398 IsDialogMessageA(hDlg, &msg);
1399 ok(received_idok == IDOK, "WM_COMMAND/IDOK not received\n");
1400
1401 EndDialog(hDlg, 0);
1402 return TRUE;
1403 }
1404
1405 case DM_GETDEFID:
1406 if (received_idok == -1)
1407 {
1408 HWND hwnd = GetDlgItem(hDlg, 0xdead);
1409 ok(!hwnd, "dialog item with ID 0xdead should not exist\n");
1411 return TRUE;
1412 }
1413 return FALSE;
1414
1415 case WM_COMMAND:
1416 received_idok = wParam;
1417 return TRUE;
1418 }
1419 return FALSE;
1420}
1421
1424{
1425 HWND control;
1426 DWORD style, exstyle;
1427 char buf[256];
1428
1429 switch (msg)
1430 {
1431 case WM_INITDIALOG:
1432 control = GetDlgItem(hdlg, 7);
1433 ok(control != 0, "dialog control with id 7 not found\n");
1435 ok(style == (WS_CHILD|WS_VISIBLE), "expected WS_CHILD|WS_VISIBLE, got %#lx\n", style);
1437 ok(exstyle == (WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT|WS_EX_CLIENTEDGE), "expected WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT|WS_EX_CLIENTEDGE, got %#lx\n", exstyle);
1438 buf[0] = 0;
1439 GetWindowTextA(control, buf, sizeof(buf));
1440 ok(strcmp(buf, "bump7") == 0, "expected bump7, got %s\n", buf);
1441
1442 control = GetDlgItem(hdlg, 8);
1443 ok(control != 0, "dialog control with id 8 not found\n");
1445 ok(style == (WS_CHILD|WS_VISIBLE), "expected WS_CHILD|WS_VISIBLE, got %#lx\n", style);
1447 ok(exstyle == (WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT), "expected WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT, got %#lx\n", exstyle);
1448 buf[0] = 0;
1449 GetWindowTextA(control, buf, sizeof(buf));
1450 ok(strcmp(buf, "bump8") == 0, "expected bump8, got %s\n", buf);
1451
1452 EndDialog(hdlg, -7);
1453 return TRUE;
1454 }
1455 return FALSE;
1456}
1457
1458static const WCHAR testtextW[] = {'W','n','d','T','e','x','t',0};
1459static const char *testtext = "WndText";
1460
1462{
1469};
1470
1471static const char *testmodes[] =
1472{
1473 "SNDMSGA",
1474 "SNDMSGW",
1475 "DLGPROCA",
1476 "DLGPROCW",
1477 "SETTEXTA",
1478 "SETTEXTW",
1479};
1480
1482{
1483 int mode = HandleToULong(GetPropA(hdlg, "test_mode"));
1484 WCHAR *text = (WCHAR *)lparam;
1485 char *textA = (char *)lparam;
1486
1487 switch (msg)
1488 {
1489 case WM_SETTEXT:
1490 case WM_WININICHANGE:
1491 case WM_DEVMODECHANGE:
1492 case CB_DIR:
1493 case LB_DIR:
1494 case LB_ADDFILE:
1495 case EM_REPLACESEL:
1496 switch (mode)
1497 {
1499 ok(textA == testtext, "%s: %s, unexpected text %s.\n", IsWindowUnicode(hdlg) ? "U" : "A",
1500 testmodes[mode], textA);
1501 break;
1503 ok(text == testtextW, "%s: %s, unexpected text %s.\n", IsWindowUnicode(hdlg) ? "U" : "A", testmodes[mode],
1505 break;
1508 if (IsWindowUnicode(hdlg))
1509 {
1511 "U: %s, unexpected text %s.\n", testmodes[mode], wine_dbgstr_w(text));
1512 }
1513 else
1514 ok(textA == testtext, "A: %s, unexpected text %s.\n", testmodes[mode], textA);
1515 break;
1518 if (IsWindowUnicode(hdlg))
1519 ok(text == testtextW, "U: %s, unexpected text %s.\n", testmodes[mode], wine_dbgstr_w(text));
1520 else
1521 ok(textA != testtext && !strcmp(textA, testtext), "A: %s, unexpected text %s.\n",
1522 testmodes[mode], textA);
1523 break;
1524 }
1525 break;
1526 };
1527
1528 return DefWindowProcW(hdlg, msg, wparam, lparam);
1529}
1530
1532{
1533 int mode = HandleToULong(GetPropA(hdlg, "test_mode"));
1534 WCHAR *text = (WCHAR *)lparam;
1535 char *textA = (char *)lparam;
1536
1537 switch (msg)
1538 {
1539 case WM_SETTEXT:
1540 case WM_WININICHANGE:
1541 case WM_DEVMODECHANGE:
1542 case CB_DIR:
1543 case LB_DIR:
1544 case LB_ADDFILE:
1545 case EM_REPLACESEL:
1546 switch (mode)
1547 {
1549 ok(textA == testtext, "%s: %s, unexpected text %s.\n", IsWindowUnicode(hdlg) ? "U" : "A",
1550 testmodes[mode], textA);
1551 break;
1553 ok(text == testtextW, "%s: %s, unexpected text %s.\n", IsWindowUnicode(hdlg) ? "U" : "A", testmodes[mode],
1555 break;
1558 if (IsWindowUnicode(hdlg))
1560 "U: %s, unexpected text %s.\n", testmodes[mode], wine_dbgstr_w(text));
1561 else
1562 ok(textA == testtext, "A: %s, unexpected text %s.\n", testmodes[mode], textA);
1563 break;
1566 if (IsWindowUnicode(hdlg))
1567 ok(text == testtextW, "U: %s, unexpected text %s.\n", testmodes[mode], wine_dbgstr_w(text));
1568 else
1569 ok(textA != testtext && !strcmp(textA, testtext), "A: %s, unexpected text %s.\n",
1570 testmodes[mode], textA);
1571 break;
1572 }
1573 break;
1574 }
1575
1576 return DefWindowProcA(hdlg, msg, wparam, lparam);
1577}
1578
1580{
1581 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SNDMSGA));
1582 SendMessageA(hdlg, msg, 0, (LPARAM)testtext);
1583
1584 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SNDMSGW));
1585 SendMessageW(hdlg, msg, 0, (LPARAM)testtextW);
1586
1587 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_DLGPROCA));
1588 DefDlgProcA(hdlg, msg, 0, (LPARAM)testtext);
1589
1590 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_DLGPROCW));
1591 DefDlgProcW(hdlg, msg, 0, (LPARAM)testtextW);
1592}
1593
1595{
1596 ULONG_PTR dlgproc, originalproc;
1597 WCHAR buffW[64];
1598 char buff[64];
1599 BOOL ret;
1600 INT len;
1601
1602 switch (msg)
1603 {
1604 case WM_INITDIALOG:
1605 ok(IsWindowUnicode(hdlg), "Expected unicode window.\n");
1606
1614
1615 /* WM_SETTEXT/WM_GETTEXT */
1616 originalproc = GetWindowLongPtrW(hdlg, DWLP_DLGPROC);
1617 ok(originalproc == (ULONG_PTR)test_aw_conversion_dlgproc, "Unexpected dlg proc %#Ix.\n", originalproc);
1618
1619 dlgproc = GetWindowLongPtrA(hdlg, DWLP_DLGPROC);
1620 ok(dlgproc != (ULONG_PTR)test_aw_conversion_dlgproc, "Unexpected dlg proc %#Ix.\n", dlgproc);
1621
1623 ok(IsWindowUnicode(hdlg), "Expected unicode window.\n");
1624
1625 dlgproc = GetWindowLongPtrW(hdlg, DWLP_DLGPROC);
1626 ok(dlgproc != (ULONG_PTR)test_aw_conversion_dlgprocA, "Unexpected dlg proc %#Ix.\n", dlgproc);
1627
1628 dlgproc = GetWindowLongPtrA(hdlg, DWLP_DLGPROC);
1629 ok(dlgproc == (ULONG_PTR)test_aw_conversion_dlgprocA, "Unexpected dlg proc %#Ix.\n", dlgproc);
1630
1631 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTA));
1632 ret = SetWindowTextA(hdlg, testtext);
1633 todo_wine
1634 ok(ret, "Failed to set window text.\n");
1635
1636 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTW));
1637 ret = SetWindowTextW(hdlg, testtextW);
1638 todo_wine
1639 ok(ret, "Failed to set window text.\n");
1640
1641 memset(buff, 'A', sizeof(buff));
1642 len = GetWindowTextA(hdlg, buff, sizeof(buff));
1643 ok(buff[0] == 0 && buff[1] == 'A' && len == 0, "Unexpected window text %#x, %#x, len %d\n",
1644 (BYTE)buff[0], (BYTE)buff[1], len);
1645
1646 memset(buffW, 0xff, sizeof(buffW));
1647 len = GetWindowTextW(hdlg, buffW, 64);
1648 ok(!lstrcmpW(buffW, testtextW) && len == 0, "Unexpected window text %s, len %d\n", wine_dbgstr_w(buffW), len);
1649
1657
1659 ok(IsWindowUnicode(hdlg), "Expected unicode window.\n");
1660
1661 dlgproc = GetWindowLongPtrW(hdlg, DWLP_DLGPROC);
1662 ok(dlgproc == (ULONG_PTR)test_aw_conversion_dlgprocW, "Unexpected dlg proc %#Ix.\n", dlgproc);
1663
1664 dlgproc = GetWindowLongPtrA(hdlg, DWLP_DLGPROC);
1665 ok(dlgproc != (ULONG_PTR)test_aw_conversion_dlgprocW, "Unexpected dlg proc %#Ix.\n", dlgproc);
1666
1667 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTA));
1668 ret = SetWindowTextA(hdlg, testtext);
1669 todo_wine
1670 ok(ret, "Failed to set window text.\n");
1671
1672 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTW));
1673 ret = SetWindowTextW(hdlg, testtextW);
1674 todo_wine
1675 ok(ret, "Failed to set window text.\n");
1676
1677 memset(buff, 'A', sizeof(buff));
1678 len = GetWindowTextA(hdlg, buff, sizeof(buff));
1679 ok(buff[0] == 0 && buff[1] == 'A' && len == 0, "Unexpected window text %#x, %#x, len %d\n",
1680 (BYTE)buff[0], (BYTE)buff[1], len);
1681
1682 memset(buffW, 0xff, sizeof(buffW));
1683 len = GetWindowTextW(hdlg, buffW, ARRAY_SIZE(buffW));
1684 ok(buffW[0] == 'W' && buffW[1] == 0xffff && len == 0, "Unexpected window text %#x, %#x, len %d\n",
1685 buffW[0], buffW[1], len);
1686
1694
1695 SetWindowLongPtrA(hdlg, DWLP_DLGPROC, originalproc);
1696 EndDialog(hdlg, -123);
1697 return TRUE;
1698 }
1699 return FALSE;
1700}
1701
1703{
1704 ULONG_PTR dlgproc, originalproc;
1705 WCHAR buffW[64];
1706 char buff[64];
1707 BOOL ret;
1708 INT len;
1709
1710 switch (msg)
1711 {
1712 case WM_INITDIALOG:
1713 ok(!IsWindowUnicode(hdlg), "Unexpected unicode window.\n");
1714
1722
1723 originalproc = GetWindowLongPtrW(hdlg, DWLP_DLGPROC);
1724 ok(originalproc != (ULONG_PTR)test_aw_conversion_dlgproc2, "Unexpected dlg proc %#Ix.\n", originalproc);
1725
1726 dlgproc = GetWindowLongPtrA(hdlg, DWLP_DLGPROC);
1727 ok(dlgproc == (ULONG_PTR)test_aw_conversion_dlgproc2, "Unexpected dlg proc %#Ix.\n", dlgproc);
1728
1730 ok(!IsWindowUnicode(hdlg), "Unexpected unicode window.\n");
1731
1732 dlgproc = GetWindowLongPtrW(hdlg, DWLP_DLGPROC);
1733 ok(dlgproc != (ULONG_PTR)test_aw_conversion_dlgprocW, "Unexpected dlg proc %#Ix.\n", dlgproc);
1734
1735 dlgproc = GetWindowLongPtrA(hdlg, DWLP_DLGPROC);
1736 ok(dlgproc == (ULONG_PTR)test_aw_conversion_dlgprocW, "Unexpected dlg proc %#Ix.\n", dlgproc);
1737
1738 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTA));
1739 ret = SetWindowTextA(hdlg, testtext);
1740 todo_wine
1741 ok(ret, "Failed to set window text.\n");
1742
1743 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTW));
1744 ret = SetWindowTextW(hdlg, testtextW);
1745 todo_wine
1746 ok(ret, "Failed to set window text.\n");
1747
1748 memset(buff, 'A', sizeof(buff));
1749 len = GetWindowTextA(hdlg, buff, sizeof(buff));
1750 ok(!strcmp(buff, testtext) && len == 0, "Unexpected window text %s, len %d\n", buff, len);
1751
1752 memset(buffW, 0xff, sizeof(buffW));
1753 len = GetWindowTextW(hdlg, buffW, 64);
1754 ok(buffW[0] == 0 && buffW[1] == 0xffff && len == 0, "Unexpected window text %s, len %d\n",
1755 wine_dbgstr_w(buffW), len);
1756
1764
1766 ok(!IsWindowUnicode(hdlg), "Unexpected unicode window.\n");
1767
1768 dlgproc = GetWindowLongPtrW(hdlg, DWLP_DLGPROC);
1769 ok(dlgproc == (ULONG_PTR)test_aw_conversion_dlgprocA, "Unexpected dlg proc %#Ix.\n", dlgproc);
1770
1771 dlgproc = GetWindowLongPtrA(hdlg, DWLP_DLGPROC);
1772 ok(dlgproc != (ULONG_PTR)test_aw_conversion_dlgprocA, "Unexpected dlg proc %#Ix.\n", dlgproc);
1773
1774 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTA));
1775 ret = SetWindowTextA(hdlg, testtext);
1776 todo_wine
1777 ok(ret, "Failed to set window text.\n");
1778
1779 SetPropA(hdlg, "test_mode", ULongToHandle(DLGPROCTEXT_SETTEXTW));
1780 ret = SetWindowTextW(hdlg, testtextW);
1781 todo_wine
1782 ok(ret, "Failed to set window text.\n");
1783
1784 memset(buff, 'A', sizeof(buff));
1785 len = GetWindowTextA(hdlg, buff, sizeof(buff));
1786 ok(!strcmp(buff, testtext) && len == 0, "Unexpected window text %s, len %d\n", buff, len);
1787
1788 memset(buffW, 0xff, sizeof(buffW));
1789 len = GetWindowTextW(hdlg, buffW, ARRAY_SIZE(buffW));
1790 ok(buffW[0] == 0 && buffW[1] == 0xffff && len == 0, "Unexpected window text %#x, %#x, len %d\n",
1791 buffW[0], buffW[1], len);
1792
1800
1801 SetWindowLongPtrA(hdlg, DWLP_DLGPROC, originalproc);
1802 EndDialog(hdlg, -123);
1803 return TRUE;
1804 }
1805 return FALSE;
1806}
1807
1809{
1811 int mode = HandleToULong(GetPropA(hwnd, "test_mode"));
1812 WCHAR *text = (WCHAR *)lparam;
1813 char *textA = (char *)lparam;
1814
1815 switch (msg)
1816 {
1817 case WM_SETTEXT:
1818 case WM_WININICHANGE:
1819 case WM_DEVMODECHANGE:
1820 case CB_DIR:
1821 case LB_DIR:
1822 case LB_ADDFILE:
1823 case EM_REPLACESEL:
1824 switch (mode)
1825 {
1827 if (IsWindowUnicode(hwnd))
1829 "U: %s, unexpected text %s.\n", testmodes[mode], wine_dbgstr_w(text));
1830 else
1831 ok(textA == testtext, "A: %s, unexpected text %s.\n", testmodes[mode], textA);
1832 break;
1834 if (IsWindowUnicode(hwnd))
1835 ok(text == testtextW, "U: %s, unexpected text %s.\n", testmodes[mode], wine_dbgstr_w(text));
1836 else
1837 ok(textA != testtext && !strcmp(textA, testtext), "A: %s, unexpected text %s.\n",
1838 testmodes[mode], textA);
1839 break;
1840 default:
1841 ok(0, "Unexpected test mode %d.\n", mode);
1842 }
1843 break;
1844 }
1845
1846 return IsWindowUnicode(hwnd) ? CallWindowProcW(oldproc, hwnd, msg, wparam, lparam) :
1847 CallWindowProcA(oldproc, hwnd, msg, wparam, lparam);
1848}
1849
1851{
1852 BOOL is_unicode = !!lparam;
1853 LONG_PTR oldproc;
1854
1855 switch (msg)
1856 {
1857 case WM_INITDIALOG:
1858 ok(is_unicode == IsWindowUnicode(hdlg), "Unexpected unicode window property.\n");
1859
1861 SetWindowLongPtrA(hdlg, GWLP_USERDATA, oldproc);
1862 ok(!IsWindowUnicode(hdlg), "Unexpected unicode window.\n");
1863
1871
1873 ok(IsWindowUnicode(hdlg), "Expected unicode window.\n");
1874
1882
1883 SetWindowLongPtrA(hdlg, GWLP_WNDPROC, oldproc);
1884 EndDialog(hdlg, -123);
1885 return TRUE;
1886 }
1887 return FALSE;
1888}
1889
1890static void test_DialogBoxParam(void)
1891{
1892 static const WCHAR nameW[] = {'T','E','S','T','_','E','M','P','T','Y','_','D','I','A','L','O','G',0};
1893 INT_PTR ret;
1894 HWND hwnd_invalid = (HWND)0x4444;
1895
1896 ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_DLG_CHILD_POPUP", 0, TestControlStyleDlgProc, 0);
1897 ok(ret == -7, "expected -7, got %Id\n", ret);
1898
1899 SetLastError(0xdeadbeef);
1900 ret = DialogBoxParamA(GetModuleHandleA(NULL), "IDD_DIALOG" , hwnd_invalid, 0 , 0);
1901 ok(0 == ret || broken(ret == -1), "DialogBoxParamA returned %Id, expected 0\n", ret);
1903 broken(GetLastError() == 0xdeadbeef),
1904 "got %ld, expected ERROR_INVALID_WINDOW_HANDLE\n",GetLastError());
1905
1906 /* Test a dialog which destroys itself on WM_INITDIALOG. */
1907 SetLastError(0xdeadbeef);
1909 ok(-1 == ret, "DialogBoxParamA returned %Id, expected -1\n", ret);
1912 broken(GetLastError() == 0xdeadbeef),
1913 "got %ld, expected ERROR_INVALID_WINDOW_HANDLE\n",GetLastError());
1914
1915 /* Test a dialog which destroys itself on WM_CLOSE. */
1917 ok(0 == ret, "DialogBoxParamA returned %Id, expected 0\n", ret);
1918
1919 SetLastError(0xdeadbeef);
1920 ret = DialogBoxParamA(GetModuleHandleA(NULL), "RESOURCE_INVALID" , 0, 0, 0);
1921 ok(-1 == ret, "DialogBoxParamA returned %Id, expected -1\n", ret);
1923 broken(GetLastError() == 0xdeadbeef),
1924 "got %ld, expected ERROR_RESOURCE_NAME_NOT_FOUND\n",GetLastError());
1925
1926 SetLastError(0xdeadbeef);
1927 ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_DIALOG_INVALID_CLASS", 0, DestroyDlgWinProc, 0);
1928 ok(ret == -1, "DialogBoxParamA returned %Id, expected -1\n", ret);
1929 todo_wine
1931 broken(GetLastError() == ERROR_SUCCESS) /* < win10 21H1 */,
1932 "got %lu, expected ERROR_CANNOT_FIND_WND_CLASS\n", GetLastError());
1933
1934 SetLastError(0xdeadbeef);
1935 ret = DefDlgProcA(0, WM_ERASEBKGND, 0, 0);
1936 ok(ret == 0, "DefDlgProcA returned %Id, expected 0\n", ret);
1938 broken(GetLastError() == 0xdeadbeef),
1939 "got %ld, expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
1940
1941 ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, TestInitDialogHandleProc, 0);
1942 ok(ret == IDOK, "Expected IDOK\n");
1943
1944 ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, TestDefButtonDlgProc, 0);
1945 ok(ret == IDOK, "Expected IDOK\n");
1946
1947 ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, TestReturnKeyDlgProc, 0);
1948 ok(ret == 0, "Unexpected ret value %Id.\n", ret);
1949
1950 /* WM_SETTEXT handling in case of A/W dialog procedures vs A/W dialog window. */
1952 ok(ret == -123, "Unexpected ret value %Id.\n", ret);
1953
1955 ok(ret == -123, "Unexpected ret value %Id.\n", ret);
1956
1958 ok(ret == -123, "Unexpected ret value %Id.\n", ret);
1959
1961 ok(ret == -123, "Unexpected ret value %Id.\n", ret);
1962}
1963
1965{
1967 DialogBoxParamA(g_hinst, "IDD_DIALOG", NULL, disabled_test_proc, 0);
1968 ok(FALSE == g_terminated, "dialog with disabled ok button has been terminated\n");
1969}
1970
1972 LPARAM lParam)
1973{
1974 if (uiMsg == WM_INITDIALOG) {
1975 SetFocus(hDlg);
1976 return 1;
1977 }
1978
1979 return 0;
1980}
1981
1983{
1984 /* This dialog template defines a dialog template which got 0x7fff as its
1985 * font size and omits the other font members. On WinNT, passing such a
1986 * dialog template to CreateDialogIndirectParamW will result in a dialog
1987 * being created which uses the message box font. We test that here.
1988 */
1989
1990 static unsigned char dlgTemplate[] =
1991 {
1992 /* Dialog header */
1993 0x01,0x00, /* Version */
1994 0xff,0xff, /* Extended template marker */
1995 0x00,0x00,0x00,0x00, /* Context Help ID */
1996 0x00,0x00,0x00,0x00, /* Extended style */
1997 0xc0,0x00,0xc8,0x80, /* Style (WS_SYSMENU|WS_CAPTION|WS_POPUP|DS_SETFONT|DS_MODALFRAME) */
1998 0x01,0x00, /* Control count */
1999 0x00,0x00, /* X */
2000 0x00,0x00, /* Y */
2001 0x80,0x00, /* Width */
2002 0x80,0x00, /* Height */
2003 0x00,0x00, /* Menu name */
2004 0x00,0x00, /* Class name */
2005 'T',0x00,'e',0x00, /* Caption (unicode) */
2006 's',0x00,'t',0x00,
2007 0x00,0x00,
2008 0xff,0x7f, /* Font height (0x7fff = message box font) */
2009
2010 /* Control #1 */
2011 0x00,0x00, /* Align to DWORD (header is 42 bytes) */
2012 0x00,0x00,0x00,0x00, /* Context Help ID */
2013 0x00,0x00,0x00,0x00, /* Extended style */
2014 0x00,0x00,0x00,0x50, /* Style (WS_CHILD|WS_VISIBLE) */
2015 0x00,0x00, /* X */
2016 0x00,0x00, /* Y */
2017 0x80,0x00, /* Width */
2018 0x80,0x00, /* Height */
2019 0x00,0x01,0x00,0x00, /* Control ID (256) */
2020 0xff,0xff,0x82,0x00, /* Class (Static) */
2021 'W',0x00,'I',0x00, /* Caption (unicode) */
2022 'N',0x00,'E',0x00,
2023 ' ',0x00,'d',0x00,
2024 'i',0x00,'a',0x00,
2025 'l',0x00,'o',0x00,
2026 'g',0x00,' ',0x00,
2027 't',0x00,'e',0x00,
2028 's',0x00,'t',0x00,
2029 '.',0x00,0x00,0x00,
2030 0x00,0x00, /* Size of extended data */
2031
2032 0x00,0x00 /* Align to DWORD */
2033 };
2034
2035 HWND hDlg;
2036 HFONT hFont;
2037 LOGFONTW lfStaticFont;
2038 NONCLIENTMETRICSW ncMetrics;
2039
2040 /* Check if the dialog can be created from the template. On Win9x, this should fail
2041 * because we are calling the W function which is not implemented, but that's what
2042 * we want, because passing such a template to CreateDialogIndirectParamA would crash
2043 * anyway.
2044 */
2046 if (!hDlg)
2047 {
2048 win_skip("dialog wasn't created\n");
2049 return;
2050 }
2051
2052 hFont = (HFONT) SendDlgItemMessageW(hDlg, 256, WM_GETFONT, 0, 0);
2053 if (!hFont)
2054 {
2055 skip("dialog uses system font\n");
2056 DestroyWindow(hDlg);
2057 return;
2058 }
2059 GetObjectW(hFont, sizeof(LOGFONTW), &lfStaticFont);
2060
2061 ncMetrics.cbSize = FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth);
2062 SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &ncMetrics, 0);
2063 /* The height doesn't match on Windows 10 1709+. */
2064 ncMetrics.lfMessageFont.lfHeight = lfStaticFont.lfHeight;
2065 ok( !memcmp(&lfStaticFont, &ncMetrics.lfMessageFont, FIELD_OFFSET(LOGFONTW, lfFaceName)) &&
2066 !lstrcmpW(lfStaticFont.lfFaceName, ncMetrics.lfMessageFont.lfFaceName),
2067 "dialog doesn't use message box font\n");
2068 DestroyWindow(hDlg);
2069}
2070
2071static void test_SaveRestoreFocus(void)
2072{
2073 HWND hDlg;
2074 HRSRC hResource;
2075 HANDLE hTemplate;
2076 DLGTEMPLATE* pTemplate;
2077 LONG_PTR foundId;
2078 HWND foundHwnd;
2079
2080 /* create the dialog */
2081 hResource = FindResourceA(g_hinst, "MULTI_EDIT_DIALOG", (LPCSTR)RT_DIALOG);
2082 hTemplate = LoadResource(g_hinst, hResource);
2083 pTemplate = LockResource(hTemplate);
2084
2086 ok (hDlg != 0, "Failed to create test dialog.\n");
2087
2088 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2089 ok (foundId == 1000, "First edit box should have gained focus on dialog creation. Expected: %d, Found: %Id\n", 1000, foundId);
2090
2093 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2094 ok (foundId == 1001, "First edit box should have regained focus after dialog reactivation. Expected: %d, Found: %Id\n", 1001, foundId);
2096
2097 /* de- then reactivate the dialog */
2100
2101 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2102 ok (foundId == 1000, "First edit box should have regained focus after dialog reactivation. Expected: %d, Found: %Id\n", 1000, foundId);
2103
2104 /* select the next tabbable item */
2106
2107 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2108 ok (foundId == 1001, "Second edit box should have gained focus. Expected: %d, Found: %Id\n", 1001, foundId);
2109
2110 /* de- then reactivate the dialog */
2113
2114 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2115 ok (foundId == 1001, "Second edit box should have gained focus after dialog reactivation. Expected: %d, Found: %Id\n", 1001, foundId);
2116
2117 /* set focus to the dialog */
2118 SetFocus(hDlg);
2119
2120 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2121 ok (foundId == 1000, "First edit box should have gained focus on dialog focus. Expected: %d, Found: %Id\n", 1000, foundId);
2122
2123 /* select second tabbable item */
2125
2126 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2127 ok (foundId == 1001, "Second edit box should have gained focus. Expected: %d, Found: %Id\n", 1001, foundId);
2128
2129 /* send WM_ACTIVATE message to already active dialog */
2131
2132 foundId = GetWindowLongPtrA(GetFocus(), GWLP_ID);
2133 ok (foundId == 1001, "Second edit box should have gained focus. Expected: %d, Found: %Id\n", 1001, foundId);
2134
2135 /* disable the 2nd box */
2137
2138 foundHwnd = GetFocus();
2139 ok (foundHwnd == NULL, "Second edit box should have lost focus after being disabled. Expected: %p, Found: %p\n", NULL, foundHwnd);
2140
2141 /* de- then reactivate the dialog */
2144
2145 foundHwnd = GetFocus();
2146 ok (foundHwnd == NULL, "No controls should have gained focus after dialog reactivation. Expected: %p, Found: %p\n", NULL, foundHwnd);
2147
2148 /* clean up */
2149 DestroyWindow(hDlg);
2150}
2151
2153{
2154 static int count;
2155 BOOL visible;
2156
2157 switch (msg)
2158 {
2159 case WM_INITDIALOG:
2160 visible = GetWindowLongA(wnd, GWL_STYLE) & WS_VISIBLE;
2161 ok(!visible, "Dialog should not be visible.\n");
2162 SetTimer(wnd, 1, 100, NULL);
2163 Sleep(200);
2164 return FALSE;
2165
2166 case WM_COMMAND:
2167 if (LOWORD(wparam) != IDCANCEL) return FALSE;
2168 EndDialog(wnd, LOWORD(wparam));
2169 return TRUE;
2170
2171 case WM_TIMER:
2172 if (wparam != 1) return FALSE;
2173 visible = GetWindowLongA(wnd, GWL_STYLE) & WS_VISIBLE;
2174 if (!count++)
2175 {
2176 ok(!visible, "Dialog should not be visible.\n");
2177 PostMessageA(wnd, WM_USER, 0, 0);
2178 }
2179 else
2180 {
2181 ok(visible, "Dialog should be visible.\n");
2183 }
2184 return TRUE;
2185
2186 case WM_USER:
2187 visible = GetWindowLongA(wnd, GWL_STYLE) & WS_VISIBLE;
2188 ok(visible, "Dialog should be visible.\n");
2189 return TRUE;
2190
2191 default:
2192 return FALSE;
2193 }
2194}
2195
2196static void test_timer_message(void)
2197{
2198 DialogBoxA(g_hinst, "RADIO_TEST_DIALOG", NULL, timer_message_dlg_proc);
2199}
2200
2201static unsigned int msgbox_hook_proc_called;
2203
2205{
2206 static const LONG considered_ex_styles = WS_EX_CONTROLPARENT | WS_EX_WINDOWEDGE | WS_EX_DLGMODALFRAME | WS_EX_TOPMOST;
2207
2208 if (code == HCBT_ACTIVATE)
2209 {
2210 HWND msgbox = (HWND)wParam, msghwnd;
2211 LONG exstyles, expected_exstyles;
2212 BOOL system_modal;
2213 char text[64];
2214
2215 if (msgbox)
2216 {
2217 exstyles = GetWindowLongA(msgbox, GWL_EXSTYLE) & considered_ex_styles;
2218
2220 system_modal = msgbox_type & MB_SYSTEMMODAL && !(msgbox_type & MB_TASKMODAL);
2221 expected_exstyles = WS_EX_CONTROLPARENT | WS_EX_WINDOWEDGE;
2222 if ((msgbox_type & MB_TOPMOST) || system_modal)
2223 expected_exstyles |= WS_EX_TOPMOST;
2224 if (!system_modal)
2225 expected_exstyles |= WS_EX_DLGMODALFRAME;
2226
2227 todo_wine_if(system_modal && exstyles == (expected_exstyles | WS_EX_DLGMODALFRAME))
2228#ifdef __REACTOS__
2229 ok(exstyles == expected_exstyles || broken(exstyles == (expected_exstyles & ~WS_EX_TOPMOST)) /* Vista */, "got %#lx, expected %#lx\n", exstyles, expected_exstyles);
2230#else
2231 ok(exstyles == expected_exstyles, "got %#lx, expected %#lx\n", exstyles, expected_exstyles);
2232#endif
2233
2234 text[0] = 0;
2235 GetWindowTextA(msgbox, text, sizeof(text));
2236 ok(!strcmp(text, "MSGBOX caption"), "Unexpected window text \"%s\"\n", text);
2237
2238 msghwnd = GetDlgItem(msgbox, 0xffff);
2239 ok(msghwnd != NULL, "Expected static control\n");
2240
2241 text[0] = 0;
2242 GetWindowTextA(msghwnd, text, sizeof(text));
2243
2245 ok(!strcmp(text, "Text"), "Unexpected window text \"%s\"\n", text);
2246
2249 }
2250 }
2251
2253}
2254
2255static void test_MessageBox(void)
2256{
2257 static const UINT tests[] =
2258 {
2266 };
2267 unsigned int i;
2268 HHOOK hook;
2269 int ret;
2270
2272
2273 for (i = 0; i < ARRAY_SIZE(tests); ++i)
2274 {
2275 msgbox_type = tests[i];
2278 ret = MessageBoxA(NULL, "Text", "MSGBOX caption", msgbox_type);
2279 ok(ret == IDCANCEL, "got %d\n", ret);
2282 }
2283
2285}
2286
2288{
2289 if (msg == WM_INITDIALOG)
2290 EndDialog(hdlg, 0);
2291
2292 return FALSE;
2293}
2294
2296{
2297 DialogBoxA(g_hinst, "CUSTOM_TEST_DIALOG", NULL, custom_test_dialog_proc);
2298}
2299
2301{
2302 if (message == WM_INITDIALOG)
2303 {
2304 HWND child = (HWND)lparam;
2305 DWORD style;
2306
2307 ok(GetCapture() == child, "got capture %p\n", GetCapture());
2309 ok(!(style & WS_DISABLED), "child should not be disabled\n");
2310
2312 }
2313 else if (message == WM_USER)
2314 {
2315 HWND child = (HWND)lparam;
2316 DWORD style;
2317
2318 ok(!GetCapture(), "got capture %p\n", GetCapture());
2320 ok(!(style & WS_DISABLED), "child should not be disabled\n");
2321
2322 EndDialog(dialog, 1);
2323 }
2324 return FALSE;
2325}
2326
2328{
2329 if (message == WM_INITDIALOG)
2330 {
2331 HWND child = (HWND)lparam;
2332 DWORD style;
2333
2334 ok(GetCapture() == child, "got capture %p\n", GetCapture());
2336 ok(!(style & WS_DISABLED), "child should not be disabled\n");
2337
2338 PostMessageA(dialog, WM_QUIT, 0, 0);
2339 }
2340 return FALSE;
2341}
2342
2343static void test_capture_release(void)
2344{
2346 INT_PTR ret;
2347 MSG msg;
2348
2349 /* Set the capture to a child window. The main window will receive
2350 * WM_CANCELMODE when being disabled, but the child window will retain
2351 * capture. */
2352
2353 window = CreateWindowA("static", "parent", 0, 100, 200, 300, 400, NULL, NULL, NULL, NULL);
2354 child = CreateWindowA("static", "child", WS_CHILD, 10, 20, 100, 100, window, NULL, NULL, NULL);
2355
2358 ok(ret == 1, "got %#Ix\n", ret);
2359 ok(!GetCapture(), "got capture %p\n", GetCapture());
2360
2363 ok(ret == 1, "got %#Ix\n", ret);
2364 ok(!GetCapture(), "got capture %p\n", GetCapture());
2365
2367 dialog = CreateDialogParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG",
2369 ok(!!dialog, "failed to create dialog\n");
2370 ok(GetCapture() == child, "got capture %p\n", GetCapture());
2372 ok(GetCapture() == child, "got capture %p\n", GetCapture());
2373 while (GetMessageA(&msg, NULL, 0, 0))
2375 ok(GetCapture() == child, "got capture %p\n", GetCapture());
2376
2378
2381}
2382
2385static char cs_name_paramA[4];
2386
2388{
2389 if (msg == WM_NCCREATE)
2390 {
2392 memcpy( cs_name_paramW, cs->lpszName, sizeof(cs_name_paramW) );
2393 }
2394
2396}
2397
2399{
2400 if (msg == WM_NCCREATE)
2401 {
2403 memcpy( cs_name_paramA, cs->lpszName, sizeof(cs_name_paramA) );
2404 }
2405
2407}
2408
2409static void test_create_controls(void)
2410{
2411 HWND control;
2412 INT_PTR ret;
2413
2414 control = CreateWindowA("static", "", 0, 100, 200, 300, 400, NULL, NULL, NULL, NULL);
2415 ok(control != 0, "failed to create control window\n");
2416
2418
2419 cs_name_paramW[0] = 0;
2420 ret = DialogBoxParamA(GetModuleHandleA(NULL), "IDD_SS_ICON_DIALOG", 0, DestroyOnCloseDlgWinProc, 0);
2421 ok(0 == ret, "DialogBoxParamA returned %Id, expected 0\n", ret);
2422 ok(!memcmp(cs_name_paramA, "\xff\0\x61", 3), "name param = %s\n", debugstr_an(cs_name_paramA, 3));
2423
2426
2427 control = CreateWindowW(L"static", L"", 0, 100, 200, 300, 400, NULL, NULL, NULL, NULL);
2428 ok(control != 0, "failed to create control window\n");
2429
2431
2432 ret = DialogBoxParamW(GetModuleHandleW(NULL), L"IDD_SS_ICON_DIALOG", 0, DestroyOnCloseDlgWinProc, 0);
2433 ok(0 == ret, "DialogBoxParamW returned %Id, expected 0\n", ret);
2434 ok(!memcmp(cs_name_paramW, L"\xffff\x6100", 2 * sizeof(WCHAR)),
2435 "name param = %s\n", debugstr_wn(cs_name_paramW, 2));
2436
2439}
2440
2442{
2444
2445 if (!RegisterWindowClasses()) assert(0);
2446
2451 test_focus();
2462}
@ lparam
Definition: SystemMenu.c:31
@ hook
Definition: SystemMenu.c:35
@ wparam
Definition: SystemMenu.c:30
Arabic default style
Definition: afstyles.h:94
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
static const WCHAR nameW[]
Definition: main.c:49
HFONT hFont
Definition: main.c:53
#define ARRAY_SIZE(A)
Definition: main.h:20
#define ULongToHandle(h)
Definition: basetsd.h:75
#define HandleToULong(h)
Definition: basetsd.h:89
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define DLGPROC
Definition: maze.c:62
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
HANDLE HWND
Definition: compat.h:19
#define CALLBACK
Definition: compat.h:35
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
UINT WINAPI GetACP(void)
Definition: locale.c:2023
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1182
const WCHAR * text
Definition: package.c:1794
#define assert(_expr)
Definition: assert.h:32
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3319
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
static unsigned char buff[32768]
Definition: fatten.c:17
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum mode
Definition: glext.h:6217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLuint id
Definition: glext.h:5910
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define cs
Definition: i386-dis.c:442
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
#define a
Definition: ke_i.h:78
#define debugstr_wn
Definition: kernel32.h:33
#define wine_dbgstr_w
Definition: kernel32.h:34
#define win_skip
Definition: minitest.h:67
#define todo_wine_if(is_todo)
Definition: minitest.h:81
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
Definition: test.h:537
#define todo_wine
Definition: minitest.h:80
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static struct test_info tests[]
#define sprintf
Definition: sprintf.c:45
static const char textA[]
Definition: registrar.c:40
DWORD button
Definition: button.c:166
static HINSTANCE hinst
Definition: edit.c:551
BOOL expected
Definition: store.c:2000
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static IHTMLWindow2 * window
Definition: events.c:77
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static HWND child
Definition: cursoricon.c:298
static unsigned int numwnds
Definition: dialog.c:45
static BOOL g_terminated
Definition: dialog.c:56
static HWND g_hwndInitialFocusT1
Definition: dialog.c:51
static LRESULT WINAPI test_static_create_procW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:2387
static INT_PTR CALLBACK messageBoxFontDlgWinProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1971
static const char * testtext
Definition: dialog.c:1459
static BOOL OnMainWindowCreate(HWND hwnd, LPCREATESTRUCTA lpcs)
Definition: dialog.c:411
static LRESULT CALLBACK test_IsDialogMessageA_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:582
static void test_MessageBox(void)
Definition: dialog.c:2255
static LRESULT CALLBACK hook_proc2(INT code, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:766
static void test_WM_NEXTDLGCTL(void)
Definition: dialog.c:647
static unsigned int msgbox_hook_proc_called
Definition: dialog.c:2201
static LONG g_styleInitialFocusT1
Definition: dialog.c:53
static WCHAR cs_name_paramW[3]
Definition: dialog.c:2384
static void test_IsDialogMessage(void)
Definition: dialog.c:773
static INT_PTR CALLBACK EmptyProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:959
static LRESULT CALLBACK hook_proc(INT code, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:759
static void test_dialog_custom_data(void)
Definition: dialog.c:2295
static HWND g_hwndTestDlg
Definition: dialog.c:50
static INT_PTR CALLBACK focusChildDlgWinProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:968
static INT_PTR CALLBACK test_aw_conversion_dlgprocW(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1531
static void dlg_test_aw_message(HWND hdlg, UINT msg)
Definition: dialog.c:1579
static INT_PTR CALLBACK delayFocusDlgWinProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:898
static BOOL g_bInitialFocusInitDlgResult
Definition: dialog.c:54
static INT_PTR CALLBACK TestDefButtonDlgProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1370
static const char * testmodes[]
Definition: dialog.c:1471
static int wm_char_count
Definition: dialog.c:571
static HINSTANCE g_hinst
Definition: dialog.c:48
static INT_PTR CALLBACK timer_message_dlg_proc(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:2152
static HWND g_hwndInitialFocusT2
Definition: dialog.c:51
static void test_focus(void)
Definition: dialog.c:1028
static HWND g_hwndTestDlgBut1
Definition: dialog.c:50
static void test_GetDlgItemText(void)
Definition: dialog.c:1220
static void test_GetNextDlgItem(void)
Definition: dialog.c:348
static BOOL OnTestDlgCreate(HWND hwnd, LPCREATESTRUCTA lpcs)
Definition: dialog.c:436
static INT_PTR CALLBACK focusDlgWinProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:938
static void test_SaveRestoreFocus(void)
Definition: dialog.c:2071
static HWND g_hwndTestDlgBut2
Definition: dialog.c:50
static const WCHAR testtextW[]
Definition: dialog.c:1458
static INT_PTR CALLBACK custom_test_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:2287
static HWND g_hwndButtonCancel
Definition: dialog.c:49
static DWORD get_button_style(HWND button)
Definition: dialog.c:150
static BOOL g_button1Clicked
Definition: dialog.c:57
static void test_GetDlgItem(void)
Definition: dialog.c:1270
static INT_PTR CALLBACK capture_release_proc(HWND dialog, UINT message, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:2300
static void FormTabMsg(MSG *pMsg, HWND hwnd)
Definition: dialog.c:224
static HWND g_hwndButton1
Definition: dialog.c:49
static INT_PTR CALLBACK disabled_test_proc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:492
static const char * GetHwndString(HWND hw)
Definition: dialog.c:1010
static UINT msgbox_type
Definition: dialog.c:2202
defdlgproc_text
Definition: dialog.c:1462
@ DLGPROCTEXT_SNDMSGA
Definition: dialog.c:1463
@ DLGPROCTEXT_SETTEXTW
Definition: dialog.c:1468
@ DLGPROCTEXT_DLGPROCW
Definition: dialog.c:1466
@ DLGPROCTEXT_DLGPROCA
Definition: dialog.c:1465
@ DLGPROCTEXT_SNDMSGW
Definition: dialog.c:1464
@ DLGPROCTEXT_SETTEXTA
Definition: dialog.c:1467
static INT_PTR CALLBACK test_aw_conversion_dlgproc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1594
static INT_PTR CALLBACK TestControlStyleDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1422
static DWORD KeyDownData(int repeat, int scancode, int extended, int wasdown)
Definition: dialog.c:217
static LRESULT CALLBACK testDlgWinProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:530
static HWND g_hwndInitialFocusGroupBox
Definition: dialog.c:51
static void test_capture_release(void)
Definition: dialog.c:2343
static INT_PTR CALLBACK DestroyDlgWinProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1325
static BOOL CreateWindows(HINSTANCE hinst)
Definition: dialog.c:155
static HWND g_hwndTestDlgEdit
Definition: dialog.c:50
static INT_PTR CALLBACK TestInitDialogHandleProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1354
static BOOL g_bReceivedCommand
Definition: dialog.c:54
static INT_PTR CALLBACK test_aw_conversion_dlgproc3(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1850
static HWND g_hwndMain
Definition: dialog.c:49
static void FormEnterMsg(MSG *pMsg, HWND hwnd)
Definition: dialog.c:235
static INT_PTR CALLBACK DestroyOnCloseDlgWinProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1336
static BOOL is_cjk(void)
Definition: dialog.c:573
static const h_entry hierarchy[]
Definition: dialog.c:66
static char cs_name_paramA[4]
Definition: dialog.c:2385
static void test_DialogBoxParam(void)
Definition: dialog.c:1890
static void test_MessageBoxFontTest(void)
Definition: dialog.c:1982
static LRESULT WINAPI test_static_create_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:2398
static LRESULT CALLBACK test_control_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:551
static void test_create_controls(void)
Definition: dialog.c:2409
static void test_timer_message(void)
Definition: dialog.c:2196
static WNDPROC orig_static_proc
Definition: dialog.c:2383
static INT_PTR CALLBACK TestReturnKeyDlgProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1382
static LONG g_styleInitialFocusT2
Definition: dialog.c:53
static BOOL RegisterWindowClasses(void)
Definition: dialog.c:608
static INT_PTR CALLBACK capture_release_modeless_proc(HWND dialog, UINT message, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:2327
static BOOL g_MSGF_DIALOGBOX
Definition: dialog.c:765
static LRESULT CALLBACK main_window_procA(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:462
static LRESULT CALLBACK test_aw_conversion_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1808
static LRESULT CALLBACK msgbox_hook_proc(INT code, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2204
static INT_PTR CALLBACK test_aw_conversion_dlgprocA(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1481
static INT_PTR CALLBACK getdlgitem_test_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1233
static void test_DisabledDialogTest(void)
Definition: dialog.c:1964
#define MAXHWNDS
Definition: dialog.c:43
static HWND g_hwndButton2
Definition: dialog.c:49
static INT_PTR CALLBACK test_aw_conversion_dlgproc2(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: dialog.c:1702
#define menu
Definition: input.c:3273
static HWND dialog
Definition: gui.c:33
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_EX_NOPARENTNOTIFY
Definition: pedump.c:646
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_GROUP
Definition: pedump.c:633
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_VISIBLE
Definition: pedump.c:620
#define RT_DIALOG
Definition: pedump.c:367
#define WS_EX_TOPMOST
Definition: pedump.c:647
long LONG
Definition: pedump.c:60
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define WS_DISABLED
Definition: pedump.c:621
#define WS_DLGFRAME
Definition: pedump.c:626
#define ES_LEFT
Definition: pedump.c:664
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_POPUPWINDOW
Definition: pedump.c:638
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
static char title[]
Definition: ps.c:92
#define test
Definition: rosglue.h:37
static calc_node_t temp
Definition: rpn_ieee.c:38
#define LANG_HINDI
Definition: nls.h:68
#define LANG_CHINESE
Definition: nls.h:42
#define CP_UTF8
Definition: nls.h:20
#define LANG_JAPANESE
Definition: nls.h:76
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define LANG_KOREAN
Definition: nls.h:84
strcpy
Definition: string.h:131
#define memset(x, y, z)
Definition: compat.h:39
LONG lfHeight
Definition: dimm.idl:59
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
HBRUSH hbrBackground
Definition: winuser.h:3278
HICON hIcon
Definition: winuser.h:3276
HINSTANCE hInstance
Definition: winuser.h:3275
HCURSOR hCursor
Definition: winuser.h:3277
int cbWndExtra
Definition: winuser.h:3274
UINT style
Definition: winuser.h:3271
LPCSTR lpszMenuName
Definition: winuser.h:3279
LPCSTR lpszClassName
Definition: winuser.h:3280
WNDPROC lpfnWndProc
Definition: winuser.h:3272
int cbClsExtra
Definition: winuser.h:3273
LPCWSTR lpszClassName
Definition: winuser.h:3293
HINSTANCE hInstance
Definition: winuser.h:3288
WNDPROC lpfnWndProc
Definition: winuser.h:3285
Definition: inflate.c:139
Definition: dialog.c:52
Definition: dialog.c:59
DWORD style
Definition: dialog.c:62
int parent
Definition: dialog.c:61
DWORD exstyle
Definition: dialog.c:63
INT_PTR id
Definition: dialog.c:60
Definition: tftpd.h:60
int isok
Definition: dialog.c:252
int res
Definition: dialog.c:258
int tab
Definition: dialog.c:256
int prev
Definition: dialog.c:257
int dlg
Definition: dialog.c:254
int ctl
Definition: dialog.c:255
int test
Definition: dialog.c:253
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:726
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define HIWORD(l)
Definition: typedefs.h:247
int retval
Definition: wcstombs.cpp:91
UINT WINAPI GetDlgItemTextA(HWND hDlg, int nIDDlgItem, LPSTR lpString, int nMaxCount)
Definition: dialog.c:2245
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1300
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:1226
#define ERROR_RESOURCE_NAME_NOT_FOUND
Definition: winerror.h:1478
#define ERROR_CANNOT_FIND_WND_CLASS
Definition: winerror.h:1233
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define SW_SHOWNORMAL
Definition: winuser.h:781
HWND WINAPI GetFocus(void)
Definition: window.c:1863
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define LB_ADDFILE
Definition: winuser.h:2059
#define WM_ERASEBKGND
Definition: winuser.h:1653
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define MB_TOPMOST
Definition: winuser.h:836
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
#define SetWindowLongPtrA
Definition: winuser.h:5511
#define SetClassLongPtrW
Definition: winuser.h:5431
#define WM_CLOSE
Definition: winuser.h:1649
#define DM_SETDEFID
Definition: winuser.h:2135
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define VK_TAB
Definition: winuser.h:2235
#define SetClassLongPtrA
Definition: winuser.h:5430
#define WM_QUIT
Definition: winuser.h:1651
BOOL WINAPI TranslateMessage(_In_ const MSG *)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define COLOR_WINDOW
Definition: winuser.h:929
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HANDLE WINAPI GetPropA(_In_ HWND, _In_ LPCSTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
HWND WINAPI CreateDialogParamA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDCANCEL
Definition: winuser.h:842
#define MSGF_DIALOGBOX
Definition: winuser.h:1184
BOOL WINAPI SetPropA(_In_ HWND, _In_ LPCSTR, _In_opt_ HANDLE)
#define DWLP_DLGPROC
Definition: winuser.h:882
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DefDlgProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define MB_SYSTEMMODAL
Definition: winuser.h:826
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define WM_CREATE
Definition: winuser.h:1636
#define DLGC_WANTCHARS
Definition: winuser.h:2660
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define EM_GETSEL
Definition: winuser.h:2026
#define EN_SETFOCUS
Definition: winuser.h:2056
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define HCBT_ACTIVATE
Definition: winuser.h:60
#define LB_DIR
Definition: winuser.h:2062
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define WH_MSGFILTER
Definition: winuser.h:29
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define BS_TYPEMASK
Definition: winuser.h:270
#define SWP_NOMOVE
Definition: winuser.h:1255
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_WININICHANGE
Definition: winuser.h:1658
#define EM_REPLACESEL
Definition: winuser.h:2035
HWND WINAPI GetTopWindow(_In_opt_ HWND)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define WM_DEVMODECHANGE
Definition: winuser.h:1659
#define MB_TASKMODAL
Definition: winuser.h:827
#define IDC_ARROW
Definition: winuser.h:695
#define GCLP_WNDPROC
Definition: winuser.h:686
#define DC_HASDEFID
Definition: winuser.h:2651
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETFOCUS
Definition: winuser.h:1641
#define DS_3DLOOK
Definition: winuser.h:367
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define GetWindowLongPtrA
Definition: winuser.h:4982
#define DS_MODALFRAME
Definition: winuser.h:375
#define WA_INACTIVE
Definition: winuser.h:2664
#define WM_INITDIALOG
Definition: winuser.h:1767
#define WM_LBUTTONDOWN
Definition: winuser.h:1804
#define WH_CBT
Definition: winuser.h:35
#define CB_DIR
Definition: winuser.h:1967
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2657
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
#define WM_GETFONT
Definition: winuser.h:1679
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
#define WM_NEXTDLGCTL
Definition: winuser.h:1671
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_NCCREATE
Definition: winuser.h:1711
#define DialogBoxA(i, t, p, f)
Definition: winuser.h:4552
#define BM_SETCHECK
Definition: winuser.h:1950
HHOOK WINAPI SetWindowsHookExA(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
#define WM_ACTIVATE
Definition: winuser.h:1640
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_OKCANCEL
Definition: winuser.h:815
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define WM_SETTEXT
Definition: winuser.h:1645
BOOL WINAPI IsWindowUnicode(_In_ HWND)
HWND WINAPI GetNextDlgGroupItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define VK_RETURN
Definition: winuser.h:2237
#define MAKELRESULT(l, h)
Definition: winuser.h:4118
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
BOOL WINAPI IsDialogMessageA(_In_ HWND, _In_ LPMSG)
#define WM_TIMER
Definition: winuser.h:1770
HWND WINAPI CreateDialogIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define DS_SETFONT
Definition: winuser.h:378
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define BM_SETSTYLE
Definition: winuser.h:1953
#define EM_SETSEL
Definition: winuser.h:2047
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
BOOL WINAPI GetClassInfoA(_In_opt_ HINSTANCE, _In_ LPCSTR, _Out_ LPWNDCLASSA)
#define WM_LBUTTONUP
Definition: winuser.h:1805
#define BS_TEXT
Definition: winuser.h:276
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define WM_CHAR
Definition: winuser.h:1745
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define CW_USEDEFAULT
Definition: winuser.h:225
#define WA_ACTIVE
Definition: winuser.h:2665
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define GWLP_ID
Definition: winuser.h:871
#define WM_USER
Definition: winuser.h:1923
#define WM_DESTROY
Definition: winuser.h:1637
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WM_KEYDOWN
Definition: winuser.h:1743
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
#define DM_GETDEFID
Definition: winuser.h:2134
#define SetWindowLongPtrW
Definition: winuser.h:5512
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
LRESULT WINAPI SendDlgItemMessageA(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WS_EX_LEFT
Definition: winuser.h:391
HWND WINAPI CreateDialogIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DS_CONTROL
Definition: winuser.h:372
#define WM_GETDLGCODE
Definition: winuser.h:1717
INT_PTR WINAPI DialogBoxParamA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2459
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define GWL_EXSTYLE
Definition: winuser.h:862
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193