Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
1226422a
Commit
1226422a
authored
Jul 03, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement folder renaming in SHBrowseForFolder.
parent
74c47d0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
4 deletions
+49
-4
brsfolder.c
dlls/shell32/brsfolder.c
+47
-2
brsfolder.c
dlls/shell32/tests/brsfolder.c
+2
-2
No files found.
dlls/shell32/brsfolder.c
View file @
1226422a
...
...
@@ -574,6 +574,46 @@ static HRESULT BrsFolder_Treeview_Changed( browse_info *info, NMTREEVIEWW *pnmtv
return
0
;
}
static
LRESULT
BrsFolder_Treeview_Rename
(
browse_info
*
info
,
NMTVDISPINFOW
*
pnmtv
)
{
LPTV_ITEMDATA
item_data
;
WCHAR
old_path
[
MAX_PATH
],
new_path
[
MAX_PATH
],
*
p
;
NMTREEVIEWW
nmtv
;
TVITEMW
item
;
if
(
!
pnmtv
->
item
.
pszText
)
return
0
;
item
.
mask
=
TVIF_HANDLE
|
TVIF_PARAM
;
item
.
hItem
=
(
HTREEITEM
)
SendMessageW
(
info
->
hwndTreeView
,
TVM_GETNEXTITEM
,
TVGN_CARET
,
0
);
SendMessageW
(
info
->
hwndTreeView
,
TVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
item_data
=
(
LPTV_ITEMDATA
)
item
.
lParam
;
SHGetPathFromIDListW
(
item_data
->
lpifq
,
old_path
);
if
(
!
(
p
=
strrchrW
(
old_path
,
'\\'
)))
return
0
;
p
=
new_path
+
(
p
-
old_path
+
1
);
memcpy
(
new_path
,
old_path
,
(
p
-
new_path
)
*
sizeof
(
WCHAR
));
strcpyW
(
p
,
pnmtv
->
item
.
pszText
);
if
(
!
MoveFileW
(
old_path
,
new_path
))
return
0
;
SHFree
(
item_data
->
lpifq
);
SHFree
(
item_data
->
lpi
);
item_data
->
lpifq
=
SHSimpleIDListFromPathW
(
new_path
);
IShellFolder_ParseDisplayName
(
item_data
->
lpsfParent
,
NULL
,
NULL
,
pnmtv
->
item
.
pszText
,
NULL
,
&
item_data
->
lpi
,
NULL
);
item
.
mask
=
TVIF_HANDLE
|
TVIF_TEXT
;
item
.
pszText
=
pnmtv
->
item
.
pszText
;
SendMessageW
(
info
->
hwndTreeView
,
TVM_SETITEMW
,
0
,
(
LPARAM
)
&
item
);
nmtv
.
itemNew
.
lParam
=
item
.
lParam
;
BrsFolder_Treeview_Changed
(
info
,
&
nmtv
);
return
0
;
}
static
LRESULT
BrsFolder_OnNotify
(
browse_info
*
info
,
UINT
CtlID
,
LPNMHDR
lpnmh
)
{
NMTREEVIEWW
*
pnmtv
=
(
NMTREEVIEWW
*
)
lpnmh
;
...
...
@@ -597,6 +637,10 @@ static LRESULT BrsFolder_OnNotify( browse_info *info, UINT CtlID, LPNMHDR lpnmh
case
TVN_SELCHANGEDW
:
return
BrsFolder_Treeview_Changed
(
info
,
pnmtv
);
case
TVN_ENDLABELEDITA
:
case
TVN_ENDLABELEDITW
:
return
BrsFolder_Treeview_Rename
(
info
,
(
LPNMTVDISPINFOW
)
pnmtv
);
default:
WARN
(
"unhandled (%d)
\n
"
,
pnmtv
->
hdr
.
code
);
break
;
...
...
@@ -680,8 +724,9 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info )
static
HRESULT
BrsFolder_Rename
(
browse_info
*
info
,
HTREEITEM
rename
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
SendMessageW
(
info
->
hwndTreeView
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
rename
);
SendMessageW
(
info
->
hwndTreeView
,
TVM_EDITLABELW
,
0
,
(
LPARAM
)
rename
);
return
S_OK
;
}
static
HRESULT
BrsFolder_NewFolder
(
browse_info
*
info
)
...
...
dlls/shell32/tests/brsfolder.c
View file @
1226422a
...
...
@@ -222,14 +222,14 @@ static void test_click_make_new_folder_button(void)
/* There should be a new folder foo inside the test folder */
strcpy
(
new_folder_path
,
test_folder_path
);
strcat
(
new_folder_path
,
new_folder_name
);
todo_wine
ok
(
does_folder_or_file_exist
(
new_folder_path
)
ok
(
does_folder_or_file_exist
(
new_folder_path
)
||
broken
(
!
does_folder_or_file_exist
(
new_folder_path
))
/* W95, W98, XP, W2K3 */
,
"The new folder did not get the name %s
\n
"
,
new_folder_name
);
/* Dialog should return a pidl pointing to the new folder */
ok
(
SHGetPathFromIDListA
(
pidl
,
new_folder_pidl_path
),
"SHGetPathFromIDList failed for new folder.
\n
"
);
todo_wine
ok
(
strcmp
(
new_folder_path
,
new_folder_pidl_path
)
==
0
ok
(
strcmp
(
new_folder_path
,
new_folder_pidl_path
)
==
0
||
broken
(
strcmp
(
new_folder_path
,
new_folder_pidl_path
)
!=
0
)
/* earlier than Vista */
,
"SHBrowseForFolder did not return the pidl for the new folder. "
"Expected '%s' got '%s'
\n
"
,
new_folder_path
,
new_folder_pidl_path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment