Discussion:
How to get the right hand pane ( DirectUIHWND ) in Windows 7
(too old to reply)
Sujay Ghosh
2009-11-16 17:56:58 UTC
Permalink
Raw Message
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 : ***@hotmail.com
Jim Barry
2009-11-17 15:02:48 UTC
Permalink
Raw Message
Post by Sujay Ghosh
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 .
There isn't 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
2009-11-17 19:26:11 UTC
Permalink
Raw Message
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
Post by Jim Barry
Post by Sujay Ghosh
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 .
There isn't 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
koalabear
2010-05-13 02:29:30 UTC
Permalink
Raw Message
Post by Sujay Ghosh
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
Hi Sujay,

It is likely too late for you but the solution I found might help somebod
else. The following code allows you to make Windows Explorer on Windows 7 us
the good old SysListView32 control rather than DirectUIHWND. This fixed m
compatibility problem. In a nutshell, it uses the new Windows 7 interfac
IFolderViewOptions to enable the option FVO_VISTALAYOUT. You need to compil
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;
i
(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;
i
(SUCCEEDED(browser->QueryInterface(IID_IFolderViewOptions,

reinterpret_cast<void**>(&options))))
{
i
(FAILED(options->SetFolderViewOptions(FVO_VISTALAYOUT,

FVO_VISTALAYOUT)))
{
TRACE("SetFolderViewOptions failed");
}
options->Release();
}
browser->Release();
}
provider->Release();
}
}
browserApp->Release();
}
}
shellWindow->Release();
}
}

Nathalie
Nathalie D'Amours
2010-05-13 02:52:17 UTC
Permalink
Raw Message
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



Sujay Ghosh wrote:

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

Hello

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

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

Any idea how do I get the list view

Thanks in advanc

Suja

-
Sujay Ghos

MSN : ***@hotmail.com

Previous Posts In This Thread:

On Monday, November 16, 2009 12:56 PM
Sujay Ghosh wrote:

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

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

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

Any idea how do I get the list view

Thanks in advanc

Suja

-
Sujay Ghos

MSN : ***@hotmail.com

On Tuesday, November 17, 2009 10:02 AM
Jim Barry wrote:

Sujay Ghosh wrote:There is not one any more.
Sujay Ghosh wrote

There is not one any more. It seems that Microsoft has reimplemente
DefView using DirectUI (the undocumented user interface engine used by
the Common Tasks pane in XP, amongst other things).

- Jim

On Tuesday, November 17, 2009 2:26 PM
Sujay Ghosh wrote:

Hello Jim,Thanks for sharing the info .
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


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Report Engine, Part 4
http://www.eggheadcafe.com/tutorials/aspnet/5ac799db-385f-431a-8a45-8b37cb7f3186/wpf-report-engine-part-4.aspx
Loading...