Aric Stewart : winefile: Highlight the file specified on the command line instead of

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 11 05:35:28 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 59b2838f4ea5c0a542a22bb5f622a1999db51429
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=59b2838f4ea5c0a542a22bb5f622a1999db51429

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Jan 11 12:32:51 2006 +0100

winefile: Highlight the file specified on the command line instead of
filtering based on it. To be integrated with explorer to allow for
that functionality.

---

 programs/winefile/winefile.c |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index 1f6eeee..8b250d6 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -1400,6 +1400,7 @@ enum TYPE_FILTER {
 static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd)
 {
 	TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
+	TCHAR dir_path[MAX_PATH];
 	TCHAR b1[BUFFER_LEN];
 	static const TCHAR sAsterics[] = {'*', '\0'};
 
@@ -1444,7 +1445,9 @@ static ChildWnd* alloc_child_window(LPCT
 
 	root->entry.level = 0;
 
-	entry = read_tree(root, path, pidl, drv, child->sortOrder, hwnd);
+	lstrcpy(dir_path, drv);
+	lstrcat(dir_path, dir);
+	entry = read_tree(root, dir_path, pidl, drv, child->sortOrder, hwnd);
 
 #ifdef _SHELL_FOLDERS
 	if (root->entry.etype == ET_SHELL)
@@ -4750,6 +4753,36 @@ static void show_frame(HWND hwndParent, 
 	Globals.prescan_node = FALSE;
 
 	UpdateWindow(Globals.hMainWnd);
+
+	if (path && path[0])
+	{
+		int index,count;
+		TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
+		TCHAR fullname[_MAX_FNAME+_MAX_EXT+1];
+
+		memset(name,0,sizeof(name));
+		memset(name,0,sizeof(ext));
+		_tsplitpath(path, drv, dir, name, ext);
+		if (name[0])
+		{
+			count = ListBox_GetCount(child->right.hwnd);
+			lstrcpy(fullname,name);
+			lstrcat(fullname,ext);
+
+			for (index = 0; index < count; index ++)
+			{
+				Entry* entry = (Entry*) ListBox_GetItemData(child->right.hwnd,
+						index);
+				if (lstrcmp(entry->data.cFileName,fullname)==0 ||
+						lstrcmp(entry->data.cAlternateFileName,fullname)==0)
+				{
+					ListBox_SetCurSel(child->right.hwnd, index);
+					SetFocus(child->right.hwnd);
+					break;
+				}
+			}
+		}
+	}
 }
 
 static void ExitInstance(void)




More information about the wine-cvs mailing list