Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/programs/explorer/tests/explorer.c
4389 views
1
/*
2
* Explorer.exe tests
3
*
4
* Copyright 2022 Zhiyi Zhang for CodeWeavers
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
*/
20
21
#include <windows.h>
22
#include "wine/test.h"
23
24
static void test_taskbar(void)
25
{
26
RECT taskbar_rect, expected_rect, primary_rect, work_rect;
27
HWND hwnd;
28
BOOL ret;
29
30
hwnd = FindWindowA("Shell_TrayWnd", NULL);
31
if (!hwnd)
32
{
33
skip("Failed to find the taskbar window.\n");
34
return;
35
}
36
37
ret = GetWindowRect(hwnd, &taskbar_rect);
38
ok(ret, "GetWindowRect failed, error %ld.\n", GetLastError());
39
40
SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_rect, 0);
41
SetRect(&primary_rect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
42
SubtractRect(&expected_rect, &primary_rect, &work_rect);
43
44
/* In standalone mode, the systray window is floating */
45
todo_wine_if(!(GetWindowLongW(hwnd, GWL_STYLE) & WS_POPUP))
46
ok(EqualRect(&taskbar_rect, &expected_rect), "Expected %s, got %s.\n",
47
wine_dbgstr_rect(&expected_rect), wine_dbgstr_rect(&taskbar_rect));
48
}
49
50
START_TEST(explorer)
51
{
52
test_taskbar();
53
}
54
55