On Sat, Jul 17, 2010 at 5:51 PM, Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
On 7/17/2010 19:45, David Hedberg wrote:
On Sat, Jul 17, 2010 at 5:30 PM, Nikolay Sivov<nsivov(a)codeweavers.com> wrote:
On 7/17/2010 19:08, David Hedberg wrote:
static HRESULT WINAPI IFView_SetCurrentViewMode(IFolderView *iface, UINT mode) { - IShellViewImpl *This = impl_from_IFolderView(iface); - FIXME("(%p)->(%u), stub\n", This, mode); - return E_NOTIMPL; + IShellViewImpl *This = impl_from_IFolderView(iface); + RECT rc; + TRACE("(%p)->(%u), stub\n", This, mode); + + if((mode< FVM_FIRST || mode> FVM_LAST)&& + (mode != FVM_AUTO)) + return E_INVALIDARG; + + /* Destroy the previous listview */ + ShellView_DestroyView(This); + + /* Change the viewmode */ + This->FolderSettings.ViewMode = mode; + + /* Create a new listview */ + ShellView_CreateView(This); + + /* Size the new listview properly. */ + GetClientRect(This->hWnd,&rc); + MoveWindow(This->hWndList, 0, 0, rc.right, rc.bottom, TRUE); + + return S_OK; }
Why do you think you should destroy Listview here? It's not obvious at all. I think it's only about changing style.
Seems I've managed to miss LVM_SETVIEW, I'll try again.
It's not a good idea cause it's only supported for comctl32 version 6.0 with a SxS manifest and I think Vista could work fine with IFolderView that creates a view based on v.5 control.
Anyway, you could test if it does send LVM_SETVIEW or not by subclassing Listview like it's done in control tests.
Thanks for the pointers, I'll see if I can expand the tests somewhat and send a new version, probably simply using the local SetStyle helper (unless the tests shows something really weird).