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
8e804681
Commit
8e804681
authored
Sep 28, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Sep 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify getting custom icons for a folder by utilising the new
SHELL32_GetCustomFolderAttribute function.
parent
5ad2d351
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
56 deletions
+30
-56
folders.c
dlls/shell32/folders.c
+30
-56
No files found.
dlls/shell32/folders.c
View file @
8e804681
...
...
@@ -27,6 +27,7 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "objbase.h"
#include "undocshell.h"
#include "shlguid.h"
...
...
@@ -34,10 +35,11 @@
#include "shlwapi.h"
#include "wine/debug.h"
#include "wine
rror
.h"
#include "wine
/unicode
.h"
#include "pidl.h"
#include "shell32_main.h"
#include "shfldr.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
...
...
@@ -156,64 +158,36 @@ static HRESULT getIconLocationForFolder(IExtractIconW *iface, UINT uFlags,
LPWSTR
szIconFile
,
UINT
cchMax
,
int
*
piIndex
,
UINT
*
pwFlags
)
{
IExtractIconWImpl
*
This
=
(
IExtractIconWImpl
*
)
iface
;
WCHAR
path
[
MAX_PATH
];
BOOL
found
=
FALSE
;
DWORD
dwNr
;
if
(
SUCCEEDED
(
SHGetPathFromIDListW
(
This
->
pidl
,
path
)))
WCHAR
wszPath
[
MAX_PATH
];
WCHAR
wszCLSIDValue
[
CHARS_IN_GUID
];
static
const
WCHAR
shellClassInfo
[]
=
{
'.'
,
'S'
,
'h'
,
'e'
,
'l'
,
'l'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
'I'
,
'n'
,
'f'
,
'o'
,
0
};
static
const
WCHAR
iconFile
[]
=
{
'I'
,
'c'
,
'o'
,
'n'
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
clsid
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
clsid2
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
'2'
,
0
};
static
const
WCHAR
iconIndex
[]
=
{
'I'
,
'c'
,
'o'
,
'n'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
if
(
SHELL32_GetCustomFolderAttribute
(
This
->
pidl
,
shellClassInfo
,
iconFile
,
wszPath
,
MAX_PATH
))
{
static
const
WCHAR
desktopIni
[]
=
{
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
'.'
,
'i'
,
'n'
,
'i'
,
0
};
HANDLE
hFile
;
PathAppendW
(
path
,
desktopIni
);
if
((
hFile
=
CreateFileW
(
path
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
))
!=
INVALID_HANDLE_VALUE
)
{
static
const
WCHAR
shellClassInfo
[]
=
{
'.'
,
'S'
,
'h'
,
'e'
,
'l'
,
'l'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
'I'
,
'n'
,
'f'
,
'o'
,
0
};
static
const
WCHAR
iconFile
[]
=
{
'I'
,
'c'
,
'o'
,
'n'
,
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
clsid
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
clsid2
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
'2'
,
0
};
static
const
WCHAR
defStr
[]
=
{
0
};
WCHAR
clsidStr
[
39
];
CloseHandle
(
hFile
);
if
(
GetPrivateProfileStringW
(
shellClassInfo
,
iconFile
,
defStr
,
szIconFile
,
cchMax
,
path
)
&&
strlenW
(
szIconFile
))
{
static
const
WCHAR
iconIndex
[]
=
{
'I'
,
'c'
,
'o'
,
'n'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
found
=
TRUE
;
*
piIndex
=
(
int
)
GetPrivateProfileIntW
(
shellClassInfo
,
iconIndex
,
0
,
path
);
}
else
if
(
GetPrivateProfileStringW
(
shellClassInfo
,
clsid
,
defStr
,
clsidStr
,
sizeof
(
clsidStr
)
/
sizeof
(
WCHAR
),
path
)
&&
strlenW
(
clsidStr
))
{
if
(
HCR_GetDefaultIconW
(
clsidStr
,
szIconFile
,
cchMax
,
&
dwNr
))
{
*
piIndex
=
dwNr
;
found
=
TRUE
;
}
}
else
if
(
GetPrivateProfileStringW
(
shellClassInfo
,
clsid2
,
defStr
,
clsidStr
,
sizeof
(
clsidStr
)
/
sizeof
(
WCHAR
),
path
)
&&
strlenW
(
clsidStr
))
{
if
(
HCR_GetDefaultIconW
(
clsidStr
,
szIconFile
,
cchMax
,
&
dwNr
))
{
*
piIndex
=
dwNr
;
found
=
TRUE
;
}
}
}
WCHAR
wszIconIndex
[
10
];
SHELL32_GetCustomFolderAttribute
(
This
->
pidl
,
shellClassInfo
,
iconIndex
,
wszIconIndex
,
10
);
*
piIndex
=
atoiW
(
wszIconIndex
);
}
else
if
(
SHELL32_GetCustomFolderAttribute
(
This
->
pidl
,
shellClassInfo
,
clsid
,
wszCLSIDValue
,
CHARS_IN_GUID
)
&&
HCR_GetDefaultIconW
(
wszCLSIDValue
,
szIconFile
,
cchMax
,
&
dwNr
))
{
*
piIndex
=
dwNr
;
}
else
if
(
SHELL32_GetCustomFolderAttribute
(
This
->
pidl
,
shellClassInfo
,
clsid2
,
wszCLSIDValue
,
CHARS_IN_GUID
)
&&
HCR_GetDefaultIconW
(
wszCLSIDValue
,
szIconFile
,
cchMax
,
&
dwNr
))
{
*
piIndex
=
dwNr
;
}
if
(
!
found
)
else
{
static
const
WCHAR
folder
[]
=
{
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
...
...
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