Windows 7 - How to get the right hand pane ( DirectUIHWND ) in Windows 7

Asked By Sujay Ghosh
16-Nov-09 12:56 PM
Hello ,

I can access the right pane of the Windows Explorer in XP ( 32 bit ) , by
getting the handle to the "SysListView32" .

But in Windows 7 , the window class for the right hand side of the Windows
Explorer is DirectUIHWND. I have used Spy++ to see the child windows, but I
only find ControlNotifySink .

Any idea how do I get the list view .

Thanks in advance

Sujay

--
Sujay Ghosh

MSN : sujayghosh@hotmail.com
DirectUIHWND
(1)
Windows 7
(1)
XP
(1)
STopLevelBrowser
(1)
IWebBrowserApp
(1)
ControlNotifySink
(1)
CoCreateInstance
(1)
IServiceProvider
(1)
  Jim Barry replied to Sujay Ghosh
17-Nov-09 10:02 AM
There is not one any more. It seems that Microsoft has reimplemented
DefView using DirectUI (the undocumented user interface engine used by
the Common Tasks pane in XP, amongst other things).

- Jim
  Sujay Ghosh replied to Jim Barry
17-Nov-09 02:26 PM
Hello Jim,

Thanks for sharing the info .

But I think one can access the DirectUIHWND internals , and find  the list
view from their. I am doing some R&D , and shall post once I get over it .

I see a light .. not enough to brighten up the tunnel now ..:-)

Sujay
  Nathalie D'Amours replied to Sujay Ghosh
12-May-10 10:52 PM
Hi Sujay,



It is likely too late for you but the solution I found might help somebody else. The following code allows you to make Windows Explorer on Windows 7 use the good old SysListView32 control rather than DirectUIHWND. This fixed my compatibility problem. In a nutshell, it uses the new Windows 7 interface IFolderViewOptions to enable the option FVO_VISTALAYOUT. You need to compile with version 7.0 of the SDK to do this.



void RevertExplorerToListView(

HWND explorerHandle)

{

IShellWindows *shellWindow;

if (SUCCEEDED(CoCreateInstance(CLSID_ShellWindows,

NULL,

CLSCTX_ALL,

IID_IShellWindows,

reinterpret_cast<void**>(&shellWindow))))

{

VARIANT v;

V_VT(&v) = VT_I4;

IDispatch  *dispatch;

BOOL found = FALSE;



for (V_I4(&v) = 0 ; !found && shellWindow->Item(v, &dispatch) == S_OK ;

V_I4(&v)++)

{

IWebBrowserApp *browserApp;

if (SUCCEEDED(dispatch->QueryInterface(IID_IWebBrowserApp,

reinterpret_cast<void**>(&browserApp))))

{

HWND appHandle;

if (SUCCEEDED(browserApp->get_HWND(reinterpret_cast<LONG_PTR*>(&appHandle))) &&

appHandle == explorerHandle)

{

found = TRUE;

IServiceProvider *provider;

if (SUCCEEDED(browserApp->QueryInterface(IID_IServiceProvider,

reinterpret_cast<void**>(&provider))))

{

IShellBrowser *browser;

if (SUCCEEDED(provider->QueryService(SID_STopLevelBrowser,

IID_IShellBrowser,

reinterpret_cast<void**>(&browser))))

{

IFolderViewOptions *options;

if (SUCCEEDED(browser->QueryInterface(IID_IFolderViewOptions,

reinterpret_cast<void**>(&options))))

{

if (FAILED(options->SetFolderViewOptions(FVO_VISTALAYOUT,

FVO_VISTALAYOUT)))

{

TRACE("SetFolderViewOptions failed");

}

options->Release();

}

browser->Release();

}

provider->Release();

}

}

browserApp->Release();

}

}

shellWindow->Release();

}

}





Nathalie
help
Windows & Windows 7? Windows 7 Will MM be included in Windows 7 and will it be a version which will allow DVD creation? Kenny Cargill Windows XP Movie Maker Discussions Windows 7 (1) Vista (1) Cargill (1) Papa (1) Month (1
Returning to Windows 7 Windows 7 Hello, I recenlty purchased two laptops for a client installed with Windows 7 in XP mode. Can these be switched to Windows 7 and how. Thank you and God Bless, Mark A. Sam Windows XP Discussions Hi Mark
Netbooks with Windows 7? Windows 7 Are we expecting netbooks running Windows 7? Windows Vista Hardware Devices Discussions Windows 7 (1) Netbooks (1) Manufacturers (1) Repairman (1) Maybe a basic version of Windows 7
Creating a VPN Shortcut in Windows 7 Windows 7 Windows 7 I have created a VPN in Windows 7 using Control Panel> Network and Sharing Center. It seems that I have to go through