shell32/tests: Use GetProcAddress() on Shell_NotifyIconW() because it is missing on Windows 95.
This commit is contained in:
parent
d22568d094
commit
46735ae431
|
@ -26,12 +26,16 @@
|
||||||
|
|
||||||
|
|
||||||
static HWND hMainWnd;
|
static HWND hMainWnd;
|
||||||
|
static BOOL (WINAPI *pShell_NotifyIconW)(DWORD,PNOTIFYICONDATAW);
|
||||||
|
|
||||||
void test_cbsize(void)
|
void test_cbsize(void)
|
||||||
{
|
{
|
||||||
NOTIFYICONDATAW nidW;
|
|
||||||
NOTIFYICONDATAA nidA;
|
NOTIFYICONDATAA nidA;
|
||||||
|
|
||||||
|
if (pShell_NotifyIconW)
|
||||||
|
{
|
||||||
|
NOTIFYICONDATAW nidW;
|
||||||
|
|
||||||
ZeroMemory(&nidW, sizeof(nidW));
|
ZeroMemory(&nidW, sizeof(nidW));
|
||||||
nidW.cbSize = NOTIFYICONDATAW_V1_SIZE;
|
nidW.cbSize = NOTIFYICONDATAW_V1_SIZE;
|
||||||
nidW.hWnd = hMainWnd;
|
nidW.hWnd = hMainWnd;
|
||||||
|
@ -39,17 +43,18 @@ void test_cbsize(void)
|
||||||
nidW.uFlags = NIF_ICON|NIF_MESSAGE;
|
nidW.uFlags = NIF_ICON|NIF_MESSAGE;
|
||||||
nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||||
nidW.uCallbackMessage = WM_USER+17;
|
nidW.uCallbackMessage = WM_USER+17;
|
||||||
ok(Shell_NotifyIconW(NIM_ADD, &nidW), "NIM_ADD failed!\n");
|
ok(pShell_NotifyIconW(NIM_ADD, &nidW), "NIM_ADD failed!\n");
|
||||||
|
|
||||||
/* using an invalid cbSize does work */
|
/* using an invalid cbSize does work */
|
||||||
nidW.cbSize = 3;
|
nidW.cbSize = 3;
|
||||||
nidW.hWnd = hMainWnd;
|
nidW.hWnd = hMainWnd;
|
||||||
nidW.uID = 1;
|
nidW.uID = 1;
|
||||||
ok(Shell_NotifyIconW(NIM_DELETE, &nidW), "NIM_DELETE failed!\n");
|
ok(pShell_NotifyIconW(NIM_DELETE, &nidW), "NIM_DELETE failed!\n");
|
||||||
/* as icon doesn't exist anymore - now there will be an error */
|
/* as icon doesn't exist anymore - now there will be an error */
|
||||||
nidW.cbSize = sizeof(nidW);
|
nidW.cbSize = sizeof(nidW);
|
||||||
/* wine currently doesn't return error code put prints an ERR(...) */
|
/* 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");
|
todo_wine ok(!pShell_NotifyIconW(NIM_DELETE, &nidW), "The icon was not deleted\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* same for Shell_NotifyIconA */
|
/* same for Shell_NotifyIconA */
|
||||||
ZeroMemory(&nidA, sizeof(nidA));
|
ZeroMemory(&nidA, sizeof(nidA));
|
||||||
|
@ -77,6 +82,10 @@ START_TEST(systray)
|
||||||
WNDCLASSA wc;
|
WNDCLASSA wc;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
HMODULE hdll;
|
||||||
|
|
||||||
|
hdll = GetModuleHandleA("shell32.dll");
|
||||||
|
pShell_NotifyIconW = (void*)GetProcAddress(hdll, "Shell_NotifyIconW");
|
||||||
|
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
|
|
Loading…
Reference in New Issue