ReactOS  0.4.14-dev-114-gc8cbd56
NextDlgItem.c File Reference
#include "precomp.h"
#include <windowsx.h>
#include <dlgs.h>
Include dependency graph for NextDlgItem.c:

Go to the source code of this file.

Macros

#define IDC_TEST1   1
 
#define IDC_TEST2   2
 
#define IDC_TEST3   3
 
#define IDC_END   9
 

Functions

static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
 
static const charGetNameFromID (INT ID)
 
static const charGetNameFromHWND (HWND hwnd)
 
static void DoTest1 (HWND hwnd)
 
static void DoTest2 (HWND hwnd)
 
static POINT GetCtrlCenter (HWND hCtrl)
 
static void DoTest3 (HWND hwnd)
 
static void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
INT_PTR CALLBACK RadioButtonDialogProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
 START_TEST (NextDlgItem)
 

Macro Definition Documentation

◆ IDC_END

#define IDC_END   9

Definition at line 16 of file NextDlgItem.c.

◆ IDC_TEST1

#define IDC_TEST1   1

Definition at line 13 of file NextDlgItem.c.

◆ IDC_TEST2

#define IDC_TEST2   2

Definition at line 14 of file NextDlgItem.c.

◆ IDC_TEST3

#define IDC_TEST3   3

Definition at line 15 of file NextDlgItem.c.

Function Documentation

◆ DoTest1()

static void DoTest1 ( HWND  hwnd)
static

Definition at line 50 of file NextDlgItem.c.

51 {
52  HWND hCtrl;
53  HWND hRad1, hRad2, hRad3, hPsh1, hRad5, hRad6, hRad7, hOK, hCancel;
54 
55  // check control IDs
56  hCtrl = GetDlgItem(hwnd, rad1);
57  ok(GetDlgCtrlID(hCtrl) == rad1, "\n");
58  hCtrl = GetDlgItem(hwnd, rad2);
59  ok(GetDlgCtrlID(hCtrl) == rad2, "\n");
60  hCtrl = GetDlgItem(hwnd, rad3);
61  ok(GetDlgCtrlID(hCtrl) == rad3, "\n");
62  hCtrl = GetDlgItem(hwnd, psh1);
63  ok(GetDlgCtrlID(hCtrl) == psh1, "\n");
64  hCtrl = GetDlgItem(hwnd, rad5);
65  ok(GetDlgCtrlID(hCtrl) == rad5, "\n");
66  hCtrl = GetDlgItem(hwnd, rad6);
67  ok(GetDlgCtrlID(hCtrl) == rad6, "\n");
68  hCtrl = GetDlgItem(hwnd, rad7);
69  ok(GetDlgCtrlID(hCtrl) == rad7, "\n");
70  hCtrl = GetDlgItem(hwnd, IDOK);
71  ok(GetDlgCtrlID(hCtrl) == IDOK, "\n");
72  hCtrl = GetDlgItem(hwnd, IDCANCEL);
73  ok(GetDlgCtrlID(hCtrl) == IDCANCEL, "\n");
74 
75  // get dialog items
76  hRad1 = GetDlgItem(hwnd, rad1);
77  hRad2 = GetDlgItem(hwnd, rad2);
78  hRad3 = GetDlgItem(hwnd, rad3);
79  hPsh1 = GetDlgItem(hwnd, psh1);
80  hRad5 = GetDlgItem(hwnd, rad5);
81  hRad6 = GetDlgItem(hwnd, rad6);
82  hRad7 = GetDlgItem(hwnd, rad7);
83  hOK = GetDlgItem(hwnd, IDOK);
84  hCancel = GetDlgItem(hwnd, IDCANCEL);
85 
86  // next
87  hCtrl = GetNextDlgTabItem(hwnd, hRad1, FALSE);
88  ok(hCtrl == hRad2, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
89  hCtrl = GetNextDlgTabItem(hwnd, hRad2, FALSE);
90  ok(hCtrl == hRad3, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
91  hCtrl = GetNextDlgTabItem(hwnd, hRad3, FALSE);
92  ok(hCtrl == hPsh1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
93  hCtrl = GetNextDlgTabItem(hwnd, hPsh1, FALSE);
94  ok(hCtrl == hRad5, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
95  hCtrl = GetNextDlgTabItem(hwnd, hRad5, FALSE);
96  ok(hCtrl == hRad6, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
97  hCtrl = GetNextDlgTabItem(hwnd, hRad6, FALSE);
98  ok(hCtrl == hRad7, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
99  hCtrl = GetNextDlgTabItem(hwnd, hRad7, FALSE);
100  ok(hCtrl == hOK, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
101  hCtrl = GetNextDlgTabItem(hwnd, hOK, FALSE);
102  ok(hCtrl == hCancel, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
103  hCtrl = GetNextDlgTabItem(hwnd, hCancel, FALSE);
104  ok(hCtrl == hRad1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
105 
106  // prev
107  hCtrl = GetNextDlgTabItem(hwnd, hRad1, TRUE);
108  ok(hCtrl == hCancel, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
109  hCtrl = GetNextDlgTabItem(hwnd, hRad2, TRUE);
110  ok(hCtrl == hRad1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
111  hCtrl = GetNextDlgTabItem(hwnd, hRad3, TRUE);
112  ok(hCtrl == hRad2, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
113  hCtrl = GetNextDlgTabItem(hwnd, hPsh1, TRUE);
114  ok(hCtrl == hRad3, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
115  hCtrl = GetNextDlgTabItem(hwnd, hRad5, TRUE);
116  ok(hCtrl == hPsh1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
117  hCtrl = GetNextDlgTabItem(hwnd, hRad6, TRUE);
118  ok(hCtrl == hRad5, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
119  hCtrl = GetNextDlgTabItem(hwnd, hRad7, TRUE);
120  ok(hCtrl == hRad6, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
121  hCtrl = GetNextDlgTabItem(hwnd, hOK, TRUE);
122  ok(hCtrl == hRad7, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
123  hCtrl = GetNextDlgTabItem(hwnd, hCancel, TRUE);
124  ok(hCtrl == hOK, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
125 
126  // hide
127  ok(ShowWindow(hRad3, SW_HIDE) != 0, "\n");
128  ok(ShowWindow(hRad6, SW_HIDE) != 0, "\n");
129 
130  // next with hidden
131  hCtrl = GetNextDlgTabItem(hwnd, hRad1, FALSE);
132  ok(hCtrl == hRad2, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
133  hCtrl = GetNextDlgTabItem(hwnd, hRad2, FALSE);
134  ok(hCtrl == hPsh1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
135  hCtrl = GetNextDlgTabItem(hwnd, hPsh1, FALSE);
136  ok(hCtrl == hRad5, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
137  hCtrl = GetNextDlgTabItem(hwnd, hRad5, FALSE);
138  ok(hCtrl == hRad7, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
139  hCtrl = GetNextDlgTabItem(hwnd, hRad7, FALSE);
140  ok(hCtrl == hOK, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
141  hCtrl = GetNextDlgTabItem(hwnd, hOK, FALSE);
142  ok(hCtrl == hCancel, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
143  hCtrl = GetNextDlgTabItem(hwnd, hCancel, FALSE);
144  ok(hCtrl == hRad1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
145 
146  // prev with hidden
147  hCtrl = GetNextDlgTabItem(hwnd, hRad1, TRUE);
148  ok(hCtrl == hCancel, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
149  hCtrl = GetNextDlgTabItem(hwnd, hRad2, TRUE);
150  ok(hCtrl == hRad1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
151  hCtrl = GetNextDlgTabItem(hwnd, hPsh1, TRUE);
152  ok(hCtrl == hRad2, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
153  hCtrl = GetNextDlgTabItem(hwnd, hRad5, TRUE);
154  ok(hCtrl == hPsh1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
155  hCtrl = GetNextDlgTabItem(hwnd, hRad7, TRUE);
156  ok(hCtrl == hRad5, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
157  hCtrl = GetNextDlgTabItem(hwnd, hOK, TRUE);
158  ok(hCtrl == hRad7, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
159  hCtrl = GetNextDlgTabItem(hwnd, hCancel, TRUE);
160  ok(hCtrl == hOK, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
161 
162  // show
165 
166  // next again
167  hCtrl = GetNextDlgTabItem(hwnd, hRad1, FALSE);
168  ok(hCtrl == hRad2, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
169  hCtrl = GetNextDlgTabItem(hwnd, hRad2, FALSE);
170  ok(hCtrl == hRad3, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
171  hCtrl = GetNextDlgTabItem(hwnd, hRad3, FALSE);
172  ok(hCtrl == hPsh1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
173  hCtrl = GetNextDlgTabItem(hwnd, hPsh1, FALSE);
174  ok(hCtrl == hRad5, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
175  hCtrl = GetNextDlgTabItem(hwnd, hRad5, FALSE);
176  ok(hCtrl == hRad6, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
177  hCtrl = GetNextDlgTabItem(hwnd, hRad6, FALSE);
178  ok(hCtrl == hRad7, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
179  hCtrl = GetNextDlgTabItem(hwnd, hRad7, FALSE);
180  ok(hCtrl == hOK, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
181  hCtrl = GetNextDlgTabItem(hwnd, hOK, FALSE);
182  ok(hCtrl == hCancel, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
183  hCtrl = GetNextDlgTabItem(hwnd, hCancel, FALSE);
184  ok(hCtrl == hRad1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
185 
186  // prev again
187  hCtrl = GetNextDlgTabItem(hwnd, hRad1, TRUE);
188  ok(hCtrl == hCancel, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
189  hCtrl = GetNextDlgTabItem(hwnd, hRad2, TRUE);
190  ok(hCtrl == hRad1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
191  hCtrl = GetNextDlgTabItem(hwnd, hRad3, TRUE);
192  ok(hCtrl == hRad2, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
193  hCtrl = GetNextDlgTabItem(hwnd, hPsh1, TRUE);
194  ok(hCtrl == hRad3, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
195  hCtrl = GetNextDlgTabItem(hwnd, hRad5, TRUE);
196  ok(hCtrl == hPsh1, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
197  hCtrl = GetNextDlgTabItem(hwnd, hRad6, TRUE);
198  ok(hCtrl == hRad5, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
199  hCtrl = GetNextDlgTabItem(hwnd, hRad7, TRUE);
200  ok(hCtrl == hRad6, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
201  hCtrl = GetNextDlgTabItem(hwnd, hOK, TRUE);
202  ok(hCtrl == hRad7, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
203  hCtrl = GetNextDlgTabItem(hwnd, hCancel, TRUE);
204  ok(hCtrl == hOK, "hCtrl was %s\n", GetNameFromHWND(hCtrl));
205 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
#define rad6
Definition: dlgs.h:135
#define rad2
Definition: dlgs.h:131
int WINAPI GetDlgCtrlID(_In_ HWND)
static const char * GetNameFromHWND(HWND hwnd)
Definition: NextDlgItem.c:44
#define rad5
Definition: dlgs.h:134
#define psh1
Definition: dlgs.h:112
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define rad7
Definition: dlgs.h:136
#define rad3
Definition: dlgs.h:132
#define ok(value,...)
Definition: atltest.h:57
#define IDCANCEL
Definition: winuser.h:825
#define rad1
Definition: dlgs.h:130

Referenced by OnCommand().

◆ DoTest2()

static void DoTest2 ( HWND  hwnd)
static

Definition at line 208 of file NextDlgItem.c.

209 {
210  HWND hCtrl;
211  HWND hRad1, hRad2, hRad3, hPsh1, hRad5, hRad6, hRad7, hOK, hCancel;
212 
213  // check control IDs
214  hCtrl = GetDlgItem(hwnd, rad1);
215  ok(GetDlgCtrlID(hCtrl) == rad1, "\n");
216  hCtrl = GetDlgItem(hwnd, rad2);
217  ok(GetDlgCtrlID(hCtrl) == rad2, "\n");
218  hCtrl = GetDlgItem(hwnd, rad3);
219  ok(GetDlgCtrlID(hCtrl) == rad3, "\n");
220  hCtrl = GetDlgItem(hwnd, psh1);
221  ok(GetDlgCtrlID(hCtrl) == psh1, "\n");
222  hCtrl = GetDlgItem(hwnd, rad5);
223  ok(GetDlgCtrlID(hCtrl) == rad5, "\n");
224  hCtrl = GetDlgItem(hwnd, rad6);
225  ok(GetDlgCtrlID(hCtrl) == rad6, "\n");
226  hCtrl = GetDlgItem(hwnd, rad7);
227  ok(GetDlgCtrlID(hCtrl) == rad7, "\n");
228  hCtrl = GetDlgItem(hwnd, IDOK);
229  ok(GetDlgCtrlID(hCtrl) == IDOK, "\n");
230  hCtrl = GetDlgItem(hwnd, IDCANCEL);
231  ok(GetDlgCtrlID(hCtrl) == IDCANCEL, "\n");
232 
233  // get dialog items
234  hRad1 = GetDlgItem(hwnd, rad1);
235  hRad2 = GetDlgItem(hwnd, rad2);
236  hRad3 = GetDlgItem(hwnd, rad3);
237  hPsh1 = GetDlgItem(hwnd, psh1);
238  hRad5 = GetDlgItem(hwnd, rad5);
239  hRad6 = GetDlgItem(hwnd, rad6);
240  hRad7 = GetDlgItem(hwnd, rad7);
241  hOK = GetDlgItem(hwnd, IDOK);
242  hCancel = GetDlgItem(hwnd, IDCANCEL);
243 
244  // group next
245  hCtrl = GetNextDlgGroupItem(hwnd, hRad1, FALSE);
246  ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
247  hCtrl = GetNextDlgGroupItem(hwnd, hRad2, FALSE);
248  ok(hCtrl == hRad3, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
249  hCtrl = GetNextDlgGroupItem(hwnd, hRad3, FALSE);
250  ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
251  hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, FALSE);
252  ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
253  hCtrl = GetNextDlgGroupItem(hwnd, hRad5, FALSE);
254  ok(hCtrl == hRad6, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
255  hCtrl = GetNextDlgGroupItem(hwnd, hRad6, FALSE);
256  ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
257  hCtrl = GetNextDlgGroupItem(hwnd, hRad7, FALSE);
258  ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
259  hCtrl = GetNextDlgGroupItem(hwnd, hOK, FALSE);
260  ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
261  hCtrl = GetNextDlgGroupItem(hwnd, hCancel, FALSE);
262  ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
263 
264  // group prev
265  hCtrl = GetNextDlgGroupItem(hwnd, hRad1, TRUE);
266  ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
267  hCtrl = GetNextDlgGroupItem(hwnd, hRad2, TRUE);
268  ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
269  hCtrl = GetNextDlgGroupItem(hwnd, hRad3, TRUE);
270  ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
271  hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, TRUE);
272  ok(hCtrl == hRad3, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
273  hCtrl = GetNextDlgGroupItem(hwnd, hRad5, TRUE);
274  ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
275  hCtrl = GetNextDlgGroupItem(hwnd, hRad6, TRUE);
276  ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
277  hCtrl = GetNextDlgGroupItem(hwnd, hRad7, TRUE);
278  ok(hCtrl == hRad6, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
279  hCtrl = GetNextDlgGroupItem(hwnd, hOK, TRUE);
280  ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
281  hCtrl = GetNextDlgGroupItem(hwnd, hCancel, TRUE);
282  ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
283 
284  // hide
285  ok(ShowWindow(hRad3, SW_HIDE) != 0, "\n");
286  ok(ShowWindow(hRad6, SW_HIDE) != 0, "\n");
287 
288  // group next with hidden
289  hCtrl = GetNextDlgGroupItem(hwnd, hRad1, FALSE);
290  ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
291  hCtrl = GetNextDlgGroupItem(hwnd, hRad2, FALSE);
292  ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
293  hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, FALSE);
294  ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
295  hCtrl = GetNextDlgGroupItem(hwnd, hRad5, FALSE);
296  ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
297  hCtrl = GetNextDlgGroupItem(hwnd, hRad7, FALSE);
298  ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
299  hCtrl = GetNextDlgGroupItem(hwnd, hOK, FALSE);
300  ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
301  hCtrl = GetNextDlgGroupItem(hwnd, hCancel, FALSE);
302  ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
303 
304  // group prev with hidden
305  hCtrl = GetNextDlgGroupItem(hwnd, hRad1, TRUE);
306  ok(hCtrl == hCancel, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
307  hCtrl = GetNextDlgGroupItem(hwnd, hRad2, TRUE);
308  ok(hCtrl == hRad1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
309  hCtrl = GetNextDlgGroupItem(hwnd, hPsh1, TRUE);
310  ok(hCtrl == hRad2, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
311  hCtrl = GetNextDlgGroupItem(hwnd, hRad5, TRUE);
312  ok(hCtrl == hPsh1, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
313  hCtrl = GetNextDlgGroupItem(hwnd, hRad7, TRUE);
314  ok(hCtrl == hRad5, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
315  hCtrl = GetNextDlgGroupItem(hwnd, hOK, TRUE);
316  ok(hCtrl == hRad7, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
317  hCtrl = GetNextDlgGroupItem(hwnd, hCancel, TRUE);
318  ok(hCtrl == hOK, "hCtrl is %s\n", GetNameFromHWND(hCtrl));
319 
320  // show
323 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define rad6
Definition: dlgs.h:135
#define rad2
Definition: dlgs.h:131
HWND WINAPI GetNextDlgGroupItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
int WINAPI GetDlgCtrlID(_In_ HWND)
static const char * GetNameFromHWND(HWND hwnd)
Definition: NextDlgItem.c:44
#define rad5
Definition: dlgs.h:134
#define psh1
Definition: dlgs.h:112
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define rad7
Definition: dlgs.h:136
#define rad3
Definition: dlgs.h:132
#define ok(value,...)
Definition: atltest.h:57
#define IDCANCEL
Definition: winuser.h:825
#define rad1
Definition: dlgs.h:130

Referenced by OnCommand().

◆ DoTest3()

static void DoTest3 ( HWND  hwnd)
static

Definition at line 338 of file NextDlgItem.c.

339 {
340  HWND hCtrl;
341  POINT pt;
342 
345 
352 
353  hCtrl = GetDlgItem(hwnd, rad1);
354  pt = GetCtrlCenter(hCtrl);
357 
364 
365  hCtrl = GetDlgItem(hwnd, rad5);
366  pt = GetCtrlCenter(hCtrl);
369 
376 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define MK_LBUTTON
Definition: winuser.h:2342
#define pt(x, y)
Definition: drawing.c:79
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
static POINT GetCtrlCenter(HWND hCtrl)
Definition: NextDlgItem.c:326
#define rad6
Definition: dlgs.h:135
#define rad2
Definition: dlgs.h:131
#define rad5
Definition: dlgs.h:134
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define rad7
Definition: dlgs.h:136
#define rad3
Definition: dlgs.h:132
#define BST_UNCHECKED
Definition: winuser.h:199
#define ok(value,...)
Definition: atltest.h:57
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define BST_CHECKED
Definition: winuser.h:197
#define SendMessage
Definition: winuser.h:5744
#define rad1
Definition: dlgs.h:130

Referenced by OnCommand().

◆ GetCtrlCenter()

static POINT GetCtrlCenter ( HWND  hCtrl)
static

Definition at line 326 of file NextDlgItem.c.

327 {
328  RECT rc;
329  POINT pt;
330 
331  GetClientRect(hCtrl, &rc);
332  pt.x = (rc.left + rc.right) / 2;
333  pt.y = (rc.top + rc.bottom) / 2;
334  return pt;
335 }
#define pt(x, y)
Definition: drawing.c:79
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LONG bottom
Definition: windef.h:294

Referenced by DoTest3().

◆ GetNameFromHWND()

static const char* GetNameFromHWND ( HWND  hwnd)
static

Definition at line 44 of file NextDlgItem.c.

45 {
47 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int WINAPI GetDlgCtrlID(_In_ HWND)
static const char * GetNameFromID(INT ID)
Definition: NextDlgItem.c:26

Referenced by DoTest1(), and DoTest2().

◆ GetNameFromID()

static const char* GetNameFromID ( INT  ID)
static

Definition at line 26 of file NextDlgItem.c.

27 {
28  switch (ID)
29  {
30  case rad1: return "rad1";
31  case rad2: return "rad2";
32  case rad3: return "rad3";
33  case psh1: return "psh1";
34  case rad5: return "rad5";
35  case rad6: return "rad6";
36  case rad7: return "rad7";
37  case IDOK: return "OK button";
38  case IDCANCEL: return "Cancel button";
39  default: return "(unknown)";
40  }
41 }
#define IDOK
Definition: winuser.h:824
#define rad6
Definition: dlgs.h:135
#define rad2
Definition: dlgs.h:131
#define rad5
Definition: dlgs.h:134
#define psh1
Definition: dlgs.h:112
#define rad7
Definition: dlgs.h:136
#define rad3
Definition: dlgs.h:132
#define ID
Definition: ruserpass.c:36
#define IDCANCEL
Definition: winuser.h:825
#define rad1
Definition: dlgs.h:130

Referenced by GetNameFromHWND().

◆ OnCommand()

static void OnCommand ( HWND  hwnd,
int  id,
HWND  hwndCtl,
UINT  codeNotify 
)
static

Definition at line 379 of file NextDlgItem.c.

380 {
381  switch (id)
382  {
383  case IDC_TEST1:
384  DoTest1(hwnd);
386  break;
387  case IDC_TEST2:
388  DoTest2(hwnd);
390  break;
391  case IDC_TEST3:
392  DoTest3(hwnd);
394  break;
395  case IDC_END:
396  EndDialog(hwnd, IDOK);
397  break;
398  }
399 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEWPARAM(l, h)
Definition: winuser.h:3948
#define IDOK
Definition: winuser.h:824
static void DoTest1(HWND hwnd)
Definition: NextDlgItem.c:50
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static void DoTest2(HWND hwnd)
Definition: NextDlgItem.c:208
#define PostMessage
Definition: winuser.h:5733
#define IDC_TEST2
Definition: NextDlgItem.c:14
#define IDC_END
Definition: NextDlgItem.c:16
#define WM_COMMAND
Definition: winuser.h:1722
#define IDC_TEST3
Definition: NextDlgItem.c:15
#define IDC_TEST1
Definition: NextDlgItem.c:13
static void DoTest3(HWND hwnd)
Definition: NextDlgItem.c:338

Referenced by RadioButtonDialogProc().

◆ OnInitDialog()

static BOOL OnInitDialog ( HWND  hwnd,
HWND  hwndFocus,
LPARAM  lParam 
)
static

Definition at line 19 of file NextDlgItem.c.

20 {
22  return TRUE;
23 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3948
#define PostMessage
Definition: winuser.h:5733
#define WM_COMMAND
Definition: winuser.h:1722
#define IDC_TEST1
Definition: NextDlgItem.c:13

Referenced by RadioButtonDialogProc().

◆ RadioButtonDialogProc()

INT_PTR CALLBACK RadioButtonDialogProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 402 of file NextDlgItem.c.

403 {
404  switch (uMsg)
405  {
408  }
409  return 0;
410 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT uMsg
Definition: menu.cpp:213
static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
Definition: NextDlgItem.c:379
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
Definition: NextDlgItem.c:19
#define WM_COMMAND
Definition: winuser.h:1722
#define HANDLE_MSG(hwnd, message, fn)
Definition: windowsx.h:297
#define WM_INITDIALOG
Definition: winuser.h:1721

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( NextDlgItem  )

Definition at line 412 of file NextDlgItem.c.

413 {
414  HMODULE hMod = GetModuleHandle(NULL);
415  ok(hMod != NULL, "\n");
416  DialogBox(hMod, TEXT("NEXTDLGITEM"), NULL, RadioButtonDialogProc);
417 }
#define DialogBox
Definition: winuser.h:5662
smooth NULL
Definition: ftsmooth.c:416
#define TEXT(s)
Definition: k32.h:26
#define GetModuleHandle
Definition: winbase.h:3651
#define ok(value,...)
Definition: atltest.h:57
INT_PTR CALLBACK RadioButtonDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: NextDlgItem.c:402