[REACTOS]
[reactos.git] / rostests / winetests / user32 / monitor.c
1 /*
2 * Unit tests for monitor APIs
3 *
4 * Copyright 2005 Huw Davies
5 * Copyright 2008 Dmitry Timoshkov
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22 #include "wine/test.h"
23 #include "winbase.h"
24 #include "wingdi.h"
25 #include "winuser.h"
26
27 static HMODULE hdll;
28 static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR, LPDEVMODEA, HWND, DWORD, LPVOID);
29 static LONG (WINAPI *pChangeDisplaySettingsExW)(LPCWSTR, LPDEVMODEW, HWND, DWORD, LPVOID);
30 static BOOL (WINAPI *pEnumDisplayDevicesA)(LPCSTR,DWORD,LPDISPLAY_DEVICEA,DWORD);
31 static BOOL (WINAPI *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM);
32 static BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR,LPMONITORINFO);
33 static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD);
34 static HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT,DWORD);
35 static HMONITOR (WINAPI *pMonitorFromWindow)(HWND,DWORD);
36
37 static void init_function_pointers(void)
38 {
39 hdll = GetModuleHandleA("user32.dll");
40
41 #define GET_PROC(func) \
42 p ## func = (void*)GetProcAddress(hdll, #func); \
43 if(!p ## func) \
44 trace("GetProcAddress(%s) failed\n", #func);
45
46 GET_PROC(ChangeDisplaySettingsExA)
47 GET_PROC(ChangeDisplaySettingsExW)
48 GET_PROC(EnumDisplayDevicesA)
49 GET_PROC(EnumDisplayMonitors)
50 GET_PROC(GetMonitorInfoA)
51 GET_PROC(MonitorFromPoint)
52 GET_PROC(MonitorFromRect)
53 GET_PROC(MonitorFromWindow)
54
55 #undef GET_PROC
56 }
57
58 static BOOL CALLBACK monitor_enum_proc(HMONITOR hmon, HDC hdc, LPRECT lprc,
59 LPARAM lparam)
60 {
61 MONITORINFOEXA mi;
62 char *primary = (char *)lparam;
63
64 mi.cbSize = sizeof(mi);
65
66 ok(pGetMonitorInfoA(hmon, (MONITORINFO*)&mi), "GetMonitorInfo failed\n");
67 if (mi.dwFlags & MONITORINFOF_PRIMARY)
68 strcpy(primary, mi.szDevice);
69
70 return TRUE;
71 }
72
73 static void test_enumdisplaydevices(void)
74 {
75 DISPLAY_DEVICEA dd;
76 char primary_device_name[32];
77 char primary_monitor_device_name[32];
78 DWORD primary_num = -1, num = 0;
79 BOOL ret;
80
81 if (!pEnumDisplayDevicesA)
82 {
83 win_skip("EnumDisplayDevicesA is not available\n");
84 return;
85 }
86
87 dd.cb = sizeof(dd);
88 while(1)
89 {
90 BOOL ret;
91 HDC dc;
92 ret = pEnumDisplayDevicesA(NULL, num, &dd, 0);
93 if(!ret) break;
94 if(dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
95 {
96 strcpy(primary_device_name, dd.DeviceName);
97 primary_num = num;
98 }
99 if(dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
100 {
101 /* test creating DC */
102 dc = CreateDCA(dd.DeviceName, NULL, NULL, NULL);
103 ok(dc != NULL, "Failed to CreateDC(\"%s\") err=%d\n", dd.DeviceName, GetLastError());
104 DeleteDC(dc);
105 }
106 num++;
107 }
108
109 if (primary_num == -1 || !pEnumDisplayMonitors || !pGetMonitorInfoA)
110 {
111 win_skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n");
112 return;
113 }
114
115 primary_monitor_device_name[0] = 0;
116 ret = pEnumDisplayMonitors(NULL, NULL, monitor_enum_proc, (LPARAM)primary_monitor_device_name);
117 ok(ret, "EnumDisplayMonitors failed\n");
118 ok(!strcmp(primary_monitor_device_name, primary_device_name),
119 "monitor device name %s, device name %s\n", primary_monitor_device_name,
120 primary_device_name);
121 }
122
123 struct vid_mode
124 {
125 DWORD w, h, bpp, freq, fields;
126 BOOL must_succeed;
127 };
128
129 static const struct vid_mode vid_modes_test[] = {
130 {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY, 1},
131 {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY, 1},
132 {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL , 1},
133 {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT , 1},
134 {640, 480, 0, 0, DM_BITSPERPEL , 0},
135 {640, 480, 0, 0, DM_DISPLAYFREQUENCY, 0},
136
137 {0, 0, 0, 0, DM_PELSWIDTH, 0},
138 {0, 0, 0, 0, DM_PELSHEIGHT, 0},
139
140 {640, 480, 0, 0, DM_PELSWIDTH, 0},
141 {640, 480, 0, 0, DM_PELSHEIGHT, 0},
142 { 0, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT, 0},
143 {640, 0, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT, 0},
144
145 /* the following test succeeds under XP SP3
146 {0, 0, 0, 0, DM_DISPLAYFREQUENCY, 0}
147 */
148 };
149 #define vid_modes_cnt (sizeof(vid_modes_test) / sizeof(vid_modes_test[0]))
150
151 static void test_ChangeDisplaySettingsEx(void)
152 {
153 DEVMODEA dm;
154 DEVMODEW dmW;
155 DWORD width;
156 LONG res;
157 int i;
158
159 if (!pChangeDisplaySettingsExA)
160 {
161 win_skip("ChangeDisplaySettingsExA is not available\n");
162 return;
163 }
164
165 SetLastError(0xdeadbeef);
166 res = EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dm);
167 ok(res, "EnumDisplaySettings error %u\n", GetLastError());
168
169 width = dm.dmPelsWidth;
170
171 dm.dmDriverExtra = 1;
172 res = ChangeDisplaySettingsA(&dm, CDS_TEST);
173 ok(res == DISP_CHANGE_SUCCESSFUL,
174 "ChangeDisplaySettingsA returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
175 ok(dm.dmDriverExtra == 0 || broken(dm.dmDriverExtra == 1) /* win9x */,
176 "ChangeDisplaySettingsA didn't reset dmDriverExtra to 0\n");
177
178 /* crashes under XP SP3 for large dmDriverExtra values */
179 dm.dmDriverExtra = 1;
180 res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
181 ok(res == DISP_CHANGE_SUCCESSFUL,
182 "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
183 ok(dm.dmDriverExtra == 1, "ChangeDisplaySettingsExA shouldn't reset dmDriverExtra to 0\n");
184
185 memset(&dmW, 0, sizeof(dmW));
186 dmW.dmSize = sizeof(dmW);
187 dmW.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
188 dmW.dmPelsWidth = dm.dmPelsWidth;
189 dmW.dmPelsHeight = dm.dmPelsHeight;
190 dmW.dmDriverExtra = 1;
191 SetLastError(0xdeadbeef);
192 res = ChangeDisplaySettingsW(&dmW, CDS_TEST);
193 if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
194 {
195 ok(res == DISP_CHANGE_SUCCESSFUL,
196 "ChangeDisplaySettingsW returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
197 ok(dmW.dmDriverExtra == 0, "ChangeDisplaySettingsW didn't reset dmDriverExtra to 0\n");
198 }
199
200 /* Apparently XP treats dmDriverExtra being != 0 as an error */
201 dmW.dmDriverExtra = 1;
202 res = pChangeDisplaySettingsExW(NULL, &dmW, NULL, CDS_TEST, NULL);
203 if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
204 {
205 ok(res == DISP_CHANGE_SUCCESSFUL,
206 "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
207 ok(dmW.dmDriverExtra == 1, "ChangeDisplaySettingsExW shouldn't reset dmDriverExtra to 0\n");
208 }
209
210 /* the following 2 tests show that dm.dmSize being 0 is invalid, but
211 * ChangeDisplaySettingsExA still reports success.
212 */
213 memset(&dm, 0, sizeof(dm));
214 dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
215 dm.dmPelsWidth = width;
216 res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
217 ok(res == DISP_CHANGE_SUCCESSFUL ||
218 res == DISP_CHANGE_BADMODE || /* Win98, WinMe */
219 res == DISP_CHANGE_FAILED, /* NT4 */
220 "ChangeDisplaySettingsExA returned unexpected %d\n", res);
221
222 memset(&dmW, 0, sizeof(dmW));
223 dmW.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
224 dmW.dmPelsWidth = width;
225 SetLastError(0xdeadbeef);
226 res = pChangeDisplaySettingsExW(NULL, &dmW, NULL, CDS_TEST, NULL);
227 if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
228 ok(res == DISP_CHANGE_FAILED ||
229 res == DISP_CHANGE_BADPARAM || /* NT4 */
230 res == DISP_CHANGE_BADMODE /* XP SP3 */,
231 "ChangeDisplaySettingsExW returned %d\n", res);
232
233 memset(&dm, 0, sizeof(dm));
234 dm.dmSize = sizeof(dm);
235
236 for (i = 0; i < vid_modes_cnt; i++)
237 {
238 dm.dmPelsWidth = vid_modes_test[i].w;
239 dm.dmPelsHeight = vid_modes_test[i].h;
240 dm.dmBitsPerPel = vid_modes_test[i].bpp;
241 dm.dmDisplayFrequency = vid_modes_test[i].freq;
242 dm.dmFields = vid_modes_test[i].fields;
243 res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
244 ok(vid_modes_test[i].must_succeed ?
245 (res == DISP_CHANGE_SUCCESSFUL || res == DISP_CHANGE_RESTART) :
246 (res == DISP_CHANGE_SUCCESSFUL || res == DISP_CHANGE_RESTART ||
247 res == DISP_CHANGE_BADMODE || res == DISP_CHANGE_BADPARAM),
248 "Unexpected ChangeDisplaySettingsEx() return code for resolution[%d]: %d\n", i, res);
249
250 if (res == DISP_CHANGE_SUCCESSFUL)
251 {
252 RECT r, r1, virt;
253
254 SetRect(&virt, 0, 0, GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN));
255 if (IsRectEmpty(&virt)) /* NT4 doesn't have SM_CX/YVIRTUALSCREEN */
256 SetRect(&virt, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
257 OffsetRect(&virt, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN));
258
259 /* Resolution change resets clip rect */
260 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
261 ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
262
263 if (!ClipCursor(NULL)) continue;
264 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
265 ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
266
267 /* This should always work. Primary monitor is at (0,0) */
268 SetRect(&r1, 10, 10, 20, 20);
269 ok(ClipCursor(&r1), "ClipCursor() failed\n");
270 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
271 ok(EqualRect(&r, &r1), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
272 SetRect(&r1, 10, 10, 10, 10);
273 ok(ClipCursor(&r1), "ClipCursor() failed\n");
274 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
275 ok(EqualRect(&r, &r1), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
276 SetRect(&r1, 10, 10, 10, 9);
277 ok(!ClipCursor(&r1), "ClipCursor() succeeded\n");
278 /* Windows bug: further clipping fails once an empty rect is set, so we have to reset it */
279 ClipCursor(NULL);
280
281 SetRect(&r1, virt.left - 10, virt.top - 10, virt.right + 20, virt.bottom + 20);
282 ok(ClipCursor(&r1), "ClipCursor() failed\n");
283 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
284 ok(EqualRect(&r, &virt) ||
285 broken(EqualRect(&r, &r1)) /* win9x */,
286 "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
287 ClipCursor(&virt);
288 }
289 }
290 res = pChangeDisplaySettingsExA(NULL, NULL, NULL, CDS_RESET, NULL);
291 ok(res == DISP_CHANGE_SUCCESSFUL, "Failed to reset default resolution: %d\n", res);
292 }
293
294 static void test_monitors(void)
295 {
296 HMONITOR monitor, primary, nearest;
297 POINT pt;
298 RECT rc;
299
300 if (!pMonitorFromPoint || !pMonitorFromWindow || !pMonitorFromRect)
301 {
302 win_skip("MonitorFromPoint, MonitorFromWindow, or MonitorFromRect is not available\n");
303 return;
304 }
305
306 pt.x = pt.y = 0;
307 primary = pMonitorFromPoint( pt, MONITOR_DEFAULTTOPRIMARY );
308 ok( primary != 0, "couldn't get primary monitor\n" );
309
310 monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTONULL );
311 ok( !monitor, "got %p, should not get a monitor for an invalid window\n", monitor );
312 monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTOPRIMARY );
313 ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTOPRIMARY\n", monitor, primary );
314 monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTONEAREST );
315 ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTONEAREST\n", monitor, primary );
316
317 SetRect( &rc, 0, 0, 1, 1 );
318 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
319 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
320
321 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTOPRIMARY );
322 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
323
324 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONEAREST );
325 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
326
327 /* Empty rect at 0,0 is considered inside the primary monitor */
328 SetRect( &rc, 0, 0, -1, -1 );
329 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
330 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
331
332 /* Even if there is a monitor left of the primary, the primary will have the most overlapping area */
333 SetRect( &rc, -1, 0, 2, 1 );
334 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
335 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
336
337 /* But the width of the rect doesn't matter if it's empty. */
338 SetRect( &rc, -1, 0, 2, -1 );
339 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
340 ok( monitor != primary, "got primary %p\n", monitor );
341
342 if (!pGetMonitorInfoA)
343 {
344 win_skip("GetMonitorInfoA is not available\n");
345 return;
346 }
347
348 /* Search for a monitor that has no others equally near to (left, top-1) */
349 SetRect( &rc, -1, -2, 2, 0 );
350 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
351 nearest = primary;
352 while (monitor != NULL)
353 {
354 MONITORINFO mi;
355 BOOL ret;
356 ok( monitor != primary, "got primary %p\n", monitor );
357 nearest = monitor;
358 mi.cbSize = sizeof(mi);
359 ret = pGetMonitorInfoA( monitor, &mi );
360 ok( ret, "GetMonitorInfo failed\n" );
361 SetRect( &rc, mi.rcMonitor.left-1, mi.rcMonitor.top-2, mi.rcMonitor.left+2, mi.rcMonitor.top );
362 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
363 }
364
365 SetRect( &rc, rc.left+1, rc.top+1, rc.left+2, rc.top+2 );
366
367 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
368 ok( monitor == NULL, "got %p\n", monitor );
369
370 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTOPRIMARY );
371 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
372
373 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONEAREST );
374 ok( monitor == nearest, "got %p, should get nearest %p\n", monitor, nearest );
375 }
376
377 static BOOL CALLBACK find_primary_mon(HMONITOR hmon, HDC hdc, LPRECT rc, LPARAM lp)
378 {
379 MONITORINFO mi;
380 BOOL ret;
381
382 mi.cbSize = sizeof(mi);
383 ret = pGetMonitorInfoA(hmon, &mi);
384 ok(ret, "GetMonitorInfo failed\n");
385 if (mi.dwFlags & MONITORINFOF_PRIMARY)
386 {
387 *(HMONITOR *)lp = hmon;
388 return FALSE;
389 }
390 return TRUE;
391 }
392
393 static void test_work_area(void)
394 {
395 HMONITOR hmon;
396 MONITORINFO mi;
397 RECT rc_work, rc_normal;
398 HWND hwnd;
399 WINDOWPLACEMENT wp;
400 BOOL ret;
401
402 if (!pEnumDisplayMonitors || !pGetMonitorInfoA)
403 {
404 win_skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n");
405 return;
406 }
407
408 hmon = 0;
409 ret = pEnumDisplayMonitors(NULL, NULL, find_primary_mon, (LPARAM)&hmon);
410 ok(!ret && hmon != 0, "Failed to find primary monitor\n");
411
412 mi.cbSize = sizeof(mi);
413 SetLastError(0xdeadbeef);
414 ret = pGetMonitorInfoA(hmon, &mi);
415 ok(ret, "GetMonitorInfo error %u\n", GetLastError());
416 ok(mi.dwFlags & MONITORINFOF_PRIMARY, "not a primary monitor\n");
417 trace("primary monitor (%d,%d-%d,%d)\n",
418 mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom);
419
420 SetLastError(0xdeadbeef);
421 ret = SystemParametersInfoA(SPI_GETWORKAREA, 0, &rc_work, 0);
422 ok(ret, "SystemParametersInfo error %u\n", GetLastError());
423 trace("work area (%d,%d-%d,%d)\n", rc_work.left, rc_work.top, rc_work.right, rc_work.bottom);
424 ok(EqualRect(&rc_work, &mi.rcWork), "work area is different\n");
425
426 hwnd = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW|WS_VISIBLE,100,100,10,10,0,0,0,NULL);
427 ok(hwnd != 0, "CreateWindowEx failed\n");
428
429 ret = GetWindowRect(hwnd, &rc_normal);
430 ok(ret, "GetWindowRect failed\n");
431 trace("normal (%d,%d-%d,%d)\n", rc_normal.left, rc_normal.top, rc_normal.right, rc_normal.bottom);
432
433 wp.length = sizeof(wp);
434 ret = GetWindowPlacement(hwnd, &wp);
435 ok(ret, "GetWindowPlacement failed\n");
436 trace("min: %d,%d max %d,%d normal %d,%d-%d,%d\n",
437 wp.ptMinPosition.x, wp.ptMinPosition.y,
438 wp.ptMaxPosition.x, wp.ptMaxPosition.y,
439 wp.rcNormalPosition.left, wp.rcNormalPosition.top,
440 wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
441 OffsetRect(&wp.rcNormalPosition, rc_work.left, rc_work.top);
442 if (mi.rcMonitor.left != mi.rcWork.left ||
443 mi.rcMonitor.top != mi.rcWork.top) /* FIXME: remove once Wine is fixed */
444 todo_wine ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
445 else
446 ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
447
448 SetWindowLongA(hwnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
449
450 wp.length = sizeof(wp);
451 ret = GetWindowPlacement(hwnd, &wp);
452 ok(ret, "GetWindowPlacement failed\n");
453 trace("min: %d,%d max %d,%d normal %d,%d-%d,%d\n",
454 wp.ptMinPosition.x, wp.ptMinPosition.y,
455 wp.ptMaxPosition.x, wp.ptMaxPosition.y,
456 wp.rcNormalPosition.left, wp.rcNormalPosition.top,
457 wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
458 ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
459
460 DestroyWindow(hwnd);
461 }
462
463 START_TEST(monitor)
464 {
465 init_function_pointers();
466 test_enumdisplaydevices();
467 test_ChangeDisplaySettingsEx();
468 test_monitors();
469 test_work_area();
470 }