Commit c8431d97 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

explorerframe/tests: Enable compilation with long types.

parent 4bd7b55d
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = explorerframe.dll
IMPORTS = uuid shell32 ole32 user32
......
......@@ -174,8 +174,8 @@ static HRESULT WINAPI NSTCEvents_fnOnSelectionChanged(
HRESULT hr;
DWORD count = 0xdeadbeef;
hr = IShellItemArray_GetCount(psiaSelection, &count);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(count == 1, "Got count 0x%x\n", count);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(count == 1, "Got count 0x%lx\n", count);
}
This->count[OnSelectionChanged]++;
return E_NOTIMPL;
......@@ -190,8 +190,8 @@ static HRESULT WINAPI NSTCEvents_fnOnKeyboardInput(
INameSpaceTreeControlEventsImpl *This = impl_from_INameSpaceTreeControlEvents(iface);
This->count[OnKeyboardInput]++;
ok(wParam == 0x1234, "Got unexpected wParam %lx\n", wParam);
ok(lParam == 0x1234, "Got unexpected lParam %lx\n", lParam);
ok(wParam == 0x1234, "Got unexpected wParam %Ix\n", wParam);
ok(lParam == 0x1234, "Got unexpected lParam %Ix\n", lParam);
return E_NOTIMPL;
}
......@@ -501,12 +501,12 @@ static HWND get_treeview_hwnd(INameSpaceTreeControl *pnstc)
HWND treeview = NULL;
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
HWND host;
hr = IOleWindow_GetWindow(pow, &host);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
treeview = FindWindowExW(host, NULL, WC_TREEVIEWW, NULL);
IOleWindow_Release(pow);
......@@ -584,44 +584,44 @@ static BOOL test_initialization(void)
hr = CoCreateInstance(&CLSID_NamespaceTreeControl, NULL, CLSCTX_INPROC_SERVER,
&IID_INameSpaceTreeControl, (void**)&pnstc);
ok(hr == S_OK || hr == REGDB_E_CLASSNOTREG, "Got 0x%08x\n", hr);
ok(hr == S_OK || hr == REGDB_E_CLASSNOTREG, "Got 0x%08lx\n", hr);
if(FAILED(hr))
{
return FALSE;
}
hr = INameSpaceTreeControl_Initialize(pnstc, NULL, NULL, 0);
ok(hr == HRESULT_FROM_WIN32(ERROR_TLW_WITH_WSCHILD), "Got (0x%08x)\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_TLW_WITH_WSCHILD), "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_Initialize(pnstc, (HWND)0xDEADBEEF, NULL, 0);
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE), "Got (0x%08x)\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE), "Got (0x%08lx)\n", hr);
ZeroMemory(&rc, sizeof(RECT));
hr = INameSpaceTreeControl_Initialize(pnstc, NULL, &rc, 0);
ok(hr == HRESULT_FROM_WIN32(ERROR_TLW_WITH_WSCHILD), "Got (0x%08x)\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_TLW_WITH_WSCHILD), "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_Initialize(pnstc, (HWND)0xDEADBEEF, &rc, 0);
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE), "Got (0x%08x)\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE), "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
if(SUCCEEDED(hr))
{
hr = IOleWindow_GetWindow(pow, &hwnd_host1);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(hwnd_host1 == NULL, "hwnd is not null.\n");
hr = IOleWindow_ContextSensitiveHelp(pow, TRUE);
ok(hr == E_NOTIMPL, "Got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "Got (0x%08lx)\n", hr);
hr = IOleWindow_ContextSensitiveHelp(pow, FALSE);
ok(hr == E_NOTIMPL, "Got (0x%08x)\n", hr);
ok(hr == E_NOTIMPL, "Got (0x%08lx)\n", hr);
IOleWindow_Release(pow);
}
hr = INameSpaceTreeControl_Initialize(pnstc, hwnd, NULL, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
static const CHAR namespacetree[] = "NamespaceTreeControl";
......@@ -629,7 +629,7 @@ static BOOL test_initialization(void)
LONG style, expected_style;
HWND hwnd_tv;
hr = IOleWindow_GetWindow(pow, &hwnd_host1);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(hwnd_host1 != NULL, "hwnd_host1 is null.\n");
buf[0] = '\0';
GetClassNameA(hwnd_host1, buf, 1024);
......@@ -637,15 +637,15 @@ static BOOL test_initialization(void)
expected_style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
style = GetWindowLongPtrW(hwnd_host1, GWL_STYLE);
ok(style == expected_style, "Got style %08x\n", style);
ok(style == expected_style, "Got style %08lx\n", style);
expected_style = 0;
style = GetWindowLongPtrW(hwnd_host1, GWL_EXSTYLE);
ok(style == expected_style, "Got style %08x\n", style);
ok(style == expected_style, "Got style %08lx\n", style);
expected_style = 0;
style = SendMessageW(hwnd_host1, TVM_GETEXTENDEDSTYLE, 0, 0);
ok(style == expected_style, "Got 0x%08x\n", style);
ok(style == expected_style, "Got 0x%08lx\n", style);
hwnd_tv = FindWindowExW(hwnd_host1, NULL, WC_TREEVIEWW, NULL);
ok(hwnd_tv != NULL, "Failed to get treeview hwnd.\n");
......@@ -655,16 +655,16 @@ static BOOL test_initialization(void)
WS_CLIPCHILDREN | WS_TABSTOP | TVS_NOHSCROLL |
TVS_NONEVENHEIGHT | TVS_INFOTIP | TVS_TRACKSELECT | TVS_EDITLABELS;
style = GetWindowLongPtrW(hwnd_tv, GWL_STYLE);
ok(style == expected_style, "Got style %08x\n", style);
ok(style == expected_style, "Got style %08lx\n", style);
expected_style = 0;
style = GetWindowLongPtrW(hwnd_tv, GWL_EXSTYLE);
ok(style == expected_style, "Got style %08x\n", style);
ok(style == expected_style, "Got style %08lx\n", style);
expected_style = TVS_EX_NOSINGLECOLLAPSE | TVS_EX_DOUBLEBUFFER |
TVS_EX_RICHTOOLTIP | TVS_EX_DRAWIMAGEASYNC;
style = SendMessageW(hwnd_tv, TVM_GETEXTENDEDSTYLE, 0, 0);
todo_wine ok(style == expected_style, "Got 0x%08x\n", style);
todo_wine ok(style == expected_style, "Got 0x%08lx\n", style);
}
IOleWindow_Release(pow);
......@@ -675,13 +675,13 @@ static BOOL test_initialization(void)
/* The control can be initialized again without crashing, but
* the reference counting will break. */
hr = INameSpaceTreeControl_Initialize(pnstc, hwnd, &rc, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
if(SUCCEEDED(hr))
{
HWND hwnd_host2;
hr = IOleWindow_GetWindow(pow, &hwnd_host2);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(hwnd_host1 != hwnd_host2, "Same hwnd.\n");
IOleWindow_Release(pow);
}
......@@ -691,35 +691,35 @@ static BOOL test_initialization(void)
/* Next three are supported on Vista/2k8, but not on newer versions */
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceObject, (void**)&punk);
ok(hr == E_NOINTERFACE || broken(hr == S_OK) /* vista, w2k8 */, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE || broken(hr == S_OK) /* vista, w2k8 */, "Got (0x%08lx)\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceActiveObject, (void**)&punk);
ok(hr == E_NOINTERFACE || broken(hr == S_OK) /* vista, w2k8 */, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE || broken(hr == S_OK) /* vista, w2k8 */, "Got (0x%08lx)\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceObjectWindowless, (void**)&punk);
ok(hr == E_NOINTERFACE || broken(hr == S_OK) /* vista, w2k8 */, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE || broken(hr == S_OK) /* vista, w2k8 */, "Got (0x%08lx)\n", hr);
if(SUCCEEDED(hr)) IUnknown_Release(punk);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceUIWindow, (void**)&punk);
ok(hr == E_NOINTERFACE, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceFrame, (void**)&punk);
ok(hr == E_NOINTERFACE, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceSite, (void**)&punk);
ok(hr == E_NOINTERFACE, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceSiteEx, (void**)&punk);
ok(hr == E_NOINTERFACE, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleInPlaceSiteWindowless, (void**)&punk);
ok(hr == E_NOINTERFACE, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "Got (0x%08lx)\n", hr);
/* On windows, the reference count won't go to zero until the
* window is destroyed. */
INameSpaceTreeControl_AddRef(pnstc);
lres = INameSpaceTreeControl_Release(pnstc);
ok(lres > 1, "Reference count was (%d).\n", lres);
ok(lres > 1, "Reference count was (%ld).\n", lres);
DestroyWindow(hwnd_host1);
lres = INameSpaceTreeControl_Release(pnstc);
ok(!lres, "lres was %d\n", lres);
ok(!lres, "lres was %ld\n", lres);
return TRUE;
}
......@@ -731,26 +731,26 @@ static void verify_root_order_(INameSpaceTreeControl *pnstc, IShellItem **roots,
IShellItemArray *psia;
hr = INameSpaceTreeControl_GetRootItems(pnstc, &psia);
ok_(file,line) (hr == S_OK, "GetRootItems: got (0x%08x)\n", hr);
ok_(file,line) (hr == S_OK, "GetRootItems: got (0x%08lx)\n", hr);
if(SUCCEEDED(hr))
{
DWORD i, expected, count = -1;
hr = IShellItemArray_GetCount(psia, &count);
ok_(file,line) (hr == S_OK, "Got (0x%08x)\n", hr);
ok_(file,line) (hr == S_OK, "Got (0x%08lx)\n", hr);
for(expected = 0; roots[expected] != NULL; expected++);
ok_(file,line) (count == expected, "Got %d roots, expected %d\n", count, expected);
ok_(file,line) (count == expected, "Got %ld roots, expected %ld\n", count, expected);
for(i = 0; i < count && roots[i] != NULL; i++)
{
IShellItem *psi;
hr = IShellItemArray_GetItemAt(psia, i, &psi);
ok_(file,line) (hr == S_OK, "GetItemAt %i: got 0x%08x\n", i, hr);
ok_(file,line) (hr == S_OK, "GetItemAt %li: got 0x%08lx\n", i, hr);
if(SUCCEEDED(hr))
{
int cmp;
hr = IShellItem_Compare(psi, roots[i], SICHINT_DISPLAY, &cmp);
ok_(file,line) (hr == S_OK, "Compare %i: got 0x%08x\n", i, hr);
ok_(file,line) (hr == S_OK, "Compare %li: got 0x%08lx\n", i, hr);
IShellItem_Release(psi);
}
}
......@@ -791,15 +791,15 @@ static void test_basics(void)
/* Create ShellItems for testing. */
SHGetDesktopFolder(&psfdesktop);
hr = pSHGetIDListFromObject((IUnknown*)psfdesktop, &pidl_desktop);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = pSHCreateShellItem(NULL, NULL, pidl_desktop, &psidesktop);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
hr = pSHCreateShellItem(NULL, NULL, pidl_desktop, &psidesktop2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(FAILED(hr)) IShellItem_Release(psidesktop);
}
ILFree(pidl_desktop);
......@@ -822,45 +822,45 @@ static void test_basics(void)
myPathAddBackslashW(buf);
lstrcatW(buf, L"testdir");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psitestdir);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(FAILED(hr)) goto cleanup;
lstrcpyW(buf, curdirW);
myPathAddBackslashW(buf);
lstrcatW(buf, L"testdir\\testdir2");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psitestdir2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(FAILED(hr)) goto cleanup;
lstrcpyW(buf, curdirW);
myPathAddBackslashW(buf);
lstrcatW(buf, L"testdir\\test1.txt");
hr = pSHCreateItemFromParsingName(buf, NULL, &IID_IShellItem, (void**)&psitest1);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(FAILED(hr)) goto cleanup;
hr = CoCreateInstance(&CLSID_NamespaceTreeControl, NULL, CLSCTX_INPROC_SERVER,
&IID_INameSpaceTreeControl, (void**)&pnstc);
ok(hr == S_OK, "Failed to initialize control (0x%08x)\n", hr);
ok(hr == S_OK, "Failed to initialize control (0x%08lx)\n", hr);
/* Some tests on an uninitialized control */
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveRoot(pnstc, psidesktop);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveRoot(pnstc, NULL);
ok(hr == E_NOINTERFACE, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, SHCONTF_NONFOLDERS, 0, NULL);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
process_msgs();
/* Initialize the control */
SetRect(&rc, 0, 0, 200, 200);
hr = INameSpaceTreeControl_Initialize(pnstc, hwnd, &rc, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
/* Set/GetControlStyle(2) */
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_INameSpaceTreeControl2, (void**)&pnstc2);
ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got 0x%08x\n", hr);
ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
DWORD tmp;
......@@ -875,7 +875,7 @@ static void test_basics(void)
/* We can use this to differentiate between two versions of
* this interface. Windows 7 returns hr == S_OK. */
hr = INameSpaceTreeControl2_SetControlStyle(pnstc2, 0, 0);
ok(hr == S_OK || broken(hr == E_FAIL), "Got 0x%08x\n", hr);
ok(hr == S_OK || broken(hr == E_FAIL), "Got 0x%08lx\n", hr);
if(hr == S_OK)
{
static const NSTCSTYLE styles[] =
......@@ -891,86 +891,86 @@ static void test_basics(void)
/* Set/GetControlStyle */
style = style2 = 0xdeadbeef;
hr = INameSpaceTreeControl2_GetControlStyle(pnstc2, 0xFFFFFFFF, &style);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(style == 0, "Got style %x\n", style);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style == 0, "Got style %lx\n", style);
hr = INameSpaceTreeControl2_SetControlStyle(pnstc2, 0, 0xFFFFFFF);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
tmp = 0;
for(i = 0; styles[i] != 0; i++)
{
hr = INameSpaceTreeControl2_SetControlStyle(pnstc2, styles[i], styles[i]);
ok(hr == S_OK, "Got 0x%08x (%x)\n", hr, styles[i]);
ok(hr == S_OK, "Got 0x%08lx (%lx)\n", hr, styles[i]);
if(SUCCEEDED(hr)) tmp |= styles[i];
}
hr = INameSpaceTreeControl2_GetControlStyle(pnstc2, 0xFFFFFFFF, &style);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(style == tmp, "Got style %x (expected %x)\n", style, tmp);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style == tmp, "Got style %lx (expected %lx)\n", style, tmp);
if(SUCCEEDED(hr))
{
NSTCSTYLE tmp2;
for(i = 0; styles[i] != 0; i++)
{
hr = INameSpaceTreeControl2_GetControlStyle(pnstc2, styles[i], &tmp2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(tmp2 == (style & styles[i]), "Got %x\n", tmp2);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(tmp2 == (style & styles[i]), "Got %lx\n", tmp2);
}
}
for(i = 0; styles[i] != 0; i++)
{
hr = INameSpaceTreeControl2_SetControlStyle(pnstc2, styles[i], 0);
ok(hr == S_OK, "Got 0x%08x (%x)\n", hr, styles[i]);
ok(hr == S_OK, "Got 0x%08lx (%lx)\n", hr, styles[i]);
}
hr = INameSpaceTreeControl2_GetControlStyle(pnstc2, 0xFFFFFFFF, &style);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(style == 0, "Got style %x\n", style);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style == 0, "Got style %lx\n", style);
/* Set/GetControlStyle2 */
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, 0xFFFFFFFF, &style2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style2 == 0, "Got style %x\n", style2);
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, 0, 0);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, 0, 0xFFFFFFFF);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, 0xFFFFFFFF, 0);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, 0xFFFFFFFF, 0xFFFFFFFF);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, 0xFFFFFFFF, 0);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, 0xFFFFFFFF, &style2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style2 == 0x00000000, "Got style %x\n", style2);
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, 0xFFFF, &style2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style2 == 0, "Got style %x\n", style2);
tmp = 0;
for(i = 0; styles2[i] != 0; i++)
{
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, styles2[i], styles2[i]);
ok(hr == S_OK, "Got 0x%08x (%x)\n", hr, styles2[i]);
ok(hr == S_OK, "Got 0x%08lx (%x)\n", hr, styles2[i]);
if(SUCCEEDED(hr)) tmp |= styles2[i];
}
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, 0xFFFF, &style2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(style2 == tmp, "Got style %x (expected %x)\n", style2, tmp);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style2 == tmp, "Got style %x (expected %lx)\n", style2, tmp);
if(SUCCEEDED(hr))
{
NSTCSTYLE2 tmp2;
for(i = 0; styles2[i] != 0; i++)
{
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, styles2[i], &tmp2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(tmp2 == (style2 & styles2[i]), "Got %x\n", tmp2);
}
}
......@@ -978,10 +978,10 @@ static void test_basics(void)
for(i = 0; styles2[i] != 0; i++)
{
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, styles2[i], 0);
ok(hr == S_OK, "Got 0x%08x (%x)\n", hr, styles2[i]);
ok(hr == S_OK, "Got 0x%08lx (%x)\n", hr, styles2[i]);
}
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, 0xFFFF, &style2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style2 == 0, "Got style %x (expected 0)\n", style2);
}
else
......@@ -1007,11 +1007,11 @@ static void test_basics(void)
style = 0xdeadbeef;
hr = INameSpaceTreeControl2_GetControlStyle(pnstc2, 0xFFFFFFFF, &style);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(style == 0xdeadbeef, "Got style %x\n", style);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style == 0xdeadbeef, "Got style %lx\n", style);
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, 0xFFFFFFFF, &style2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style2 == 0, "Got style %x\n", style2);
tmp = 0;
......@@ -1019,26 +1019,26 @@ static void test_basics(void)
{
hr = INameSpaceTreeControl2_SetControlStyle(pnstc2, styles[i], styles[i]);
ok(hr == E_FAIL || ((styles[i] & NSTCS_SPRINGEXPAND) && hr == S_OK),
"Got 0x%08x (%x)\n", hr, styles[i]);
"Got 0x%08lx (%lx)\n", hr, styles[i]);
if(SUCCEEDED(hr)) tmp |= styles[i];
}
style = 0xdeadbeef;
hr = INameSpaceTreeControl2_GetControlStyle(pnstc2, tmp, &style);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(style == 0xdeadbeef, "Got style %x\n", style);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style == 0xdeadbeef, "Got style %lx\n", style);
tmp = 0;
for(i = 0; styles2[i] != 0; i++)
{
hr = INameSpaceTreeControl2_SetControlStyle2(pnstc2, styles2[i], styles2[i]);
ok(hr == S_OK, "Got 0x%08x (%x)\n", hr, styles2[i]);
ok(hr == S_OK, "Got 0x%08lx (%x)\n", hr, styles2[i]);
if(SUCCEEDED(hr)) tmp |= styles2[i];
}
style2 = 0xdeadbeef;
hr = INameSpaceTreeControl2_GetControlStyle2(pnstc2, 0xFFFFFFFF, &style2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(style2 == tmp, "Got style %x\n", style2);
}
......@@ -1051,7 +1051,7 @@ static void test_basics(void)
}
hr = INameSpaceTreeControl_RemoveRoot(pnstc, NULL);
ok(hr == E_NOINTERFACE, "Got (0x%08x)\n", hr);
ok(hr == E_NOINTERFACE, "Got (0x%08lx)\n", hr);
/* Append / Insert root */
if(0)
......@@ -1063,43 +1063,43 @@ static void test_basics(void)
/* Note the usage of psidesktop and psidesktop2 */
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop2, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
hr = INameSpaceTreeControl_RemoveRoot(pnstc, psidesktop);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveRoot(pnstc, psidesktop);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveRoot(pnstc, psidesktop);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveRoot(pnstc, psidesktop);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_InsertRoot(pnstc, 0, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_InsertRoot(pnstc, -1, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_InsertRoot(pnstc, -1, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_InsertRoot(pnstc, 50, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_InsertRoot(pnstc, 1, psidesktop, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
/* GetRootItems */
if(0)
......@@ -1109,16 +1109,16 @@ static void test_basics(void)
}
hr = INameSpaceTreeControl_GetRootItems(pnstc, &psia);
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop2, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir2, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
roots[0] = psidesktop;
roots[1] = psidesktop2;
......@@ -1128,7 +1128,7 @@ static void test_basics(void)
verify_root_order(pnstc, roots);
hr = INameSpaceTreeControl_InsertRoot(pnstc, 0, psitestdir2, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
roots[0] = psitestdir2;
roots[1] = psidesktop;
......@@ -1139,7 +1139,7 @@ static void test_basics(void)
verify_root_order(pnstc, roots);
hr = INameSpaceTreeControl_InsertRoot(pnstc, 5, psidesktop, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
roots[0] = psitestdir2;
roots[1] = psidesktop;
......@@ -1151,7 +1151,7 @@ static void test_basics(void)
verify_root_order(pnstc, roots);
hr = INameSpaceTreeControl_InsertRoot(pnstc, 3, psitestdir2, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
roots[0] = psitestdir2;
roots[1] = psidesktop;
......@@ -1164,7 +1164,7 @@ static void test_basics(void)
verify_root_order(pnstc, roots);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir2, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
roots[0] = psitestdir2;
roots[1] = psidesktop;
......@@ -1178,7 +1178,7 @@ static void test_basics(void)
verify_root_order(pnstc, roots);
hr = INameSpaceTreeControl_InsertRoot(pnstc, -1, psidesktop, 0, 0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
roots[0] = psidesktop;
roots[1] = psitestdir2;
......@@ -1194,13 +1194,13 @@ static void test_basics(void)
/* CollapseAll */
hr = INameSpaceTreeControl_CollapseAll(pnstc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_CollapseAll(pnstc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
/* SetItemState message checks */
res = subclass_treeview(pnstc);
......@@ -1211,7 +1211,7 @@ static void test_basics(void)
hr = INameSpaceTreeControl_AppendRoot(
pnstc, psidesktop, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
/* A special case -
......@@ -1221,7 +1221,7 @@ static void test_basics(void)
tvi_count = 0;
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop,
NSTCIS_EXPANDED, NSTCIS_EXPANDED);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
todo_wine
{
ok(tvi_count == 1, "Got %d\n", tvi_count);
......@@ -1231,7 +1231,7 @@ static void test_basics(void)
tvi_count = 0;
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop,
NSTCIS_EXPANDED, NSTCIS_EXPANDED);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(tvi_count == 0, "Got %d\n", tvi_count);
/* Test all the combinations of NSTCIS_SELECTED to NSTCIS_SELECTEDNOEXPAND */
......@@ -1248,7 +1248,7 @@ static void test_basics(void)
tvi_count = 0;
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, isMask, isFlags);
ok(hr == S_OK, "(%x|%x)Got 0x%08x\n", isMask, isFlags, hr);
ok(hr == S_OK, "(%x|%x)Got 0x%08lx\n", isMask, isFlags, hr);
/*****************************/
/* Calculate expected values */
......@@ -1341,7 +1341,7 @@ static void test_basics(void)
}
}
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
}
/* GetSelectedItems */
......@@ -1353,38 +1353,38 @@ static void test_basics(void)
psia = (void*)0xdeadbeef;
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
ok(hr == E_FAIL, "Got 0x%08x\n", hr);
ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
ok(!psia || broken(psia == (void*)0xdeadbeef /* before Win8 */), "Got %p\n", psia);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir2, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir, SHCONTF_FOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
hr = INameSpaceTreeControl_SetItemState(pnstc, psitestdir,
NSTCIS_SELECTED, NSTCIS_SELECTED);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
DWORD count;
hr = IShellItemArray_GetCount(psia, &count);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(count == 1, "Got %d selected items.\n", count);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(count == 1, "Got %ld selected items.\n", count);
if(count)
{
hr = IShellItemArray_GetItemAt(psia, 0, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
int cmp;
hr = IShellItem_Compare(psi, psitestdir, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IShellItem_Release(psi);
}
}
......@@ -1393,26 +1393,26 @@ static void test_basics(void)
hr = INameSpaceTreeControl_SetItemState(pnstc, psitestdir2,
NSTCIS_SELECTED, NSTCIS_SELECTED);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
process_msgs();
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
DWORD count;
hr = IShellItemArray_GetCount(psia, &count);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(count == 1, "Got %d selected items.\n", count);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(count == 1, "Got %ld selected items.\n", count);
if(count)
{
hr = IShellItemArray_GetItemAt(psia, 0, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
int cmp;
hr = IShellItem_Compare(psi, psitestdir2, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IShellItem_Release(psi);
}
}
......@@ -1421,24 +1421,24 @@ static void test_basics(void)
hr = INameSpaceTreeControl_SetItemState(pnstc, psitest1,
NSTCIS_SELECTED, NSTCIS_SELECTED);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
DWORD count;
hr = IShellItemArray_GetCount(psia, &count);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(count == 1, "Got %d selected items.\n", count);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(count == 1, "Got %ld selected items.\n", count);
if(count)
{
hr = IShellItemArray_GetItemAt(psia, 0, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
int cmp;
hr = IShellItem_Compare(psi, psitest1, SICHINT_DISPLAY, &cmp);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
IShellItem_Release(psi);
}
}
......@@ -1446,44 +1446,44 @@ static void test_basics(void)
}
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK || broken(hr == E_FAIL), "Got 0x%08x\n", hr);
ok(hr == S_OK || broken(hr == E_FAIL), "Got 0x%08lx\n", hr);
if(hr == E_FAIL)
{
/* For some reason, Vista fails to properly remove both the
* roots here on the first try. */
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
}
/* Adding without NSTCRS_EXPANDED does not set the selection */
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
0, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
process_msgs();
hr = INameSpaceTreeControl_GetItemState(pnstc, psitestdir, 0xFF, &istate);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(!(istate & NSTCIS_SELECTED), "Got 0x%08x\n", istate);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!(istate & NSTCIS_SELECTED), "Got 0x%08lx\n", istate);
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
ok(hr == E_FAIL, "Got 0x%08x\n", hr);
ok(hr == E_FAIL, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr)) IShellItemArray_Release(psia);
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
/* Adding with NSTCRS_EXPANDED sets the selection */
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
NSTCRS_EXPANDED, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
process_msgs();
hr = INameSpaceTreeControl_GetItemState(pnstc, psitestdir, 0xFF, &istate);
ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(istate & NSTCIS_SELECTED, "Got 0x%08x\n", istate);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
todo_wine ok(istate & NSTCIS_SELECTED, "Got 0x%08lx\n", istate);
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
IShellItem *psi;
......@@ -1493,7 +1493,7 @@ static void test_basics(void)
{
INT cmp;
hr = IShellItem_Compare(psi, psitestdir, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IShellItem_Release(psi);
}
......@@ -1505,14 +1505,14 @@ static void test_basics(void)
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir2,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
NSTCRS_EXPANDED, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
process_msgs();
hr = INameSpaceTreeControl_GetItemState(pnstc, psitestdir2, 0xFF, &istate);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(!(istate & NSTCIS_SELECTED), "Got 0x%08x\n", istate);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!(istate & NSTCIS_SELECTED), "Got 0x%08lx\n", istate);
hr = INameSpaceTreeControl_GetSelectedItems(pnstc, &psia);
todo_wine ok(hr == S_OK, "Got 0x%08x\n", hr);
todo_wine ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
IShellItem *psi;
......@@ -1522,7 +1522,7 @@ static void test_basics(void)
{
INT cmp;
hr = IShellItem_Compare(psi, psitestdir, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
IShellItem_Release(psi);
}
......@@ -1531,7 +1531,7 @@ static void test_basics(void)
}
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
/* GetItemRect */
SetRectEmpty(&rc);
......@@ -1544,16 +1544,16 @@ static void test_basics(void)
}
hr = INameSpaceTreeControl_GetItemRect(pnstc, psitestdir, &rc);
ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
NSTCRS_EXPANDED, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
process_msgs();
hr = INameSpaceTreeControl_GetItemRect(pnstc, psitestdir, &rc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(rc.top != rc.bottom, "Got 0 height.\n");
ok(rc.left != rc.right, "Got 0 width.\n");
......@@ -1587,90 +1587,90 @@ static void test_basics(void)
win_skip("Skipping some GetItemRect tests.\n");
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
/* HitTest */
hr = INameSpaceTreeControl_HitTest(pnstc, NULL, NULL);
ok(hr == E_POINTER, "Got 0x%08x\n", hr);
ok(hr == E_POINTER, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_HitTest(pnstc, &pt, NULL);
ok(hr == E_POINTER, "Got 0x%08x\n", hr);
ok(hr == E_POINTER, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_HitTest(pnstc, NULL, &psi);
ok(hr == E_POINTER, "Got 0x%08x\n", hr);
ok(hr == E_POINTER, "Got 0x%08lx\n", hr);
psi = (void*)0xdeadbeef;
pt.x = pt.y = 0;
hr = INameSpaceTreeControl_HitTest(pnstc, &pt, &psi);
ok(hr == S_FALSE, "Got 0x%08x\n", hr);
ok(hr == S_FALSE, "Got 0x%08lx\n", hr);
ok(psi == NULL, "Got psi %p\n", psi);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psitestdir,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
NSTCRS_EXPANDED, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
process_msgs();
hr = INameSpaceTreeControl_HitTest(pnstc, &pt, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
int cmp;
hr = IShellItem_Compare(psi, psitestdir, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!cmp, "Got cmp %d\n", cmp);
IShellItem_Release(psi);
}
pt.y += height - 1;
hr = INameSpaceTreeControl_HitTest(pnstc, &pt, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
int cmp;
hr = IShellItem_Compare(psi, psitestdir, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!cmp, "Got cmp %d\n", cmp);
IShellItem_Release(psi);
}
pt.y += 1;
hr = INameSpaceTreeControl_HitTest(pnstc, &pt, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
int cmp;
todo_wine
{
hr = IShellItem_Compare(psi, psitestdir, SICHINT_DISPLAY, &cmp);
ok(hr == S_FALSE, "Got 0x%08x\n", hr);
ok(hr == S_FALSE, "Got 0x%08lx\n", hr);
ok(cmp, "no cmp value.\n");
hr = IShellItem_Compare(psi, psitestdir2, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!cmp, "Got cmp %d\n", cmp);
}
IShellItem_Release(psi);
}
hr = INameSpaceTreeControl_GetItemRect(pnstc, psitestdir2, &rc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
MapWindowPoints(NULL, hwnd, (POINT*)&rc, 2);
pt.x = rc.left; pt.y = rc.top;
hr = INameSpaceTreeControl_HitTest(pnstc, &pt, &psi);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
int cmp;
hr = IShellItem_Compare(psi, psitestdir2, SICHINT_DISPLAY, &cmp);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(!cmp, "Got cmp %d\n", cmp);
IShellItem_Release(psi);
}
}
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
/* GetItemCustomState / SetItemCustomState */
if(0)
......@@ -1686,30 +1686,30 @@ static void test_basics(void)
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
0, NULL);
process_msgs();
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
todo_wine
{
cbstate = -1;
hr = INameSpaceTreeControl_GetItemCustomState(pnstc, psitestdir, &cbstate);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(cbstate == BST_UNCHECKED || broken(cbstate == BST_CHECKED /* Vista x64 */),
"Got %d\n", cbstate);
hr = INameSpaceTreeControl_SetItemCustomState(pnstc, psitestdir, BST_CHECKED);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
cbstate = -1;
hr = INameSpaceTreeControl_GetItemCustomState(pnstc, psitestdir, &cbstate);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(cbstate == BST_CHECKED, "Got %d\n", cbstate);
hr = INameSpaceTreeControl_SetItemCustomState(pnstc, psitestdir, 0xFFF);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
cbstate = -1;
hr = INameSpaceTreeControl_GetItemCustomState(pnstc, psitestdir, &cbstate);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok(cbstate == 0xF, "Got %d\n", cbstate);
}
......@@ -1717,15 +1717,15 @@ static void test_basics(void)
todo_wine
{
hr = INameSpaceTreeControl_SetTheme(pnstc, NULL);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_SetTheme(pnstc, L"Explorer");
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
hr = INameSpaceTreeControl_SetTheme(pnstc, L"__hello");
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
}
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
IShellItem_Release(psidesktop);
IShellItem_Release(psidesktop2);
......@@ -1734,12 +1734,12 @@ static void test_basics(void)
IShellItem_Release(psitest1);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
HWND hwnd_nstc;
hr = IOleWindow_GetWindow(pow, &hwnd_nstc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
DestroyWindow(hwnd_nstc);
IOleWindow_Release(pow);
}
......@@ -1770,7 +1770,7 @@ static void test_events(void)
hr = CoCreateInstance(&CLSID_NamespaceTreeControl, NULL, CLSCTX_INPROC_SERVER,
&IID_INameSpaceTreeControl, (void**)&pnstc);
ok(hr == S_OK, "Failed to initialize control (0x%08x)\n", hr);
ok(hr == S_OK, "Failed to initialize control (0x%08lx)\n", hr);
ok(pSHCreateShellItem != NULL, "No SHCreateShellItem.\n");
ok(pSHGetIDListFromObject != NULL, "No SHCreateShellItem.\n");
......@@ -1778,9 +1778,9 @@ static void test_events(void)
SHGetDesktopFolder(&psfdesktop);
hr = pSHGetIDListFromObject((IUnknown*)psfdesktop, &pidl_desktop);
IShellFolder_Release(psfdesktop);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
hr = pSHCreateShellItem(NULL, NULL, pidl_desktop, &psidesktop);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ILFree(pidl_desktop);
/* Create two instances of INameSpaceTreeControlEvents */
......@@ -1807,80 +1807,80 @@ static void test_events(void)
pnstceimpl->qi_called_count = 0;
cookie1 = 1;
hr = INameSpaceTreeControl_TreeAdvise(pnstc, (IUnknown*)pnstce, &cookie1);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(cookie1 == 0, "cookie now (0x%08x)\n", cookie1);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
ok(cookie1 == 0, "cookie now (0x%08lx)\n", cookie1);
ok(pnstceimpl->qi_called_count > 1, "got %d\n", pnstceimpl->qi_called_count);
ok(pnstceimpl->ref == 1, "refcount was %d\n", pnstceimpl->ref);
ok(pnstceimpl->ref == 1, "refcount was %ld\n", pnstceimpl->ref);
/* Accept query for IID_INameSpaceTreeControlEvents */
pnstceimpl->qi_enable_events = TRUE;
pnstceimpl->qi_called_count = 0;
cookie1 = 0;
hr = INameSpaceTreeControl_TreeAdvise(pnstc, (IUnknown*)pnstce, &cookie1);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(cookie1 == 1, "cookie now (0x%08x)\n", cookie1);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(cookie1 == 1, "cookie now (0x%08lx)\n", cookie1);
ok(pnstceimpl->qi_called_count > 1, "got %d\n", pnstceimpl->qi_called_count);
ok(pnstceimpl->ref == 2, "refcount was %d\n", pnstceimpl->ref);
ok(pnstceimpl->ref == 2, "refcount was %ld\n", pnstceimpl->ref);
/* A second time, query interface will not be called at all. */
pnstceimpl->qi_enable_events = TRUE;
pnstceimpl->qi_called_count = 0;
cookie2 = 1;
hr = INameSpaceTreeControl_TreeAdvise(pnstc, (IUnknown*)pnstce, &cookie2);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(cookie2 == 0, "cookie now (0x%08x)\n", cookie2);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
ok(cookie2 == 0, "cookie now (0x%08lx)\n", cookie2);
ok(!pnstceimpl->qi_called_count, "QueryInterface called %d times.\n",
pnstceimpl->qi_called_count);
ok(pnstceimpl->ref == 2, "refcount was %d\n", pnstceimpl->ref);
ok(pnstceimpl->ref == 2, "refcount was %ld\n", pnstceimpl->ref);
/* Using another "instance" does not help. */
pnstceimpl2->qi_enable_events = TRUE;
pnstceimpl2->qi_called_count = 0;
cookie2 = 1;
hr = INameSpaceTreeControl_TreeAdvise(pnstc, (IUnknown*)pnstce2, &cookie2);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(cookie2 == 0, "cookie now (0x%08x)\n", cookie2);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
ok(cookie2 == 0, "cookie now (0x%08lx)\n", cookie2);
ok(!pnstceimpl2->qi_called_count, "QueryInterface called %d times.\n",
pnstceimpl2->qi_called_count);
ok(pnstceimpl2->ref == 1, "refcount was %d\n", pnstceimpl->ref);
ok(pnstceimpl2->ref == 1, "refcount was %ld\n", pnstceimpl->ref);
/* Unadvise with bogus cookie (will actually unadvise properly) */
pnstceimpl->qi_enable_events = TRUE;
pnstceimpl->qi_called_count = 0;
hr = INameSpaceTreeControl_TreeUnadvise(pnstc, 1234);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(!pnstceimpl->qi_called_count, "QueryInterface called %d times.\n",
pnstceimpl->qi_called_count);
ok(pnstceimpl->ref == 1, "refcount was %d\n", pnstceimpl->ref);
ok(pnstceimpl->ref == 1, "refcount was %ld\n", pnstceimpl->ref);
/* Unadvise "properly" (will have no additional effect) */
pnstceimpl->qi_enable_events = TRUE;
pnstceimpl->qi_called_count = 0;
hr = INameSpaceTreeControl_TreeUnadvise(pnstc, cookie1);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(!pnstceimpl->qi_called_count, "QueryInterface called %d times.\n",
pnstceimpl->qi_called_count);
ok(pnstceimpl->ref == 1, "refcount was %d\n", pnstceimpl->ref);
ok(pnstceimpl->ref == 1, "refcount was %ld\n", pnstceimpl->ref);
/* Advise again.. */
pnstceimpl->qi_enable_events = 1;
pnstceimpl->qi_called_count = 0;
hr = INameSpaceTreeControl_TreeAdvise(pnstc, (IUnknown*)pnstce, &cookie2);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(cookie2 == 1, "Cookie is %d\n", cookie2);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(cookie2 == 1, "Cookie is %ld\n", cookie2);
ok(cookie1 == cookie2, "Old cookie differs from old cookie.\n");
/* several kinds of callbacks are queried for */
ok(pnstceimpl->qi_called_count > 1, "got %d\n", pnstceimpl->qi_called_count);
ok(pnstceimpl->ref == 2, "refcount was %d\n", pnstceimpl->ref);
ok(pnstceimpl->ref == 2, "refcount was %ld\n", pnstceimpl->ref);
/* Initialize the control */
hr = INameSpaceTreeControl_Initialize(pnstc, hwnd, NULL, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
ok_event_count(pnstceimpl, OnGetDefaultIconIndex, 0);
......@@ -1946,27 +1946,27 @@ static void test_events(void)
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
process_msgs();
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
ok_event(pnstceimpl, OnItemDeleted);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08lx\n", itemstate);
process_msgs();
ok_no_events(pnstceimpl);
/* Expand the root */
itemstate |= NSTCIS_EXPANDED;
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count(pnstceimpl, OnBeforeExpand, 1);
ok_event_broken(pnstceimpl, OnItemAdded); /* Does not fire on Vista */
......@@ -1978,13 +1978,13 @@ static void test_events(void)
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate & NSTCIS_EXPANDED, "Item not expanded.\n");
todo_wine
{
ok(itemstate == (NSTCIS_SELECTED | NSTCIS_EXPANDED)||
broken(itemstate == NSTCIS_EXPANDED) /* Vista */,
"itemstate is 0x%08x\n", itemstate);
"itemstate is 0x%08lx\n", itemstate);
process_msgs();
ok_event_count_broken(pnstceimpl, OnSelectionChanged, 1, 0 /* Vista*/);
}
......@@ -1993,22 +1993,22 @@ static void test_events(void)
/* Deselect the root */
itemstate &= ~NSTCIS_SELECTED;
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == (NSTCIS_EXPANDED), "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == (NSTCIS_EXPANDED), "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_CollapseAll(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
/* Delete all roots */
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_event_count(pnstceimpl, OnItemDeleted, 1);
ok_no_events(pnstceimpl);
......@@ -2026,26 +2026,26 @@ static void test_events(void)
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "Got (0x%08lx)\n", hr);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, 0);
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0, 0xffff);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
todo_wine
{
......@@ -2057,69 +2057,69 @@ static void test_events(void)
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
todo_wine
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08x\n", itemstate);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, NSTCIS_SELECTED);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count(pnstceimpl, OnSelectionChanged, 1);
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, NSTCIS_EXPANDED, NSTCIS_SELECTED);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, NSTCIS_SELECTEDNOEXPAND);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_SELECTED, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, NSTCIS_EXPANDED);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
todo_wine
{
......@@ -2131,111 +2131,111 @@ static void test_events(void)
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_EXPANDED, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_EXPANDED, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_NONE, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff, 0xffff);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
todo_wine
{
ok(itemstate == (NSTCIS_EXPANDED | NSTCIS_BOLD | NSTCIS_DISABLED),
"itemstate is 0x%08x\n", itemstate);
"itemstate is 0x%08lx\n", itemstate);
}
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, NSTCIS_SELECTED, NSTCIS_SELECTED);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
todo_wine
{
ok(itemstate == (NSTCIS_EXPANDED | NSTCIS_BOLD | NSTCIS_DISABLED),
"itemstate is 0x%08x\n", itemstate);
"itemstate is 0x%08lx\n", itemstate);
}
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop,
NSTCIS_SELECTED | NSTCIS_DISABLED, NSTCIS_SELECTED);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == (NSTCIS_BOLD | NSTCIS_EXPANDED),
"itemstate is 0x%08x\n", itemstate);
"itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, NSTCIS_SELECTED, NSTCIS_SELECTED);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == (NSTCIS_BOLD | NSTCIS_EXPANDED),
"itemstate is 0x%08x\n", itemstate);
"itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, 0xffff & ~NSTCIS_DISABLED, 0);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_no_events(pnstceimpl);
itemstate = 0xDEADBEEF;
hr = INameSpaceTreeControl_GetItemState(pnstc, psidesktop, 0xffff, &itemstate);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(itemstate == NSTCIS_BOLD, "itemstate is 0x%08x\n", itemstate);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok(itemstate == NSTCIS_BOLD, "itemstate is 0x%08lx\n", itemstate);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_event_count(pnstceimpl, OnItemDeleted, 1);
ok_no_events(pnstceimpl);
/* GetNextItem */
hr = INameSpaceTreeControl_GetNextItem(pnstc, NULL, 0, NULL);
ok(hr == E_POINTER, "Got (0x%08x)\n", hr);
ok(hr == E_POINTER, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_GetNextItem(pnstc, psidesktop, 0, NULL);
ok(hr == E_POINTER, "Got (0x%08x)\n", hr);
ok(hr == E_POINTER, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_GetNextItem(pnstc, NULL, 0, &psi);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_GetNextItem(pnstc, psidesktop, 0, &psi);
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
ok_no_events(pnstceimpl);
......@@ -2243,14 +2243,14 @@ static void test_events(void)
/* Get child from unexpanded and unfilled parent */
psi = (void*)0xDEADBEEF;
hr = INameSpaceTreeControl_GetNextItem(pnstc, psidesktop, NSTCGNI_CHILD, &psi);
ok(hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(hr == E_FAIL, "Got (0x%08lx)\n", hr);
ok(psi == NULL, "psi is %p\n", psi);
process_msgs();
ok_no_events(pnstceimpl);
/* Expand and try again */
hr = INameSpaceTreeControl_SetItemState(pnstc, psidesktop, NSTCIS_EXPANDED, 0xffff);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count(pnstceimpl, OnBeforeExpand, 1);
ok_event_broken(pnstceimpl, OnItemAdded); /* Does not fire on Vista */
......@@ -2259,14 +2259,14 @@ static void test_events(void)
ok_no_events(pnstceimpl);
psi = (void*)0xDEADBEEF;
hr = INameSpaceTreeControl_GetNextItem(pnstc, psidesktop, NSTCGNI_CHILD, &psi);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok((psi != NULL) && (psi != (void*)0xDEADBEEF), "psi is %p\n", psi);
process_msgs();
ok_no_events(pnstceimpl);
if(SUCCEEDED(hr)) IShellItem_Release(psi);
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_event_count(pnstceimpl, OnItemDeleted, 1);
ok_no_events(pnstceimpl);
......@@ -2278,43 +2278,43 @@ static void test_events(void)
}
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psidesktop);
ok(hr == E_INVALIDARG || hr == E_FAIL, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG || hr == E_FAIL, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = pSHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidl_drives);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
if(SUCCEEDED(hr))
{
hr = pSHCreateShellItem(NULL, NULL, pidl_drives, &psi);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
if(SUCCEEDED(hr))
{
hr = INameSpaceTreeControl_AppendRoot(pnstc, psi, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psidesktop);
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
ok(hr == E_INVALIDARG, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psi);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
process_msgs();
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psidesktop);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psi);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_no_events(pnstceimpl);
}
......@@ -2327,23 +2327,23 @@ static void test_events(void)
skip("Failed to get pidl for CSIDL_DRIVES.\n");
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
ok(hr == S_OK, "Got (0x%08x)\n", hr);
ok(hr == S_OK, "Got (0x%08lx)\n", hr);
ok_event_count(pnstceimpl, OnItemDeleted, 2);
ok_no_events(pnstceimpl);
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
if(SUCCEEDED(hr))
{
HWND hwnd_nstc;
hr = IOleWindow_GetWindow(pow, &hwnd_nstc);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
DestroyWindow(hwnd_nstc);
IOleWindow_Release(pow);
}
hr = INameSpaceTreeControl_TreeUnadvise(pnstc, cookie2);
ok(hr == S_OK, "Got 0x%08x\n", hr);
ok(hr == S_OK, "Got 0x%08lx\n", hr);
res = INameSpaceTreeControl_Release(pnstc);
ok(!res, "res was %d!\n", res);
......@@ -2370,7 +2370,7 @@ static void setup_window(void)
RegisterClassA(&wc);
hwnd = CreateWindowA(nstctest_wnd_name, NULL, WS_TABSTOP,
0, 0, 200, 200, NULL, 0, 0, NULL);
ok(hwnd != NULL, "Failed to create window for test (lasterror: %d).\n",
ok(hwnd != NULL, "Failed to create window for test (lasterror: %ld).\n",
GetLastError());
}
......
......@@ -30,132 +30,132 @@ static void test_ITaskbarList(void)
HWND hwnd;
hwnd = CreateWindowA(WC_STATICA, "test", WS_POPUP | WS_VISIBLE, 0, 0, 50, 50, 0, 0, 0, NULL);
ok(hwnd != NULL, "Failed to create a test window, error %u.\n", GetLastError());
ok(hwnd != NULL, "Failed to create a test window, error %lu.\n", GetLastError());
hr = CoCreateInstance((const CLSID *)&CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER,
(const IID *)&IID_ITaskbarList, (void **)&taskbarlist);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref_count = ITaskbarList_AddRef(taskbarlist);
ok(ref_count == 2, "Got unexpected reference count %u.\n", ref_count);
ok(ref_count == 2, "Got unexpected reference count %lu.\n", ref_count);
ref_count = ITaskbarList_Release(taskbarlist);
ok(ref_count == 1, "Got unexpected reference count %u.\n", ref_count);
ok(ref_count == 1, "Got unexpected reference count %lu.\n", ref_count);
/* Test calling methods before calling ITaskbarList::HrInit() */
hr = ITaskbarList_AddTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_SetActiveAlt(taskbarlist, hwnd);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_ActivateTab(taskbarlist, hwnd);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_DeleteTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Call ITaskbarList::HrInit() */
hr = ITaskbarList_HrInit(taskbarlist);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Test ITaskbarList::HrInit() */
/* Call ITaskbarList::HrInit() again */
hr = ITaskbarList_HrInit(taskbarlist);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Test ITaskbarList::AddTab() */
/* Check invalid parameters */
hr = ITaskbarList_AddTab(taskbarlist, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_AddTab(taskbarlist, (HWND)0xdeadbeef);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Normal ITaskbarList::AddTab() */
hr = ITaskbarList_AddTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Repeat ITaskbarList::AddTab() with the same hwnd */
hr = ITaskbarList_AddTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_DeleteTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Test ITaskbarList::SetActiveAlt() */
/* Check invalid parameters */
hr = ITaskbarList_SetActiveAlt(taskbarlist, NULL);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_SetActiveAlt(taskbarlist, (HWND)0xdeadbeef);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Normal ITaskbarList::SetActiveAlt() */
hr = ITaskbarList_AddTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_SetActiveAlt(taskbarlist, hwnd);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Repeat ITaskbarList::SetActiveAlt() with the same hwnd */
hr = ITaskbarList_SetActiveAlt(taskbarlist, hwnd);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_DeleteTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Test ITaskbarList::ActivateTab() */
/* Check invalid parameters */
hr = ITaskbarList_ActivateTab(taskbarlist, NULL);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_ActivateTab(taskbarlist, (HWND)0xdeadbeef);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Normal ITaskbarList::ActivateTab() */
hr = ITaskbarList_AddTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_ActivateTab(taskbarlist, hwnd);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Repeat ITaskbarList::ActivateTab() with the same hwnd */
hr = ITaskbarList_ActivateTab(taskbarlist, hwnd);
todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_DeleteTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Test ITaskbarList::DeleteTab() */
/* Check invalid parameters */
hr = ITaskbarList_DeleteTab(taskbarlist, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_DeleteTab(taskbarlist, (HWND)0xdeadbeef);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_DeleteTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
/* Normal ITaskbarList::DeleteTab() */
hr = ITaskbarList_AddTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ITaskbarList_DeleteTab(taskbarlist, hwnd);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref_count = ITaskbarList_Release(taskbarlist);
ok(ref_count == 0, "Got unexpected reference count %u.\n", ref_count);
ok(ref_count == 0, "Got unexpected reference count %lu.\n", ref_count);
DestroyWindow(hwnd);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment