Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
426984dd
Commit
426984dd
authored
May 26, 2005
by
Michael Jung
Committed by
Alexandre Julliard
May 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use IShellFolder::GetDisplayNameOf instead of SHGetPathFromIDList to
be able to browse shell namespace extensions.
parent
d8c10047
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
24 deletions
+50
-24
filedlg.c
dlls/commdlg/filedlg.c
+32
-20
filedlgbrowser.c
dlls/commdlg/filedlgbrowser.c
+18
-4
No files found.
dlls/commdlg/filedlg.c
View file @
426984dd
...
...
@@ -511,6 +511,27 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
return
ret
;
}
/******************************************************************************
* COMDLG32_GetDisplayNameOf [internal]
*
* Helper function to get the display name for a pidl.
*/
static
BOOL
COMDLG32_GetDisplayNameOf
(
LPCITEMIDLIST
pidl
,
LPWSTR
pwszPath
)
{
LPSHELLFOLDER
psfDesktop
;
STRRET
strret
;
if
(
FAILED
(
SHGetDesktopFolder
(
&
psfDesktop
)))
return
FALSE
;
if
(
FAILED
(
IShellFolder_GetDisplayNameOf
(
psfDesktop
,
pidl
,
SHGDN_FORPARSING
,
&
strret
)))
{
IShellFolder_Release
(
psfDesktop
);
return
FALSE
;
}
IShellFolder_Release
(
psfDesktop
);
return
SUCCEEDED
(
StrRetToBufW
(
&
strret
,
pidl
,
pwszPath
,
MAX_PATH
));
}
/***********************************************************************
* ArrangeCtrlPositions [internal]
*
...
...
@@ -841,7 +862,7 @@ HRESULT FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPVOID buffer)
return
-
1
;
/* get path and filenames */
SHGetPathFromIDListW
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrCurrentDir
);
COMDLG32_GetDisplayNameOf
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrCurrentDir
);
n
=
FILEDLG95_FILENAME_GetFileNames
(
hwnd
,
&
lpstrFileList
,
&
sizeUsed
,
' '
);
TRACE
(
"path >%s< filespec >%s< %d files
\n
"
,
...
...
@@ -925,6 +946,7 @@ HRESULT FILEDLG95_Handle_GetFileSpec(HWND hwnd, DWORD size, LPVOID buffer)
HRESULT
FILEDLG95_HandleCustomDialogMessages
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
FileOpenDlgInfos
*
fodInfos
=
(
FileOpenDlgInfos
*
)
GetPropA
(
hwnd
,
FileOpenDlgInfosStr
);
WCHAR
lpstrPath
[
MAX_PATH
];
if
(
!
fodInfos
)
return
-
1
;
switch
(
uMsg
)
...
...
@@ -934,22 +956,16 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
case
CDM_GETFOLDERPATH
:
TRACE
(
"CDM_GETFOLDERPATH:
\n
"
);
if
(
fodInfos
->
unicode
)
COMDLG32_GetDisplayNameOf
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPath
);
if
(
lParam
)
{
WCHAR
lpstrPath
[
MAX_PATH
],
*
bufW
=
(
LPWSTR
)
lParam
;
SHGetPathFromIDListW
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPath
);
if
(
bufW
)
lstrcpynW
(
bufW
,
lpstrPath
,(
int
)
wParam
);
return
strlenW
(
lpstrPath
);
}
if
(
fodInfos
->
unicode
)
lstrcpynW
((
LPWSTR
)
lParam
,
lpstrPath
,
(
int
)
wParam
);
else
{
char
lpstrPath
[
MAX_PATH
],
*
bufA
=
(
LPSTR
)
lParam
;
SHGetPathFromIDListA
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPath
);
if
(
bufA
)
lstrcpynA
(
bufA
,
lpstrPath
,(
int
)
wParam
);
return
strlen
(
lpstrPath
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpstrPath
,
-
1
,
(
LPSTR
)
lParam
,
(
int
)
wParam
,
NULL
,
NULL
);
}
return
strlenW
(
lpstrPath
);
case
CDM_GETSPEC
:
return
FILEDLG95_Handle_GetFileSpec
(
hwnd
,
(
UINT
)
wParam
,
(
LPSTR
)
lParam
);
...
...
@@ -1597,7 +1613,7 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
ofn
->
lpstrFile
[
0
]
=
'\0'
;
}
SHGetPathFromIDListW
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPathSpec
);
COMDLG32_GetDisplayNameOf
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPathSpec
);
if
(
!
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_NOVALIDATE
)
&&
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_FILEMUSTEXIST
)
&&
...
...
@@ -1742,15 +1758,11 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
*/
/* Get the current directory name */
if
(
!
SHGetPathFromIDListW
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPathAndFile
))
{
/* we are in a special folder, default to desktop */
if
(
FAILED
(
COMDLG32_SHGetFolderPathW
(
hwnd
,
CSIDL_DESKTOPDIRECTORY
|
CSIDL_FLAG_CREATE
,
0
,
0
,
lpstrPathAndFile
)))
if
(
!
COMDLG32_GetDisplayNameOf
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPathAndFile
))
{
/* last fallback */
GetCurrentDirectoryW
(
MAX_PATH
,
lpstrPathAndFile
);
}
}
PathAddBackslashW
(
lpstrPathAndFile
);
TRACE
(
"current directory=%s
\n
"
,
debugstr_w
(
lpstrPathAndFile
));
...
...
dlls/commdlg/filedlgbrowser.c
View file @
426984dd
...
...
@@ -140,11 +140,25 @@ static void COMDLG32_DumpSBSPFlags(UINT uflags)
static
void
COMDLG32_UpdateCurrentDir
(
FileOpenDlgInfos
*
fodInfos
)
{
char
lpstrPath
[
MAX_PATH
];
if
(
SHGetPathFromIDListA
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPath
))
{
SetCurrentDirectoryA
(
lpstrPath
);
TRACE
(
"new current folder %s
\n
"
,
lpstrPath
);
LPSHELLFOLDER
psfDesktop
;
STRRET
strret
;
HRESULT
res
;
res
=
SHGetDesktopFolder
(
&
psfDesktop
);
if
(
FAILED
(
res
))
return
;
res
=
IShellFolder_GetDisplayNameOf
(
psfDesktop
,
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
SHGDN_FORPARSING
,
&
strret
);
if
(
SUCCEEDED
(
res
))
{
WCHAR
wszCurrentDir
[
MAX_PATH
];
res
=
StrRetToBufW
(
&
strret
,
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
wszCurrentDir
,
MAX_PATH
);
if
(
SUCCEEDED
(
res
))
SetCurrentDirectoryW
(
wszCurrentDir
);
}
IShellFolder_Release
(
psfDesktop
);
}
/* copied from shell32 to avoid linking to it */
...
...
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