~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/user32/tests/monitor.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  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 *pMonitorFromWindow)(HWND,DWORD);
 35 
 36 static void init_function_pointers(void)
 37 {
 38     hdll = GetModuleHandleA("user32.dll");
 39 
 40 #define GET_PROC(func) \
 41     p ## func = (void*)GetProcAddress(hdll, #func); \
 42     if(!p ## func) \
 43       trace("GetProcAddress(%s) failed\n", #func);
 44 
 45     GET_PROC(ChangeDisplaySettingsExA)
 46     GET_PROC(ChangeDisplaySettingsExW)
 47     GET_PROC(EnumDisplayDevicesA)
 48     GET_PROC(EnumDisplayMonitors)
 49     GET_PROC(GetMonitorInfoA)
 50     GET_PROC(MonitorFromPoint)
 51     GET_PROC(MonitorFromWindow)
 52 
 53 #undef GET_PROC
 54 }
 55 
 56 static BOOL CALLBACK monitor_enum_proc(HMONITOR hmon, HDC hdc, LPRECT lprc,
 57                                        LPARAM lparam)
 58 {
 59     MONITORINFOEXA mi;
 60     char *primary = (char *)lparam;
 61 
 62     mi.cbSize = sizeof(mi);
 63 
 64     ok(pGetMonitorInfoA(hmon, (MONITORINFO*)&mi), "GetMonitorInfo failed\n");
 65     if (mi.dwFlags & MONITORINFOF_PRIMARY)
 66         strcpy(primary, mi.szDevice);
 67 
 68     return TRUE;
 69 }
 70 
 71 static void test_enumdisplaydevices(void)
 72 {
 73     DISPLAY_DEVICEA dd;
 74     char primary_device_name[32];
 75     char primary_monitor_device_name[32];
 76     DWORD primary_num = -1, num = 0;
 77     BOOL ret;
 78 
 79     if (!pEnumDisplayDevicesA)
 80     {
 81         win_skip("EnumDisplayDevicesA is not available\n");
 82         return;
 83     }
 84 
 85     dd.cb = sizeof(dd);
 86     while(1)
 87     {
 88         BOOL ret;
 89         HDC dc;
 90         ret = pEnumDisplayDevicesA(NULL, num, &dd, 0);
 91         if(!ret) break;
 92         if(dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
 93         {
 94             strcpy(primary_device_name, dd.DeviceName);
 95             primary_num = num;
 96         }
 97         if(dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
 98         {
 99             /* test creating DC */
100             dc = CreateDCA(dd.DeviceName, NULL, NULL, NULL);
101             ok(dc != NULL, "Failed to CreateDC(\"%s\") err=%d\n", dd.DeviceName, GetLastError());
102             DeleteDC(dc);
103         }
104         num++;
105     }
106 
107     if (primary_num == -1 || !pEnumDisplayMonitors || !pGetMonitorInfoA)
108     {
109         win_skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n");
110         return;
111     }
112 
113     primary_monitor_device_name[0] = 0;
114     ret = pEnumDisplayMonitors(NULL, NULL, monitor_enum_proc, (LPARAM)primary_monitor_device_name);
115     ok(ret, "EnumDisplayMonitors failed\n");
116     ok(!strcmp(primary_monitor_device_name, primary_device_name),
117        "monitor device name %s, device name %s\n", primary_monitor_device_name,
118        primary_device_name);
119 }
120 
121 struct vid_mode
122 {
123     DWORD w, h, bpp, freq, fields;
124     BOOL must_succeed;
125 };
126 
127 static const struct vid_mode vid_modes_test[] = {
128     {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY, 1},
129     {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT |                 DM_DISPLAYFREQUENCY, 1},
130     {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL                      , 1},
131     {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT                                      , 1},
132     {640, 480, 0, 0,                                DM_BITSPERPEL                      , 0},
133     {640, 480, 0, 0,                                                DM_DISPLAYFREQUENCY, 0},
134 
135     {0, 0, 0, 0, DM_PELSWIDTH, 0},
136     {0, 0, 0, 0, DM_PELSHEIGHT, 0},
137 
138     {640, 480, 0, 0, DM_PELSWIDTH, 0},
139     {640, 480, 0, 0, DM_PELSHEIGHT, 0},
140     {  0, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT, 0},
141     {640,   0, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT, 0},
142 
143     /* the following test succeeds under XP SP3
144     {0, 0, 0, 0, DM_DISPLAYFREQUENCY, 0}
145     */
146 };
147 #define vid_modes_cnt (sizeof(vid_modes_test) / sizeof(vid_modes_test[0]))
148 
149 static void test_ChangeDisplaySettingsEx(void)
150 {
151     DEVMODEA dm;
152     DEVMODEW dmW;
153     DWORD width;
154     LONG res;
155     int i;
156 
157     if (!pChangeDisplaySettingsExA)
158     {
159         win_skip("ChangeDisplaySettingsExA is not available\n");
160         return;
161     }
162 
163     SetLastError(0xdeadbeef);
164     res = EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
165     ok(res, "EnumDisplaySettings error %u\n", GetLastError());
166 
167     width = dm.dmPelsWidth;
168 
169     dm.dmDriverExtra = 1;
170     res = ChangeDisplaySettingsA(&dm, CDS_TEST);
171     ok(res == DISP_CHANGE_SUCCESSFUL,
172        "ChangeDisplaySettingsA returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
173     ok(dm.dmDriverExtra == 0 || broken(dm.dmDriverExtra == 1) /* win9x */,
174        "ChangeDisplaySettingsA didn't reset dmDriverExtra to 0\n");
175 
176     /* crashes under XP SP3 for large dmDriverExtra values */
177     dm.dmDriverExtra = 1;
178     res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
179     ok(res == DISP_CHANGE_SUCCESSFUL,
180        "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_BADMODE\n", res);
181     ok(dm.dmDriverExtra == 1, "ChangeDisplaySettingsExA shouldn't reset dmDriverExtra to 0\n");
182 
183     memset(&dmW, 0, sizeof(dmW));
184     dmW.dmSize = sizeof(dmW);
185     dmW.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
186     dmW.dmPelsWidth = dm.dmPelsWidth;
187     dmW.dmPelsHeight = dm.dmPelsHeight;
188     dmW.dmDriverExtra = 1;
189     SetLastError(0xdeadbeef);
190     res = ChangeDisplaySettingsW(&dmW, CDS_TEST);
191     if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
192     {
193         ok(res == DISP_CHANGE_SUCCESSFUL,
194            "ChangeDisplaySettingsW returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
195         ok(dmW.dmDriverExtra == 0, "ChangeDisplaySettingsW didn't reset dmDriverExtra to 0\n");
196     }
197 
198     /* Apparently XP treats dmDriverExtra being != 0 as an error */
199     dmW.dmDriverExtra = 1;
200     res = pChangeDisplaySettingsExW(NULL, &dmW, NULL, CDS_TEST, NULL);
201     if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
202     {
203         ok(res == DISP_CHANGE_SUCCESSFUL,
204            "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_BADMODE\n", res);
205         ok(dmW.dmDriverExtra == 1, "ChangeDisplaySettingsExW shouldn't reset dmDriverExtra to 0\n");
206     }
207 
208     /* the following 2 tests show that dm.dmSize being 0 is invalid, but
209      * ChangeDisplaySettingsExA still reports success.
210      */
211     memset(&dm, 0, sizeof(dm));
212     dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
213     dm.dmPelsWidth = width;
214     res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
215     ok(res == DISP_CHANGE_SUCCESSFUL ||
216        res == DISP_CHANGE_BADMODE || /* Win98, WinMe */
217        res == DISP_CHANGE_FAILED, /* NT4 */
218        "ChangeDisplaySettingsExA returned unexpected %d\n", res);
219 
220     memset(&dmW, 0, sizeof(dmW));
221     dmW.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
222     dmW.dmPelsWidth = width;
223     SetLastError(0xdeadbeef);
224     res = pChangeDisplaySettingsExW(NULL, &dmW, NULL, CDS_TEST, NULL);
225     if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
226         ok(res == DISP_CHANGE_FAILED ||
227            res == DISP_CHANGE_BADPARAM ||  /* NT4 */
228            res == DISP_CHANGE_BADMODE /* XP SP3 */,
229            "ChangeDisplaySettingsExW returned %d\n", res);
230 
231     memset(&dm, 0, sizeof(dm));
232     dm.dmSize = sizeof(dm);
233 
234     for (i = 0; i < vid_modes_cnt; i++)
235     {
236         dm.dmPelsWidth        = vid_modes_test[i].w;
237         dm.dmPelsHeight       = vid_modes_test[i].h;
238         dm.dmBitsPerPel       = vid_modes_test[i].bpp;
239         dm.dmDisplayFrequency = vid_modes_test[i].freq;
240         dm.dmFields           = vid_modes_test[i].fields;
241         res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
242         ok(vid_modes_test[i].must_succeed ?
243            (res == DISP_CHANGE_SUCCESSFUL || res == DISP_CHANGE_RESTART) :
244            (res == DISP_CHANGE_SUCCESSFUL || res == DISP_CHANGE_RESTART ||
245             res == DISP_CHANGE_BADMODE || res == DISP_CHANGE_BADPARAM),
246            "Unexpected ChangeDisplaySettingsEx() return code for resolution[%d]: %d\n", i, res);
247 
248         if (res == DISP_CHANGE_SUCCESSFUL)
249         {
250             RECT r, r1, virt;
251 
252             SetRect(&virt, 0, 0, GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN));
253             if (IsRectEmpty(&virt))  /* NT4 doesn't have SM_CX/YVIRTUALSCREEN */
254                 SetRect(&virt, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
255             OffsetRect(&virt, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN));
256 
257             /* Resolution change resets clip rect */
258             ok(GetClipCursor(&r), "GetClipCursor() failed\n");
259             ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
260 
261             if (!ClipCursor(NULL)) continue;
262             ok(GetClipCursor(&r), "GetClipCursor() failed\n");
263             ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
264 
265             /* This should always work. Primary monitor is at (0,0) */
266             SetRect(&r1, 10, 10, 20, 20);
267             ok(ClipCursor(&r1), "ClipCursor() failed\n");
268             ok(GetClipCursor(&r), "GetClipCursor() failed\n");
269             ok(EqualRect(&r, &r1), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
270 
271             SetRect(&r1, virt.left - 10, virt.top - 10, virt.right + 20, virt.bottom + 20);
272             ok(ClipCursor(&r1), "ClipCursor() failed\n");
273             ok(GetClipCursor(&r), "GetClipCursor() failed\n");
274             ok(EqualRect(&r, &virt) ||
275                broken(EqualRect(&r, &r1)) /* win9x */,
276                "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
277             ClipCursor(&virt);
278         }
279     }
280     res = pChangeDisplaySettingsExA(NULL, NULL, NULL, CDS_RESET, NULL);
281     ok(res == DISP_CHANGE_SUCCESSFUL, "Failed to reset default resolution: %d\n", res);
282 }
283 
284 static void test_monitors(void)
285 {
286     HMONITOR monitor, primary;
287     POINT pt;
288 
289     if (!pMonitorFromPoint || !pMonitorFromWindow)
290     {
291         win_skip("MonitorFromPoint or MonitorFromWindow are not available\n");
292         return;
293     }
294 
295     pt.x = pt.y = 0;
296     primary = pMonitorFromPoint( pt, MONITOR_DEFAULTTOPRIMARY );
297     ok( primary != 0, "couldn't get primary monitor\n" );
298 
299     monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTONULL );
300     ok( !monitor, "got %p, should not get a monitor for an invalid window\n", monitor );
301     monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTOPRIMARY );
302     ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTOPRIMARY\n", monitor, primary );
303     monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTONEAREST );
304     ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTONEAREST\n", monitor, primary );
305 }
306 
307 static BOOL CALLBACK find_primary_mon(HMONITOR hmon, HDC hdc, LPRECT rc, LPARAM lp)
308 {
309     MONITORINFO mi;
310     BOOL ret;
311 
312     mi.cbSize = sizeof(mi);
313     ret = pGetMonitorInfoA(hmon, &mi);
314     ok(ret, "GetMonitorInfo failed\n");
315     if (mi.dwFlags & MONITORINFOF_PRIMARY)
316     {
317         *(HMONITOR *)lp = hmon;
318         return FALSE;
319     }
320     return TRUE;
321 }
322 
323 static void test_work_area(void)
324 {
325     HMONITOR hmon;
326     MONITORINFO mi;
327     RECT rc_work, rc_normal;
328     HWND hwnd;
329     WINDOWPLACEMENT wp;
330     BOOL ret;
331 
332     if (!pEnumDisplayMonitors || !pGetMonitorInfoA)
333     {
334         win_skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n");
335         return;
336     }
337 
338     hmon = 0;
339     ret = pEnumDisplayMonitors(NULL, NULL, find_primary_mon, (LPARAM)&hmon);
340     ok(!ret && hmon != 0, "Failed to find primary monitor\n");
341 
342     mi.cbSize = sizeof(mi);
343     SetLastError(0xdeadbeef);
344     ret = pGetMonitorInfoA(hmon, &mi);
345     ok(ret, "GetMonitorInfo error %u\n", GetLastError());
346     ok(mi.dwFlags & MONITORINFOF_PRIMARY, "not a primary monitor\n");
347     trace("primary monitor (%d,%d-%d,%d)\n",
348         mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom);
349 
350     SetLastError(0xdeadbeef);
351     ret = SystemParametersInfo(SPI_GETWORKAREA, 0, &rc_work, 0);
352     ok(ret, "SystemParametersInfo error %u\n", GetLastError());
353     trace("work area (%d,%d-%d,%d)\n", rc_work.left, rc_work.top, rc_work.right, rc_work.bottom);
354     ok(EqualRect(&rc_work, &mi.rcWork), "work area is different\n");
355 
356     hwnd = CreateWindowEx(0, "static", NULL, WS_OVERLAPPEDWINDOW|WS_VISIBLE,100,100,10,10,0,0,0,NULL);
357     ok(hwnd != 0, "CreateWindowEx failed\n");
358 
359     ret = GetWindowRect(hwnd, &rc_normal);
360     ok(ret, "GetWindowRect failed\n");
361     trace("normal (%d,%d-%d,%d)\n", rc_normal.left, rc_normal.top, rc_normal.right, rc_normal.bottom);
362 
363     wp.length = sizeof(wp);
364     ret = GetWindowPlacement(hwnd, &wp);
365     ok(ret, "GetWindowPlacement failed\n");
366     trace("min: %d,%d max %d,%d normal %d,%d-%d,%d\n",
367           wp.ptMinPosition.x, wp.ptMinPosition.y,
368           wp.ptMaxPosition.x, wp.ptMaxPosition.y,
369           wp.rcNormalPosition.left, wp.rcNormalPosition.top,
370           wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
371     OffsetRect(&wp.rcNormalPosition, rc_work.left, rc_work.top);
372     if (mi.rcMonitor.left != mi.rcWork.left ||
373         mi.rcMonitor.top != mi.rcWork.top)  /* FIXME: remove once Wine is fixed */
374         todo_wine ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
375     else
376         ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
377 
378     SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
379 
380     wp.length = sizeof(wp);
381     ret = GetWindowPlacement(hwnd, &wp);
382     ok(ret, "GetWindowPlacement failed\n");
383     trace("min: %d,%d max %d,%d normal %d,%d-%d,%d\n",
384           wp.ptMinPosition.x, wp.ptMinPosition.y,
385           wp.ptMaxPosition.x, wp.ptMaxPosition.y,
386           wp.rcNormalPosition.left, wp.rcNormalPosition.top,
387           wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
388     ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
389 
390     DestroyWindow(hwnd);
391 }
392 
393 START_TEST(monitor)
394 {
395     init_function_pointers();
396     test_enumdisplaydevices();
397     test_ChangeDisplaySettingsEx();
398     test_monitors();
399     test_work_area();
400 }
401 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.