Esempio n. 1
0
// @pymethod |PyIShellView|DestroyViewWindow|Description of DestroyViewWindow.
PyObject *PyIShellView::DestroyViewWindow(PyObject *self, PyObject *args)
{
	IShellView *pISV = GetI(self);
	if ( pISV == NULL )
		return NULL;
	if ( !PyArg_ParseTuple(args, ":DestroyViewWindow") )
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pISV->DestroyViewWindow( );
	PY_INTERFACE_POSTCALL;
	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pISV, IID_IShellView );
	Py_INCREF(Py_None);
	return Py_None;
}
Esempio n. 2
0
void ShellBrowser::UpdateFolderView(IShellFolder* folder)
{
    CONTEXT("ShellBrowser::UpdateFolderView()");

    FOLDERSETTINGS fs;
    IShellView* pLastShellView = _pShellView;

    _folder = folder;

    if (pLastShellView)
        pLastShellView->GetCurrentInfo(&fs);
    else {
        fs.ViewMode = _create_info._open_mode&OWM_DETAILS? FVM_DETAILS: FVM_ICON;
        fs.fFlags = FWF_NOCLIENTEDGE|FWF_BESTFITWINDOW;
    }

#ifndef __MINGW32__	// IShellFolderViewCB missing in MinGW (as of 25.09.2005)
    SFV_CREATE sfv_create;

    sfv_create.cbSize = sizeof(SFV_CREATE);
    sfv_create.pshf = folder;
    sfv_create.psvOuter = NULL;
    sfv_create.psfvcb = this;

    HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView);
#else
    HRESULT hr = folder->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);
#endif

    if (FAILED(hr)) {
        _pShellView = NULL;
        return;
    }

    RECT rect = {CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT};
    hr = _pShellView->CreateViewWindow(pLastShellView, &fs, static_cast<IShellBrowser*>(this), &rect, &_right_hwnd/*&m_hWndListView*/);

    if (pLastShellView) {
        pLastShellView->GetCurrentInfo(&fs);
        pLastShellView->UIActivate(SVUIA_DEACTIVATE);
        pLastShellView->DestroyViewWindow();
        pLastShellView->Release();
    }

    _pShellView->UIActivate(SVUIA_ACTIVATE_NOFOCUS);
}
Esempio n. 3
0
void ShellBrowserChild::UpdateFolderView(IShellFolder* folder)
{
	CONTEXT("ShellBrowserChild::UpdateFolderView()");

	FOLDERSETTINGS fs;
	IShellView* pLastShellView = _pShellView;

	_folder = folder;

	if (pLastShellView)
		pLastShellView->GetCurrentInfo(&fs);
	else {
		fs.ViewMode = _create_info._open_mode&OWM_DETAILS? FVM_DETAILS: FVM_ICON;
		fs.fFlags = FWF_BESTFITWINDOW;
	}

	HRESULT hr = folder->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);

	if (FAILED(hr)) {
		_pShellView = NULL;
		return;
	}

	RECT rect = {CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT};
	hr = _pShellView->CreateViewWindow(pLastShellView, &fs, static_cast<IShellBrowser*>(this), &rect, &_right_hwnd/*&m_hWndListView*/);

	if (pLastShellView) {
		pLastShellView->GetCurrentInfo(&fs);
		pLastShellView->UIActivate(SVUIA_DEACTIVATE);
		pLastShellView->DestroyViewWindow();
		pLastShellView->Release();

		resize_children();
	}

	_pShellView->UIActivate(SVUIA_ACTIVATE_NOFOCUS);
}