b9d07de1d6ba67b4437aed1feb1dff8a986204a9
[reactos.git] / rostests / winetests / shell32 / shlview.c
1 /*
2 * Unit test of the IShellView
3 *
4 * Copyright 2010 Nikolay Sivov 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 <stdarg.h>
22 #include <stdio.h>
23
24 #define COBJMACROS
25 #define CONST_VTABLE
26
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wtypes.h"
30 #include "shellapi.h"
31
32 #include "shlguid.h"
33 #include "shlobj.h"
34 #include "shobjidl.h"
35 #include "shlwapi.h"
36 #include "ocidl.h"
37 #include "oleauto.h"
38
39 #include "initguid.h"
40
41 #include "wine/test.h"
42
43 #include "msg.h"
44
45 #define LISTVIEW_SEQ_INDEX 0
46 #define NUM_MSG_SEQUENCES 1
47
48 DEFINE_GUID(IID_IPersistHistory, 0x91a565c1, 0xe38f, 0x11d0, 0x94, 0xbf, 0x00, 0xa0, 0xc9, 0x05, 0x5c, 0xbf);
49
50 static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
51
52 static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
53 {
54 WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
55 static LONG defwndproc_counter = 0;
56 LRESULT ret;
57 struct message msg;
58
59 trace("listview: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
60
61 msg.message = message;
62 msg.flags = sent|wparam|lparam;
63 if (defwndproc_counter) msg.flags |= defwinproc;
64 msg.wParam = wParam;
65 msg.lParam = lParam;
66 add_message(sequences, LISTVIEW_SEQ_INDEX, &msg);
67
68 defwndproc_counter++;
69 ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
70 defwndproc_counter--;
71 return ret;
72 }
73
74 static HWND subclass_listview(HWND hwnd)
75 {
76 WNDPROC oldproc;
77 HWND listview;
78
79 /* listview is a first child */
80 listview = FindWindowExA(hwnd, NULL, WC_LISTVIEWA, NULL);
81 if(!listview)
82 {
83 /* .. except for some versions of Windows XP, where things
84 are slightly more complicated. */
85 HWND hwnd_tmp;
86 hwnd_tmp = FindWindowExA(hwnd, NULL, "DUIViewWndClassName", NULL);
87 hwnd_tmp = FindWindowExA(hwnd_tmp, NULL, "DirectUIHWND", NULL);
88 hwnd_tmp = FindWindowExA(hwnd_tmp, NULL, "CtrlNotifySink", NULL);
89 listview = FindWindowExA(hwnd_tmp, NULL, WC_LISTVIEWA, NULL);
90 }
91
92 oldproc = (WNDPROC)SetWindowLongPtrA(listview, GWLP_WNDPROC,
93 (LONG_PTR)listview_subclass_proc);
94 SetWindowLongPtrA(listview, GWLP_USERDATA, (LONG_PTR)oldproc);
95
96 return listview;
97 }
98
99 static UINT get_msg_count(struct msg_sequence **seq, int sequence_index, UINT message)
100 {
101 struct msg_sequence *msg_seq = seq[sequence_index];
102 UINT i, count = 0;
103
104 for(i = 0; i < msg_seq->count ; i++)
105 if(msg_seq->sequence[i].message == message)
106 count++;
107
108 return count;
109 }
110
111 /* Checks that every message in the sequence seq is also present in
112 * the UINT array msgs */
113 static void verify_msgs_in_(struct msg_sequence *seq, const UINT *msgs,
114 const char *file, int line)
115 {
116 UINT i, j, msg, failcount = 0;
117 for(i = 0; i < seq->count; i++)
118 {
119 BOOL found = FALSE;
120 msg = seq->sequence[i].message;
121 for(j = 0; msgs[j] != 0; j++)
122 if(msgs[j] == msg) found = TRUE;
123
124 if(!found)
125 {
126 failcount++;
127 trace("Unexpected message %d\n", msg);
128 }
129 }
130 ok_(file, line) (!failcount, "%d failures.\n", failcount);
131 flush_sequences(sequences, NUM_MSG_SEQUENCES);
132 }
133
134 #define verify_msgs_in(seq, msgs) \
135 verify_msgs_in_(seq, msgs, __FILE__, __LINE__)
136
137 /* dummy IDataObject implementation */
138 typedef struct {
139 IDataObject IDataObject_iface;
140 LONG ref;
141 } IDataObjectImpl;
142
143 static const IDataObjectVtbl IDataObjectImpl_Vtbl;
144
145 static inline IDataObjectImpl *impl_from_IDataObject(IDataObject *iface)
146 {
147 return CONTAINING_RECORD(iface, IDataObjectImpl, IDataObject_iface);
148 }
149
150 static IDataObject* IDataObjectImpl_Construct(void)
151 {
152 IDataObjectImpl *obj;
153
154 obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj));
155 obj->IDataObject_iface.lpVtbl = &IDataObjectImpl_Vtbl;
156 obj->ref = 1;
157
158 return &obj->IDataObject_iface;
159 }
160
161 static HRESULT WINAPI IDataObjectImpl_QueryInterface(IDataObject *iface, REFIID riid, void **ppvObj)
162 {
163 IDataObjectImpl *This = impl_from_IDataObject(iface);
164
165 if (IsEqualIID(riid, &IID_IUnknown) ||
166 IsEqualIID(riid, &IID_IDataObject))
167 {
168 *ppvObj = This;
169 }
170
171 if(*ppvObj)
172 {
173 IDataObject_AddRef(iface);
174 return S_OK;
175 }
176
177 return E_NOINTERFACE;
178 }
179
180 static ULONG WINAPI IDataObjectImpl_AddRef(IDataObject * iface)
181 {
182 IDataObjectImpl *This = impl_from_IDataObject(iface);
183 return InterlockedIncrement(&This->ref);
184 }
185
186 static ULONG WINAPI IDataObjectImpl_Release(IDataObject * iface)
187 {
188 IDataObjectImpl *This = impl_from_IDataObject(iface);
189 ULONG ref = InterlockedDecrement(&This->ref);
190
191 if (!ref)
192 {
193 HeapFree(GetProcessHeap(), 0, This);
194 return 0;
195 }
196 return ref;
197 }
198
199 static HRESULT WINAPI IDataObjectImpl_GetData(IDataObject *iface, FORMATETC *pformat, STGMEDIUM *pmedium)
200 {
201 return E_NOTIMPL;
202 }
203
204 static HRESULT WINAPI IDataObjectImpl_GetDataHere(IDataObject *iface, FORMATETC *pformat, STGMEDIUM *pmedium)
205 {
206 return E_NOTIMPL;
207 }
208
209 static HRESULT WINAPI IDataObjectImpl_QueryGetData(IDataObject *iface, FORMATETC *pformat)
210 {
211 return E_NOTIMPL;
212 }
213
214 static HRESULT WINAPI IDataObjectImpl_GetCanonicalFormatEtc(
215 IDataObject *iface, FORMATETC *pformatIn, FORMATETC *pformatOut)
216 {
217 return E_NOTIMPL;
218 }
219
220 static HRESULT WINAPI IDataObjectImpl_SetData(
221 IDataObject *iface, FORMATETC *pformat, STGMEDIUM *pmedium, BOOL release)
222 {
223 return E_NOTIMPL;
224 }
225
226 static HRESULT WINAPI IDataObjectImpl_EnumFormatEtc(
227 IDataObject *iface, DWORD direction, IEnumFORMATETC **ppenumFormatEtc)
228 {
229 return E_NOTIMPL;
230 }
231
232 static HRESULT WINAPI IDataObjectImpl_DAdvise(
233 IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pSink, DWORD *pConnection)
234 {
235 return E_NOTIMPL;
236 }
237
238 static HRESULT WINAPI IDataObjectImpl_DUnadvise(IDataObject *iface, DWORD connection)
239 {
240 return E_NOTIMPL;
241 }
242
243 static HRESULT WINAPI IDataObjectImpl_EnumDAdvise(IDataObject *iface, IEnumSTATDATA **ppenumAdvise)
244 {
245 return E_NOTIMPL;
246 }
247
248 static const IDataObjectVtbl IDataObjectImpl_Vtbl =
249 {
250 IDataObjectImpl_QueryInterface,
251 IDataObjectImpl_AddRef,
252 IDataObjectImpl_Release,
253 IDataObjectImpl_GetData,
254 IDataObjectImpl_GetDataHere,
255 IDataObjectImpl_QueryGetData,
256 IDataObjectImpl_GetCanonicalFormatEtc,
257 IDataObjectImpl_SetData,
258 IDataObjectImpl_EnumFormatEtc,
259 IDataObjectImpl_DAdvise,
260 IDataObjectImpl_DUnadvise,
261 IDataObjectImpl_EnumDAdvise
262 };
263
264 /* dummy IShellBrowser implementation */
265 typedef struct {
266 IShellBrowser IShellBrowser_iface;
267 LONG ref;
268 } IShellBrowserImpl;
269
270 static const IShellBrowserVtbl IShellBrowserImpl_Vtbl;
271
272 static inline IShellBrowserImpl *impl_from_IShellBrowser(IShellBrowser *iface)
273 {
274 return CONTAINING_RECORD(iface, IShellBrowserImpl, IShellBrowser_iface);
275 }
276
277 static IShellBrowser* IShellBrowserImpl_Construct(void)
278 {
279 IShellBrowserImpl *browser;
280
281 browser = HeapAlloc(GetProcessHeap(), 0, sizeof(*browser));
282 browser->IShellBrowser_iface.lpVtbl = &IShellBrowserImpl_Vtbl;
283 browser->ref = 1;
284
285 return &browser->IShellBrowser_iface;
286 }
287
288 static HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
289 REFIID riid,
290 LPVOID *ppvObj)
291 {
292 IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
293
294 *ppvObj = NULL;
295
296 if(IsEqualIID(riid, &IID_IUnknown) ||
297 IsEqualIID(riid, &IID_IOleWindow) ||
298 IsEqualIID(riid, &IID_IShellBrowser))
299 {
300 *ppvObj = This;
301 }
302
303 if(*ppvObj)
304 {
305 IShellBrowser_AddRef(iface);
306 return S_OK;
307 }
308
309 return E_NOINTERFACE;
310 }
311
312 static ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
313 {
314 IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
315 return InterlockedIncrement(&This->ref);
316 }
317
318 static ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
319 {
320 IShellBrowserImpl *This = impl_from_IShellBrowser(iface);
321 ULONG ref = InterlockedDecrement(&This->ref);
322
323 if (!ref)
324 {
325 HeapFree(GetProcessHeap(), 0, This);
326 return 0;
327 }
328 return ref;
329 }
330
331 static HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser *iface,
332 HWND *phwnd)
333 {
334 if (phwnd) *phwnd = GetDesktopWindow();
335 return S_OK;
336 }
337
338 static HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser *iface,
339 BOOL fEnterMode)
340 {
341 return E_NOTIMPL;
342 }
343
344 static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
345 LPCITEMIDLIST pidl,
346 UINT wFlags)
347 {
348 return E_NOTIMPL;
349 }
350
351 static HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
352 BOOL fEnable)
353
354 {
355 return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
359 UINT id,
360 HWND *lphwnd)
361
362 {
363 return E_NOTIMPL;
364 }
365
366 static HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
367 DWORD mode,
368 LPSTREAM *pStrm)
369
370 {
371 return E_NOTIMPL;
372 }
373
374 static HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
375 HMENU hmenuShared,
376 LPOLEMENUGROUPWIDTHS lpMenuWidths)
377
378 {
379 return E_NOTIMPL;
380 }
381
382 static HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
383 IShellView *ppshv)
384
385 {
386 return E_NOTIMPL;
387 }
388
389 static HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
390 IShellView **ppshv)
391
392 {
393 return E_NOTIMPL;
394 }
395
396 static HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
397 HMENU hmenuShared)
398
399 {
400 return E_NOTIMPL;
401 }
402
403 static HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
404 UINT id,
405 UINT uMsg,
406 WPARAM wParam,
407 LPARAM lParam,
408 LRESULT *pret)
409
410 {
411 return E_NOTIMPL;
412 }
413
414 static HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
415 HMENU hmenuShared,
416 HOLEMENU holemenuReserved,
417 HWND hwndActiveObject)
418
419 {
420 return E_NOTIMPL;
421 }
422
423 static HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
424 LPCOLESTR lpszStatusText)
425
426 {
427 return E_NOTIMPL;
428 }
429
430 static HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
431 LPTBBUTTON lpButtons,
432 UINT nButtons,
433 UINT uFlags)
434
435 {
436 return E_NOTIMPL;
437 }
438
439 static HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
440 LPMSG lpmsg,
441 WORD wID)
442
443 {
444 return E_NOTIMPL;
445 }
446
447 static const IShellBrowserVtbl IShellBrowserImpl_Vtbl =
448 {
449 IShellBrowserImpl_QueryInterface,
450 IShellBrowserImpl_AddRef,
451 IShellBrowserImpl_Release,
452 IShellBrowserImpl_GetWindow,
453 IShellBrowserImpl_ContextSensitiveHelp,
454 IShellBrowserImpl_InsertMenusSB,
455 IShellBrowserImpl_SetMenuSB,
456 IShellBrowserImpl_RemoveMenusSB,
457 IShellBrowserImpl_SetStatusTextSB,
458 IShellBrowserImpl_EnableModelessSB,
459 IShellBrowserImpl_TranslateAcceleratorSB,
460 IShellBrowserImpl_BrowseObject,
461 IShellBrowserImpl_GetViewStateStream,
462 IShellBrowserImpl_GetControlWindow,
463 IShellBrowserImpl_SendControlMsg,
464 IShellBrowserImpl_QueryActiveShellView,
465 IShellBrowserImpl_OnViewWindowActive,
466 IShellBrowserImpl_SetToolbarItems
467 };
468
469 static const struct message empty_seq[] = {
470 { 0 }
471 };
472
473 static const struct message folderview_getspacing_seq[] = {
474 { LVM_GETITEMSPACING, wparam|sent, FALSE },
475 { 0 }
476 };
477
478 static const struct message folderview_getselectionmarked_seq[] = {
479 { LVM_GETSELECTIONMARK, sent },
480 { 0 }
481 };
482
483 static const struct message folderview_getfocused_seq[] = {
484 { LVM_GETNEXTITEM, sent|wparam|lparam|optional, -1, LVNI_FOCUSED },
485 { 0 }
486 };
487
488 static void test_IShellView_CreateViewWindow(void)
489 {
490 IShellFolder *desktop;
491 FOLDERSETTINGS settings;
492 IShellView *view;
493 IDropTarget *dt;
494 HWND hwnd_view;
495 HRESULT hr;
496 RECT r = {0};
497
498 hr = SHGetDesktopFolder(&desktop);
499 ok(hr == S_OK, "got (0x%08x)\n", hr);
500
501 hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
502 ok(hr == S_OK, "got (0x%08x)\n", hr);
503
504 if (0)
505 {
506 /* crashes on native */
507 IShellView_CreateViewWindow(view, NULL, &settings, NULL, NULL, NULL);
508 }
509
510 settings.ViewMode = FVM_ICON;
511 settings.fFlags = 0;
512 hwnd_view = (HWND)0xdeadbeef;
513 hr = IShellView_CreateViewWindow(view, NULL, &settings, NULL, NULL, &hwnd_view);
514 ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr);
515 ok(hwnd_view == 0, "got %p\n", hwnd_view);
516
517 hwnd_view = (HWND)0xdeadbeef;
518 hr = IShellView_CreateViewWindow(view, NULL, &settings, NULL, &r, &hwnd_view);
519 ok(hr == E_UNEXPECTED, "got (0x%08x)\n", hr);
520 ok(hwnd_view == 0, "got %p\n", hwnd_view);
521
522 /* ::DragLeave without drag operation */
523 hr = IShellView_QueryInterface(view, &IID_IDropTarget, (void**)&dt);
524 ok(hr == S_OK, "got (0x%08x)\n", hr);
525 hr = IDropTarget_DragLeave(dt);
526 ok(hr == S_OK, "got (0x%08x)\n", hr);
527 IDropTarget_Release(dt);
528
529 IShellView_Release(view);
530 IShellFolder_Release(desktop);
531 }
532
533 static void test_IFolderView(void)
534 {
535 IShellFolder *desktop, *folder;
536 FOLDERSETTINGS settings;
537 IShellView *view;
538 IShellBrowser *browser;
539 IFolderView *fv;
540 HWND hwnd_view, hwnd_list;
541 PITEMID_CHILD pidl;
542 HRESULT hr;
543 INT ret, count;
544 POINT pt;
545 LONG ref1, ref2;
546 RECT r;
547
548 hr = SHGetDesktopFolder(&desktop);
549 ok(hr == S_OK, "got (0x%08x)\n", hr);
550
551 hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
552 ok(hr == S_OK, "got (0x%08x)\n", hr);
553
554 hr = IShellView_QueryInterface(view, &IID_IFolderView, (void**)&fv);
555 if (hr != S_OK)
556 {
557 win_skip("IFolderView not supported by desktop folder\n");
558 IShellView_Release(view);
559 IShellFolder_Release(desktop);
560 return;
561 }
562
563 /* call methods before window creation */
564 hr = IFolderView_GetSpacing(fv, NULL);
565 ok(hr == S_FALSE || broken(hr == S_OK) /* win7 */, "got (0x%08x)\n", hr);
566
567 pidl = (void*)0xdeadbeef;
568 hr = IFolderView_Item(fv, 0, &pidl);
569 ok(hr == E_INVALIDARG || broken(hr == E_FAIL) /* < Vista */, "got (0x%08x)\n", hr);
570 ok(pidl == 0 || broken(pidl == (void*)0xdeadbeef) /* < Vista */, "got %p\n", pidl);
571
572 if (0)
573 {
574 /* crashes on Vista and Win2k8 - List not created yet case */
575 IFolderView_GetSpacing(fv, &pt);
576
577 /* crashes on XP */
578 IFolderView_GetSelectionMarkedItem(fv, NULL);
579 IFolderView_GetFocusedItem(fv, NULL);
580
581 /* crashes on Vista+ */
582 IFolderView_Item(fv, 0, NULL);
583 }
584
585 browser = IShellBrowserImpl_Construct();
586
587 settings.ViewMode = FVM_ICON;
588 settings.fFlags = 0;
589 hwnd_view = (HWND)0xdeadbeef;
590 r.left = r.top = 0;
591 r.right = r.bottom = 100;
592 hr = IShellView_CreateViewWindow(view, NULL, &settings, browser, &r, &hwnd_view);
593 ok(hr == S_OK, "got (0x%08x)\n", hr);
594 ok(IsWindow(hwnd_view), "got %p\n", hwnd_view);
595
596 hwnd_list = subclass_listview(hwnd_view);
597 if (!hwnd_list)
598 {
599 win_skip("Failed to subclass ListView control\n");
600 IShellBrowser_Release(browser);
601 IFolderView_Release(fv);
602 IShellView_Release(view);
603 IShellFolder_Release(desktop);
604 return;
605 }
606
607 /* IFolderView::GetSpacing */
608 flush_sequences(sequences, NUM_MSG_SEQUENCES);
609 hr = IFolderView_GetSpacing(fv, NULL);
610 ok(hr == S_OK, "got (0x%08x)\n", hr);
611 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, empty_seq, "IFolderView::GetSpacing, empty", FALSE);
612
613 flush_sequences(sequences, NUM_MSG_SEQUENCES);
614 hr = IFolderView_GetSpacing(fv, &pt);
615 ok(hr == S_OK, "got (0x%08x)\n", hr);
616 /* fails with empty sequence on win7 for unknown reason */
617 if (sequences[LISTVIEW_SEQ_INDEX]->count)
618 {
619 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getspacing_seq, "IFolderView::GetSpacing", FALSE);
620 ok(pt.x > 0, "got %d\n", pt.x);
621 ok(pt.y > 0, "got %d\n", pt.y);
622 ret = SendMessageA(hwnd_list, LVM_GETITEMSPACING, 0, 0);
623 ok(pt.x == LOWORD(ret) && pt.y == HIWORD(ret), "got (%d, %d)\n", LOWORD(ret), HIWORD(ret));
624 }
625
626 /* IFolderView::ItemCount */
627 if (0)
628 {
629 /* crashes on XP */
630 IFolderView_ItemCount(fv, SVGIO_ALLVIEW, NULL);
631 }
632
633 flush_sequences(sequences, NUM_MSG_SEQUENCES);
634 IFolderView_ItemCount(fv, SVGIO_ALLVIEW, &count);
635
636 /* IFolderView::GetSelectionMarkedItem */
637 if (0)
638 {
639 /* crashes on XP */
640 IFolderView_GetSelectionMarkedItem(fv, NULL);
641 }
642
643 flush_sequences(sequences, NUM_MSG_SEQUENCES);
644 hr = IFolderView_GetSelectionMarkedItem(fv, &ret);
645 if (count)
646 ok(hr == S_OK, "got (0x%08x)\n", hr);
647 else
648 ok(hr == S_FALSE, "got (0x%08x)\n", hr);
649 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getselectionmarked_seq,
650 "IFolderView::GetSelectionMarkedItem", FALSE);
651
652 /* IFolderView::GetFocusedItem */
653 flush_sequences(sequences, NUM_MSG_SEQUENCES);
654 hr = IFolderView_GetFocusedItem(fv, &ret);
655 if (count)
656 ok(hr == S_OK, "got (0x%08x)\n", hr);
657 else
658 ok(hr == S_FALSE, "got (0x%08x)\n", hr);
659 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getfocused_seq,
660 "IFolderView::GetFocusedItem", FALSE);
661
662 /* IFolderView::GetFolder, just return pointer */
663 if (0)
664 {
665 /* crashes on XP */
666 IFolderView_GetFolder(fv, NULL, (void**)&folder);
667 IFolderView_GetFolder(fv, NULL, NULL);
668 }
669
670 hr = IFolderView_GetFolder(fv, &IID_IShellFolder, NULL);
671 ok(hr == E_POINTER, "got (0x%08x)\n", hr);
672
673 ref1 = IShellFolder_AddRef(desktop);
674 IShellFolder_Release(desktop);
675 hr = IFolderView_GetFolder(fv, &IID_IShellFolder, (void**)&folder);
676 ok(hr == S_OK, "got (0x%08x)\n", hr);
677 ref2 = IShellFolder_AddRef(desktop);
678 IShellFolder_Release(desktop);
679 ok(ref1 == ref2 || ref1 + 1 == ref2, /* >= vista */
680 "expected same refcount, got %d\n", ref2);
681 ok(desktop == folder, "\n");
682
683 IShellBrowser_Release(browser);
684 IFolderView_Release(fv);
685 IShellView_Release(view);
686 IShellFolder_Release(desktop);
687 }
688
689 static void test_GetItemObject(void)
690 {
691 IShellFolder *desktop;
692 IShellView *view;
693 IUnknown *unk;
694 HRESULT hr;
695
696 hr = SHGetDesktopFolder(&desktop);
697 ok(hr == S_OK, "got (0x%08x)\n", hr);
698
699 hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
700 ok(hr == S_OK, "got (0x%08x)\n", hr);
701
702 /* from documentation three interfaces are supported for SVGIO_BACKGROUND:
703 IContextMenu, IDispatch, IPersistHistory */
704 hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IContextMenu, (void**)&unk);
705 ok(hr == S_OK, "got (0x%08x)\n", hr);
706 IUnknown_Release(unk);
707
708 unk = NULL;
709 hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IDispatch, (void**)&unk);
710 todo_wine ok(hr == S_OK || broken(hr == E_NOTIMPL) /* NT4 */, "got (0x%08x)\n", hr);
711 if (unk) IUnknown_Release(unk);
712
713 unk = NULL;
714 hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IPersistHistory, (void**)&unk);
715 todo_wine ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W9x, NT4 */, "got (0x%08x)\n", hr);
716 if (unk) IUnknown_Release(unk);
717
718 /* example of unsupported interface, base for IPersistHistory */
719 hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IPersist, (void**)&unk);
720 ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL) /* W2K */, "got (0x%08x)\n", hr);
721
722 IShellView_Release(view);
723 IShellFolder_Release(desktop);
724 }
725
726 static void test_IShellFolderView(void)
727 {
728 IShellFolderView *folderview;
729 IShellFolder *desktop;
730 IShellView *view;
731 IDataObject *obj;
732 UINT i;
733 HRESULT hr;
734
735 hr = SHGetDesktopFolder(&desktop);
736 ok(hr == S_OK, "got (0x%08x)\n", hr);
737
738 hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
739 ok(hr == S_OK, "got (0x%08x)\n", hr);
740
741 hr = IShellView_QueryInterface(view, &IID_IShellFolderView, (void**)&folderview);
742 if (hr != S_OK)
743 {
744 win_skip("IShellView doesn't provide IShellFolderView on this platform\n");
745 IShellView_Release(view);
746 IShellFolder_Release(desktop);
747 return;
748 }
749
750 /* ::MoveIcons */
751 obj = IDataObjectImpl_Construct();
752 hr = IShellFolderView_MoveIcons(folderview, obj);
753 ok(hr == E_NOTIMPL || broken(hr == S_OK) /* W98 */, "got (0x%08x)\n", hr);
754 IDataObject_Release(obj);
755
756 /* ::SetRedraw without list created */
757 hr = IShellFolderView_SetRedraw(folderview, TRUE);
758 ok(hr == S_OK, "got (0x%08x)\n", hr);
759
760 /* ::QuerySupport */
761 hr = IShellFolderView_QuerySupport(folderview, NULL);
762 ok(hr == S_OK, "got (0x%08x)\n", hr);
763 i = 0xdeadbeef;
764 hr = IShellFolderView_QuerySupport(folderview, &i);
765 ok(hr == S_OK, "got (0x%08x)\n", hr);
766 ok(i == 0xdeadbeef, "got %d\n", i);
767
768 /* ::RemoveObject */
769 i = 0xdeadbeef;
770 hr = IShellFolderView_RemoveObject(folderview, NULL, &i);
771 ok(hr == S_OK || hr == E_FAIL, "got (0x%08x)\n", hr);
772 if (hr == S_OK) ok(i == 0 || broken(i == 0xdeadbeef) /* Vista, 2k8 */,
773 "got %d\n", i);
774
775 IShellFolderView_Release(folderview);
776
777 IShellView_Release(view);
778 IShellFolder_Release(desktop);
779 }
780
781 static void test_IOleWindow(void)
782 {
783 IShellFolder *desktop;
784 IShellView *view;
785 HRESULT hr;
786
787 hr = SHGetDesktopFolder(&desktop);
788 ok(hr == S_OK, "got (0x%08x)\n", hr);
789
790 hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
791 ok(hr == S_OK, "got (0x%08x)\n", hr);
792
793 /* IShellView::ContextSensitiveHelp */
794 hr = IShellView_ContextSensitiveHelp(view, TRUE);
795 ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
796 hr = IShellView_ContextSensitiveHelp(view, FALSE);
797 ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr);
798
799 IShellView_Release(view);
800 IShellFolder_Release(desktop);
801 }
802
803 static const struct message folderview_setcurrentviewmode1_2_prevista[] = {
804 { LVM_SETVIEW, sent|wparam, LV_VIEW_ICON},
805 { LVM_SETIMAGELIST, sent|wparam, 0},
806 { LVM_SETIMAGELIST, sent|wparam, 1},
807 { 0x105a, sent},
808 { LVM_SETBKIMAGEW, sent|optional}, /* w2k3 */
809 { LVM_GETBKCOLOR, sent|optional}, /* w2k3 */
810 { LVM_GETTEXTBKCOLOR, sent|optional}, /* w2k3 */
811 { LVM_GETTEXTCOLOR, sent|optional}, /* w2k3 */
812 { LVM_SETEXTENDEDLISTVIEWSTYLE, sent|optional|wparam, 0xc8}, /* w2k3 */
813 { LVM_ARRANGE, sent },
814 { LVM_ARRANGE, sent|optional }, /* WinXP */
815 { 0 }
816 };
817
818 static const struct message folderview_setcurrentviewmode3_prevista[] = {
819 { LVM_SETVIEW, sent|wparam, LV_VIEW_LIST},
820 { LVM_SETIMAGELIST, sent|wparam, 0},
821 { LVM_SETIMAGELIST, sent|wparam, 1},
822 { 0x105a, sent},
823 { LVM_SETBKIMAGEW, sent|optional}, /* w2k3 */
824 { LVM_GETBKCOLOR, sent|optional}, /* w2k3 */
825 { LVM_GETTEXTBKCOLOR, sent|optional}, /* w2k3 */
826 { LVM_GETTEXTCOLOR, sent|optional}, /* w2k3 */
827 { LVM_SETEXTENDEDLISTVIEWSTYLE, sent|optional|wparam, 0xc8}, /* w2k3 */
828 { 0 }
829 };
830
831 static const struct message folderview_setcurrentviewmode4_prevista[] = {
832 { LVM_GETHEADER, sent},
833 { LVM_GETITEMCOUNT, sent|optional },
834 { LVM_SETSELECTEDCOLUMN, sent},
835 { WM_NOTIFY, sent },
836 { WM_NOTIFY, sent },
837 { WM_NOTIFY, sent },
838 { WM_NOTIFY, sent },
839 { LVM_SETVIEW, sent|wparam, LV_VIEW_DETAILS},
840 { LVM_SETIMAGELIST, sent|wparam, 0},
841 { LVM_SETIMAGELIST, sent|wparam, 1},
842 { 0x105a, sent},
843 { LVM_SETBKIMAGEW, sent|optional}, /* w2k3 */
844 { LVM_GETBKCOLOR, sent|optional}, /* w2k3 */
845 { LVM_GETTEXTBKCOLOR, sent|optional}, /* w2k3 */
846 { LVM_GETTEXTCOLOR, sent|optional}, /* w2k3 */
847 { LVM_SETEXTENDEDLISTVIEWSTYLE, sent|optional|wparam, 0xc8}, /* w2k3 */
848 { 0 }
849 };
850
851 /* XP, SetCurrentViewMode(5)
852 108e - LVM_SETVIEW (LV_VIEW_ICON);
853 1036 - LVM_SETEXTEDEDLISTVIEWSTYLE (0x8000, 0)
854 100c/104c repeated X times
855 1003 - LVM_SETIMAGELIST
856 1035 - LVM_SETICONSPACING
857 1004 - LVM_GETITEMCOUNT
858 105a - ?
859 1016 - LVM_ARRANGE
860 1016 - LVM_ARRANGE
861 */
862
863 /* XP, SetCurrentViewMode(6)
864 1036 - LVM_SETEXTENDEDLISTVIEWSTYLE (0x8000, 0)
865 1035 - LVM_SETICONSPACING
866 1003 - LVM_SETIMAGELIST
867 1003 - LVM_SETIMAGELIST
868 100c/104c repeated X times
869 10a2 - LVM_SETTILEVIEWINFO
870 108e - LVM_SETVIEW (LV_VIEW_TILE)
871 1003 - LVM_SETIMAGELIST
872 105a - ?
873 1016 - LVM_ARRANGE
874 1016 - LVM_ARRANGE
875 */
876
877 /* XP, SetCurrentViewMode (7)
878 10a2 - LVM_SETTILEVIEWINFO
879 108e - LVM_SETVIEW (LV_VIEW_ICON)
880 1004/10a4 (LVM_GETITEMCOUNT/LVM_SETTILEINFO) X times
881 1016 - LVM_ARRANGE
882 1016 - LVM_ARRANGE
883 ...
884 LVM_SETEXTENDEDLISTVIEWSTYLE (0x40000, 0x40000)
885 ...
886 LVM_SETEXTENDEDLISTVIEWSTYLE (0x8000, 0x8000)
887 */
888
889 static void test_GetSetCurrentViewMode(void)
890 {
891 IShellFolder *desktop;
892 IShellView *sview;
893 IFolderView *fview;
894 IShellBrowser *browser;
895 FOLDERSETTINGS fs;
896 UINT viewmode;
897 HWND hwnd;
898 RECT rc = {0, 0, 10, 10};
899 HRESULT hr;
900 UINT i;
901 static const int winxp_res[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
902 static const int win2k3_res[11] = {0, 1, 2, 3, 4, 5, 6, 5, 8, 0, 0};
903 static const int vista_res[11] = {0, 1, 5, 3, 4, 5, 6, 7, 7, 0, 0};
904 static const int win7_res[11] = {1, 1, 1, 3, 4, 1, 6, 1, 8, 8, 8};
905
906 hr = SHGetDesktopFolder(&desktop);
907 ok(hr == S_OK, "got (0x%08x)\n", hr);
908
909 hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&sview);
910 ok(hr == S_OK, "got (0x%08x)\n", hr);
911
912 fs.ViewMode = 1;
913 fs.fFlags = 0;
914 browser = IShellBrowserImpl_Construct();
915 hr = IShellView_CreateViewWindow(sview, NULL, &fs, browser, &rc, &hwnd);
916 ok(hr == S_OK || broken(hr == S_FALSE /*Win2k*/ ), "got (0x%08x)\n", hr);
917
918 hr = IShellView_QueryInterface(sview, &IID_IFolderView, (void**)&fview);
919 ok(hr == S_OK || broken(hr == E_NOINTERFACE), "got (0x%08x)\n", hr);
920 if(SUCCEEDED(hr))
921 {
922 HWND hwnd_lv;
923 UINT count;
924
925 if (0)
926 {
927 /* Crashes under Win7/WinXP */
928 IFolderView_GetCurrentViewMode(fview, NULL);
929 }
930
931 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
932 ok(hr == S_OK, "got (0x%08x)\n", hr);
933 ok(viewmode == 1, "ViewMode was %d\n", viewmode);
934
935 hr = IFolderView_SetCurrentViewMode(fview, FVM_AUTO);
936 ok(hr == S_OK, "got (0x%08x)\n", hr);
937
938 hr = IFolderView_SetCurrentViewMode(fview, 0);
939 ok(hr == E_INVALIDARG || broken(hr == S_OK),
940 "got (0x%08x)\n", hr);
941
942 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
943 ok(hr == S_OK, "got (0x%08x)\n", hr);
944
945 for(i = 1; i < 9; i++)
946 {
947 hr = IFolderView_SetCurrentViewMode(fview, i);
948 ok(hr == S_OK || (i == 8 && hr == E_INVALIDARG /*Vista*/),
949 "(%d) got (0x%08x)\n", i, hr);
950
951 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
952 ok(hr == S_OK, "(%d) got (0x%08x)\n", i, hr);
953
954 /* Wine currently behaves like winxp here. */
955 ok((viewmode == win7_res[i]) || (viewmode == vista_res[i]) ||
956 (viewmode == win2k3_res[i]) || (viewmode == winxp_res[i]),
957 "(%d) got %d\n",i , viewmode);
958 }
959
960 hr = IFolderView_SetCurrentViewMode(fview, 9);
961 ok(hr == E_INVALIDARG || broken(hr == S_OK),
962 "got (0x%08x)\n", hr);
963
964 /* Test messages */
965 hwnd_lv = subclass_listview(hwnd);
966 ok(hwnd_lv != NULL, "Failed to subclass listview\n");
967 if(hwnd_lv)
968 {
969 /* Vista seems to set the viewmode by other means than
970 sending messages. At least no related messages are
971 captured by subclassing.
972 */
973 BOOL vista_plus = FALSE;
974 static const UINT vista_plus_msgs[] = {
975 WM_SETREDRAW, WM_NOTIFY, WM_NOTIFYFORMAT, WM_QUERYUISTATE,
976 WM_MENUCHAR, WM_WINDOWPOSCHANGING, WM_NCCALCSIZE, WM_WINDOWPOSCHANGED,
977 WM_PARENTNOTIFY, LVM_GETHEADER, 0 };
978
979 flush_sequences(sequences, NUM_MSG_SEQUENCES);
980 hr = IFolderView_SetCurrentViewMode(fview, 1);
981 ok(hr == S_OK, "got 0x%08x\n", hr);
982
983 /* WM_SETREDRAW is not sent in versions before Vista. */
984 vista_plus = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, WM_SETREDRAW);
985 if(vista_plus)
986 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
987 else
988 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_setcurrentviewmode1_2_prevista,
989 "IFolderView::SetCurrentViewMode(1)", TRUE);
990
991 hr = IFolderView_SetCurrentViewMode(fview, 2);
992 ok(hr == S_OK, "got 0x%08x\n", hr);
993 if(vista_plus)
994 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
995 else
996 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_setcurrentviewmode1_2_prevista,
997 "IFolderView::SetCurrentViewMode(2)", TRUE);
998
999 hr = IFolderView_SetCurrentViewMode(fview, 3);
1000 ok(hr == S_OK, "got 0x%08x\n", hr);
1001 if(vista_plus)
1002 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
1003 else
1004 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_setcurrentviewmode3_prevista,
1005 "IFolderView::SetCurrentViewMode(3)", TRUE);
1006
1007 hr = IFolderView_SetCurrentViewMode(fview, 4);
1008 ok(hr == S_OK, "got 0x%08x\n", hr);
1009 if(vista_plus)
1010 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
1011 else
1012 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_setcurrentviewmode4_prevista,
1013 "IFolderView::SetCurrentViewMode(4)", TRUE);
1014
1015 hr = IFolderView_SetCurrentViewMode(fview, 5);
1016 ok(hr == S_OK, "got 0x%08x\n", hr);
1017 todo_wine
1018 {
1019 if(vista_plus)
1020 {
1021 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
1022 }
1023 else
1024 {
1025 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETVIEW);
1026 ok(count == 1, "LVM_SETVIEW sent %d times.\n", count);
1027 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETEXTENDEDLISTVIEWSTYLE);
1028 ok(count == 1 || count == 2, "LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n", count);
1029 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1030 }
1031 }
1032
1033 hr = IFolderView_SetCurrentViewMode(fview, 6);
1034 ok(hr == S_OK, "got 0x%08x\n", hr);
1035 todo_wine
1036 {
1037 if(vista_plus)
1038 {
1039 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
1040 }
1041 else
1042 {
1043 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETVIEW);
1044 ok(count == 1, "LVM_SETVIEW sent %d times.\n", count);
1045 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETEXTENDEDLISTVIEWSTYLE);
1046 ok(count == 1 || count == 2, "LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n", count);
1047 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1048 }
1049 }
1050
1051 hr = IFolderView_SetCurrentViewMode(fview, 7);
1052 ok(hr == S_OK, "got 0x%08x\n", hr);
1053 todo_wine
1054 {
1055 if(vista_plus)
1056 {
1057 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
1058 }
1059 else
1060 {
1061 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETVIEW);
1062 ok(count == 1, "LVM_SETVIEW sent %d times.\n", count);
1063 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETEXTENDEDLISTVIEWSTYLE);
1064 ok(count == 2, "LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n", count);
1065 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1066 }
1067 }
1068
1069 hr = IFolderView_SetCurrentViewMode(fview, 8);
1070 ok(hr == S_OK || broken(hr == E_INVALIDARG /* Vista */), "got 0x%08x\n", hr);
1071 todo_wine
1072 {
1073 if(vista_plus)
1074 {
1075 verify_msgs_in(sequences[LISTVIEW_SEQ_INDEX], vista_plus_msgs);
1076 }
1077 else
1078 {
1079 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETVIEW);
1080 ok(count == 1, "LVM_SETVIEW sent %d times.\n", count);
1081 count = get_msg_count(sequences, LISTVIEW_SEQ_INDEX, LVM_SETEXTENDEDLISTVIEWSTYLE);
1082 ok(count == 2, "LVM_SETEXTENDEDLISTVIEWSTYLE sent %d times.\n", count);
1083 flush_sequences(sequences, NUM_MSG_SEQUENCES);
1084 }
1085 }
1086
1087 hr = IFolderView_GetCurrentViewMode(fview, &viewmode);
1088 ok(hr == S_OK, "Failed to get current viewmode.\n");
1089 ok_sequence(sequences, LISTVIEW_SEQ_INDEX, empty_seq,
1090 "IFolderView::GetCurrentViewMode", FALSE);
1091 }
1092
1093 IFolderView_Release(fview);
1094 }
1095 else
1096 {
1097 skip("No IFolderView for the desktop folder.\n");
1098 }
1099
1100 IShellBrowser_Release(browser);
1101 IShellView_DestroyViewWindow(sview);
1102 IShellView_Release(sview);
1103 IShellFolder_Release(desktop);
1104 }
1105
1106 static void test_IOleCommandTarget(void)
1107 {
1108 IShellFolder *psf_desktop;
1109 IShellView *psv;
1110 IOleCommandTarget *poct;
1111 HRESULT hr;
1112
1113 hr = SHGetDesktopFolder(&psf_desktop);
1114 ok(hr == S_OK, "got (0x%08x)\n", hr);
1115
1116 hr = IShellFolder_CreateViewObject(psf_desktop, NULL, &IID_IShellView, (void**)&psv);
1117 ok(hr == S_OK, "got (0x%08x)\n", hr);
1118 if(SUCCEEDED(hr))
1119 {
1120 hr = IShellView_QueryInterface(psv, &IID_IOleCommandTarget, (void**)&poct);
1121 ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win95/NT4 */, "Got 0x%08x\n", hr);
1122 if(SUCCEEDED(hr))
1123 {
1124 OLECMD oc;
1125
1126 hr = IOleCommandTarget_QueryStatus(poct, NULL, 0, NULL, NULL);
1127 ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr);
1128
1129 oc.cmdID = 1;
1130 hr = IOleCommandTarget_QueryStatus(poct, NULL, 0, &oc, NULL);
1131 ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08x\n", hr);
1132
1133 oc.cmdID = 1;
1134 hr = IOleCommandTarget_QueryStatus(poct, NULL, 1, &oc, NULL);
1135 ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08x\n", hr);
1136
1137 hr = IOleCommandTarget_Exec(poct, NULL, 0, 0, NULL, NULL);
1138 ok(hr == OLECMDERR_E_UNKNOWNGROUP, "Got 0x%08x\n", hr);
1139
1140 IOleCommandTarget_Release(poct);
1141 }
1142
1143 IShellView_Release(psv);
1144 }
1145
1146 IShellFolder_Release(psf_desktop);
1147 }
1148
1149 START_TEST(shlview)
1150 {
1151 OleInitialize(NULL);
1152
1153 init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
1154
1155 test_IShellView_CreateViewWindow();
1156 test_IFolderView();
1157 test_GetItemObject();
1158 test_IShellFolderView();
1159 test_IOleWindow();
1160 test_GetSetCurrentViewMode();
1161 test_IOleCommandTarget();
1162
1163 OleUninitialize();
1164 }