Module: wine Branch: master Commit: 46735ae431f2657c20301d51c59e335516d37d92 URL: http://source.winehq.org/git/wine.git/?a=commit;h=46735ae431f2657c20301d51c5...
Author: Francois Gouget fgouget@free.fr Date: Tue Dec 18 10:01:14 2007 +0100
shell32/tests: Use GetProcAddress() on Shell_NotifyIconW() because it is missing on Windows 95.
---
dlls/shell32/tests/systray.c | 45 +++++++++++++++++++++++++---------------- 1 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/dlls/shell32/tests/systray.c b/dlls/shell32/tests/systray.c index 9c97a4e..35a59ad 100644 --- a/dlls/shell32/tests/systray.c +++ b/dlls/shell32/tests/systray.c @@ -26,30 +26,35 @@
static HWND hMainWnd; +static BOOL (WINAPI *pShell_NotifyIconW)(DWORD,PNOTIFYICONDATAW);
void test_cbsize(void) { - NOTIFYICONDATAW nidW; NOTIFYICONDATAA nidA;
- ZeroMemory(&nidW, sizeof(nidW)); - nidW.cbSize = NOTIFYICONDATAW_V1_SIZE; - nidW.hWnd = hMainWnd; - nidW.uID = 1; - nidW.uFlags = NIF_ICON|NIF_MESSAGE; - nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION); - nidW.uCallbackMessage = WM_USER+17; - ok(Shell_NotifyIconW(NIM_ADD, &nidW), "NIM_ADD failed!\n"); + if (pShell_NotifyIconW) + { + NOTIFYICONDATAW nidW;
- /* using an invalid cbSize does work */ - nidW.cbSize = 3; - nidW.hWnd = hMainWnd; - nidW.uID = 1; - ok(Shell_NotifyIconW(NIM_DELETE, &nidW), "NIM_DELETE failed!\n"); - /* as icon doesn't exist anymore - now there will be an error */ - nidW.cbSize = sizeof(nidW); - /* wine currently doesn't return error code put prints an ERR(...) */ - todo_wine ok(!Shell_NotifyIconW(NIM_DELETE, &nidW), "The icon was not deleted\n"); + ZeroMemory(&nidW, sizeof(nidW)); + nidW.cbSize = NOTIFYICONDATAW_V1_SIZE; + nidW.hWnd = hMainWnd; + nidW.uID = 1; + nidW.uFlags = NIF_ICON|NIF_MESSAGE; + nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION); + nidW.uCallbackMessage = WM_USER+17; + ok(pShell_NotifyIconW(NIM_ADD, &nidW), "NIM_ADD failed!\n"); + + /* using an invalid cbSize does work */ + nidW.cbSize = 3; + nidW.hWnd = hMainWnd; + nidW.uID = 1; + ok(pShell_NotifyIconW(NIM_DELETE, &nidW), "NIM_DELETE failed!\n"); + /* as icon doesn't exist anymore - now there will be an error */ + nidW.cbSize = sizeof(nidW); + /* wine currently doesn't return error code put prints an ERR(...) */ + todo_wine ok(!pShell_NotifyIconW(NIM_DELETE, &nidW), "The icon was not deleted\n"); + }
/* same for Shell_NotifyIconA */ ZeroMemory(&nidA, sizeof(nidA)); @@ -77,6 +82,10 @@ START_TEST(systray) WNDCLASSA wc; MSG msg; RECT rc; + HMODULE hdll; + + hdll = GetModuleHandleA("shell32.dll"); + pShell_NotifyIconW = (void*)GetProcAddress(hdll, "Shell_NotifyIconW");
wc.style = CS_HREDRAW | CS_VREDRAW; wc.cbClsExtra = 0;