Zebediah Figura : explorer: Set the window title to the current directory.
Alexandre Julliard
julliard at winehq.org
Wed Nov 29 15:12:31 CST 2017
Module: wine
Branch: master
Commit: c4c96383eb347d0ea23b091877bdb1f76f7a4a5b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4c96383eb347d0ea23b091877bdb1f76f7a4a5b
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Tue Nov 28 23:52:06 2017 -0600
explorer: Set the window title to the current directory.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/explorer/explorer.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c
index 3571497..afb565f 100644
--- a/programs/explorer/explorer.c
+++ b/programs/explorer/explorer.c
@@ -259,10 +259,32 @@ static void update_path_box(explorer_info *info)
static HRESULT WINAPI IExplorerBrowserEventsImpl_fnOnNavigationComplete(IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidl)
{
IExplorerBrowserEventsImpl *This = impl_from_IExplorerBrowserEvents(iface);
+ IShellFolder *parent;
+ PCUITEMID_CHILD child_pidl;
+ HRESULT hres;
+ STRRET strret;
+ WCHAR *name;
+
ILFree(This->info->pidl);
This->info->pidl = ILClone(pidl);
update_path_box(This->info);
- return S_OK;
+
+ hres = SHBindToParent(pidl, &IID_IShellFolder, (void **)&parent, &child_pidl);
+ if (SUCCEEDED(hres))
+ {
+ hres = IShellFolder_GetDisplayNameOf(parent, child_pidl, SHGDN_FORADDRESSBAR, &strret);
+ if (SUCCEEDED(hres))
+ hres = StrRetToStrW(&strret, child_pidl, &name);
+ if (SUCCEEDED(hres))
+ {
+ SetWindowTextW(This->info->main_window, name);
+ CoTaskMemFree(name);
+ }
+
+ IShellFolder_Release(parent);
+ }
+
+ return hres;
}
static HRESULT WINAPI IExplorerBrowserEventsImpl_fnOnNavigationFailed(IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidl)
More information about the wine-cvs
mailing list