1 /* Unit tests for systray
3 * Copyright 2007 Mikolaj Zalewski
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.
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.
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
19 #define _WIN32_IE 0x600
25 #include "wine/test.h"
35 ZeroMemory(&nidW
, sizeof(nidW
));
36 nidW
.cbSize
= NOTIFYICONDATAW_V1_SIZE
;
39 nidW
.uFlags
= NIF_ICON
|NIF_MESSAGE
;
40 nidW
.hIcon
= LoadIcon(NULL
, IDI_APPLICATION
);
41 nidW
.uCallbackMessage
= WM_USER
+17;
42 ok(Shell_NotifyIconW(NIM_ADD
, &nidW
), "NIM_ADD failed!\n");
44 /* using an invalid cbSize does work */
48 ok(Shell_NotifyIconW(NIM_DELETE
, &nidW
), "NIM_DELETE failed!\n");
49 /* as icon doesn't exist anymore - now there will be an error */
50 nidW
.cbSize
= sizeof(nidW
);
51 /* wine currently doesn't return error code put prints an ERR(...) */
52 todo_wine
ok(!Shell_NotifyIconW(NIM_DELETE
, &nidW
), "The icon was not deleted\n");
54 /* same for Shell_NotifyIconA */
55 ZeroMemory(&nidA
, sizeof(nidA
));
56 nidA
.cbSize
= NOTIFYICONDATAA_V1_SIZE
;
59 nidA
.uFlags
= NIF_ICON
|NIF_MESSAGE
;
60 nidA
.hIcon
= LoadIcon(NULL
, IDI_APPLICATION
);
61 nidA
.uCallbackMessage
= WM_USER
+17;
62 ok(Shell_NotifyIconA(NIM_ADD
, &nidA
), "NIM_ADD failed!\n");
64 /* using an invalid cbSize does work */
68 ok(Shell_NotifyIconA(NIM_DELETE
, &nidA
), "NIM_DELETE failed!\n");
69 /* as icon doesn't exist anymore - now there will be an error */
70 nidA
.cbSize
= sizeof(nidA
);
71 /* wine currently doesn't return error code put prints an ERR(...) */
72 todo_wine
ok(!Shell_NotifyIconA(NIM_DELETE
, &nidA
), "The icon was not deleted\n");
81 wc
.style
= CS_HREDRAW
| CS_VREDRAW
;
84 wc
.hInstance
= GetModuleHandleA(NULL
);
86 wc
.hCursor
= LoadCursorA(NULL
, MAKEINTRESOURCEA(IDC_IBEAM
));
87 wc
.hbrBackground
= GetSysColorBrush(COLOR_WINDOW
);
88 wc
.lpszMenuName
= NULL
;
89 wc
.lpszClassName
= "MyTestWnd";
90 wc
.lpfnWndProc
= DefWindowProc
;
93 hMainWnd
= CreateWindowExA(0, "MyTestWnd", "Blah", WS_OVERLAPPEDWINDOW
,
94 CW_USEDEFAULT
, CW_USEDEFAULT
, 680, 260, NULL
, NULL
, GetModuleHandleA(NULL
), 0);
95 GetClientRect(hMainWnd
, &rc
);
96 ShowWindow(hMainWnd
, SW_SHOW
);
101 while(GetMessageA(&msg
,0,0,0)) {
102 TranslateMessage(&msg
);
103 DispatchMessageA(&msg
);
105 DestroyWindow(hMainWnd
);