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
8e7cb4db
Commit
8e7cb4db
authored
Mar 25, 1999
by
Juergen Schmied
Committed by
Alexandre Julliard
Mar 25, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the new header for COM definitions.
parent
ddecd8a9
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1410 additions
and
1168 deletions
+1410
-1168
brsfolder.c
dlls/shell32/brsfolder.c
+1
-2
contmenu.c
dlls/shell32/contmenu.c
+225
-188
folders.c
dlls/shell32/folders.c
+92
-75
shell32_main.c
dlls/shell32/shell32_main.c
+2
-2
shell32_main.h
dlls/shell32/shell32_main.h
+5
-1
shellole.c
dlls/shell32/shellole.c
+18
-15
shlfolder.c
dlls/shell32/shlfolder.c
+2
-2
shlview.c
dlls/shell32/shlview.c
+462
-369
shlguid.h
include/shlguid.h
+0
-10
shlobj.h
include/shlobj.h
+11
-503
obj_base.h
include/wine/obj_base.h
+6
-0
obj_commdlgbrowser.h
include/wine/obj_commdlgbrowser.h
+44
-0
obj_contextmenu.h
include/wine/obj_contextmenu.h
+128
-0
obj_dockingwindowframe.h
include/wine/obj_dockingwindowframe.h
+43
-0
obj_extracticon.h
include/wine/obj_extracticon.h
+49
-0
obj_shellbrowser.h
include/wine/obj_shellbrowser.h
+106
-0
obj_shellextinit.h
include/wine/obj_shellextinit.h
+33
-0
obj_shellfolder.h
include/wine/obj_shellfolder.h
+40
-1
obj_shellview.h
include/wine/obj_shellview.h
+143
-0
No files found.
dlls/shell32/brsfolder.c
View file @
8e7cb4db
...
...
@@ -15,14 +15,13 @@
#include "commctrl.h"
#include "spy.h"
#include "shlobj.h"
#include "wine/obj_base.h"
#include "wine/obj_enumidlist.h"
#include "wine/obj_shellfolder.h"
#include "shell.h"
#include "pidl.h"
#include "shell32_main.h"
#include "shlguid.h"
#define IDD_TREEVIEW 99
...
...
dlls/shell32/contmenu.c
View file @
8e7cb4db
...
...
@@ -10,115 +10,103 @@
#include "pidl.h"
#include "wine/obj_base.h"
#include "if_macros.h"
#include "shlguid.h"
#include "wine/obj_contextmenu.h"
#include "wine/obj_shellbrowser.h"
#include "wine/obj_shellextinit.h"
#include "shell32_main.h"
#include "shresdef.h"
/**************************************************************************
* IContextMenu Implementation
*/
typedef
struct
{
ICOM_VTABLE
(
IContextMenu
)
*
lpvtbl
;
DWORD
ref
;
LPSHELLFOLDER
pSFParent
;
LPITEMIDLIST
*
aPidls
;
BOOL
bAllValues
;
{
ICOM_VTABLE
(
IContextMenu
)
*
lpvtbl
;
DWORD
ref
;
IShellFolder
*
pSFParent
;
LPITEMIDLIST
*
aPidls
;
BOOL
bAllValues
;
}
IContextMenuImpl
;
static
HRESULT
WINAPI
IContextMenu_fnQueryInterface
(
IContextMenu
*
,
REFIID
,
LPVOID
*
);
static
ULONG
WINAPI
IContextMenu_fnAddRef
(
IContextMenu
*
);
static
ULONG
WINAPI
IContextMenu_fnRelease
(
IContextMenu
*
);
static
HRESULT
WINAPI
IContextMenu_fnQueryContextMenu
(
IContextMenu
*
,
HMENU
,
UINT
,
UINT
,
UINT
,
UINT
);
static
HRESULT
WINAPI
IContextMenu_fnInvokeCommand
(
IContextMenu
*
,
LPCMINVOKECOMMANDINFO
);
static
HRESULT
WINAPI
IContextMenu_fnGetCommandString
(
IContextMenu
*
,
UINT
,
UINT
,
LPUINT
,
LPSTR
,
UINT
);
static
HRESULT
WINAPI
IContextMenu_fnHandleMenuMsg
(
IContextMenu
*
,
UINT
,
WPARAM
,
LPARAM
);
/* Private Methods */
BOOL
IContextMenu_AllocPidlTable
(
IContextMenuImpl
*
,
DWORD
);
void
IContextMenu_FreePidlTable
(
IContextMenuImpl
*
);
BOOL
IContextMenu_CanRenameItems
(
IContextMenuImpl
*
);
BOOL
IContextMenu_FillPidlTable
(
IContextMenuImpl
*
,
LPCITEMIDLIST
*
,
UINT
);
static
struct
ICOM_VTABLE
(
IContextMenu
)
cmvt
;
/**************************************************************************
* IContextMenu VTable
*
* IContextMenu_AllocPidlTable()
*/
static
struct
ICOM_VTABLE
(
IContextMenu
)
cmvt
=
{
IContextMenu_fnQueryInterface
,
IContextMenu_fnAddRef
,
IContextMenu_fnRelease
,
IContextMenu_fnQueryContextMenu
,
IContextMenu_fnInvokeCommand
,
IContextMenu_fnGetCommandString
,
IContextMenu_fnHandleMenuMsg
,
(
void
*
)
0xdeadbabe
/* just paranoia */
};
BOOL
IContextMenu_AllocPidlTable
(
IContextMenuImpl
*
This
,
DWORD
dwEntries
)
{
TRACE
(
shell
,
"(%p)->(entrys=%lu)
\n
"
,
This
,
dwEntries
);
/**************************************************************************
* IContextMenu_fnQueryInterface
*/
static
HRESULT
WINAPI
IContextMenu_fnQueryInterface
(
IContextMenu
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
char
xriid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
riid
,
xriid
);
TRACE
(
shell
,
"(%p)->(
\n\t
IID:
\t
%s,%p)
\n
"
,
This
,
xriid
,
ppvObj
);
*
ppvObj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
/*IUnknown*/
{
*
ppvObj
=
This
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IContextMenu
))
/*IContextMenu*/
{
*
ppvObj
=
This
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IShellExtInit
))
/*IShellExtInit*/
{
FIXME
(
shell
,
"-- LPSHELLEXTINIT pointer requested
\n
"
);
}
if
(
*
ppvObj
)
{
(
*
(
IContextMenuImpl
**
)
ppvObj
)
->
lpvtbl
->
fnAddRef
(
iface
);
TRACE
(
shell
,
"-- Interface: (%p)->(%p)
\n
"
,
ppvObj
,
*
ppvObj
);
return
S_OK
;
}
TRACE
(
shell
,
"-- Interface: E_NOINTERFACE
\n
"
);
return
E_NOINTERFACE
;
}
/*add one for NULL terminator */
dwEntries
++
;
This
->
aPidls
=
(
LPITEMIDLIST
*
)
SHAlloc
(
dwEntries
*
sizeof
(
LPITEMIDLIST
));
if
(
This
->
aPidls
)
{
ZeroMemory
(
This
->
aPidls
,
dwEntries
*
sizeof
(
LPITEMIDLIST
));
/*set all of the entries to NULL*/
}
return
(
This
->
aPidls
!=
NULL
);
}
/**************************************************************************
*
IContextMenu_fnAddRef
*
IContextMenu_FreePidlTable()
*/
static
ULONG
WINAPI
IContextMenu_fnAddRef
(
IContextMenu
*
iface
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
TRACE
(
shell
,
"(%p)->(count=%lu)
\n
"
,
This
,(
This
->
ref
)
+
1
);
shell32_ObjCount
++
;
return
++
(
This
->
ref
);
void
IContextMenu_FreePidlTable
(
IContextMenuImpl
*
This
)
{
int
i
;
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
);
if
(
This
->
aPidls
)
{
for
(
i
=
0
;
This
->
aPidls
[
i
];
i
++
)
{
SHFree
(
This
->
aPidls
[
i
]);
}
SHFree
(
This
->
aPidls
);
This
->
aPidls
=
NULL
;
}
}
/**************************************************************************
*
IContextMenu_fnRelease
*
IContextMenu_FillPidlTable()
*/
static
ULONG
WINAPI
IContextMenu_fnRelease
(
IContextMenu
*
iface
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
)
;
BOOL
IContextMenu_FillPidlTable
(
IContextMenuImpl
*
This
,
LPCITEMIDLIST
*
aPidls
,
UINT
uItemCount
)
{
UINT
i
;
shell32_ObjCount
--
;
TRACE
(
shell
,
"(%p)->(apidl=%p count=%u)
\n
"
,
This
,
aPidls
,
uItemCount
)
;
if
(
!--
(
This
->
ref
))
{
TRACE
(
shell
,
" destroying IContextMenu(%p)
\n
"
,
This
);
if
(
This
->
aPidls
)
{
for
(
i
=
0
;
i
<
uItemCount
;
i
++
)
{
This
->
aPidls
[
i
]
=
ILClone
(
aPidls
[
i
]);
}
return
TRUE
;
}
return
FALSE
;
}
if
(
This
->
pSFParent
)
This
->
pSFParent
->
lpvtbl
->
fnRelease
(
This
->
pSFParent
);
/**************************************************************************
* IContextMenu_CanRenameItems()
*/
BOOL
IContextMenu_CanRenameItems
(
IContextMenuImpl
*
This
)
{
UINT
i
;
DWORD
dwAttributes
;
/*make sure the pidl is freed*/
if
(
This
->
aPidls
)
{
IContextMenu_FreePidlTable
(
This
);
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
);
if
(
This
->
aPidls
)
{
for
(
i
=
0
;
This
->
aPidls
[
i
];
i
++
){}
/*get the number of items assigned to This object*/
{
if
(
i
>
1
)
/*you can't rename more than one item at a time*/
{
return
FALSE
;
}
}
dwAttributes
=
SFGAO_CANRENAME
;
IShellFolder_GetAttributesOf
(
This
->
pSFParent
,
i
,
(
LPCITEMIDLIST
*
)
This
->
aPidls
,
&
dwAttributes
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
return
dwAttributes
&
SFGAO_CANRENAME
;
}
return
This
->
ref
;
return
FALSE
;
}
/**************************************************************************
...
...
@@ -127,19 +115,19 @@ static ULONG WINAPI IContextMenu_fnRelease(IContextMenu *iface)
IContextMenu
*
IContextMenu_Constructor
(
LPSHELLFOLDER
pSFParent
,
LPCITEMIDLIST
*
aPidls
,
UINT
uItemCount
)
{
IContextMenuImpl
*
cm
;
UINT
u
;
FIXME
(
shell
,
"HELLO age
\n
"
)
;
cm
=
(
IContextMenuImpl
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IContextMenuImpl
));
cm
->
lpvtbl
=&
cmvt
;
cm
->
ref
=
1
;
cm
->
pSFParent
=
pSFParent
;
if
(
cm
->
pSFParent
)
cm
->
pSFParent
->
lpvtbl
->
fnAddRef
(
cm
->
pSFParent
);
if
(
pSFParent
)
IShellFolder_AddRef
(
pSFParent
);
cm
->
aPidls
=
NULL
;
IContextMenu_AllocPidlTable
(
cm
,
uItemCount
);
if
(
cm
->
aPidls
)
{
IContextMenu_FillPidlTable
(
cm
,
aPidls
,
uItemCount
);
}
...
...
@@ -152,12 +140,95 @@ IContextMenu *IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST *a
shell32_ObjCount
++
;
return
(
IContextMenu
*
)
cm
;
}
/**************************************************************************
* IContextMenu_fnQueryInterface
*/
static
HRESULT
WINAPI
IContextMenu_fnQueryInterface
(
IContextMenu
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
char
xriid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
riid
,
xriid
);
TRACE
(
shell
,
"(%p)->(
\n\t
IID:
\t
%s,%p)
\n
"
,
This
,
xriid
,
ppvObj
);
*
ppvObj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
/*IUnknown*/
{
*
ppvObj
=
This
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IContextMenu
))
/*IContextMenu*/
{
*
ppvObj
=
This
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IShellExtInit
))
/*IShellExtInit*/
{
FIXME
(
shell
,
"-- LPSHELLEXTINIT pointer requested
\n
"
);
}
if
(
*
ppvObj
)
{
IContextMenu_AddRef
((
IContextMenu
*
)
*
ppvObj
);
TRACE
(
shell
,
"-- Interface: (%p)->(%p)
\n
"
,
ppvObj
,
*
ppvObj
);
return
S_OK
;
}
TRACE
(
shell
,
"-- Interface: E_NOINTERFACE
\n
"
);
return
E_NOINTERFACE
;
}
/**************************************************************************
* IContextMenu_fnAddRef
*/
static
ULONG
WINAPI
IContextMenu_fnAddRef
(
IContextMenu
*
iface
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
TRACE
(
shell
,
"(%p)->(count=%lu)
\n
"
,
This
,(
This
->
ref
)
+
1
);
shell32_ObjCount
++
;
return
++
(
This
->
ref
);
}
/**************************************************************************
* IContextMenu_fnRelease
*/
static
ULONG
WINAPI
IContextMenu_fnRelease
(
IContextMenu
*
iface
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
);
shell32_ObjCount
--
;
if
(
!--
(
This
->
ref
))
{
TRACE
(
shell
,
" destroying IContextMenu(%p)
\n
"
,
This
);
if
(
This
->
pSFParent
)
IShellFolder_Release
(
This
->
pSFParent
);
/*make sure the pidl is freed*/
if
(
This
->
aPidls
)
{
IContextMenu_FreePidlTable
(
This
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
}
/**************************************************************************
* ICM_InsertItem()
*/
void
WINAPI
_InsertMenuItem
(
HMENU
hmenu
,
UINT
indexMenu
,
BOOL
fByPosition
,
UINT
wID
,
UINT
fType
,
LPSTR
dwTypeData
,
UINT
fState
)
{
MENUITEMINFOA
mii
;
void
WINAPI
_InsertMenuItem
(
HMENU
hmenu
,
UINT
indexMenu
,
BOOL
fByPosition
,
UINT
wID
,
UINT
fType
,
LPSTR
dwTypeData
,
UINT
fState
)
{
MENUITEMINFOA
mii
;
ZeroMemory
(
&
mii
,
sizeof
(
mii
));
mii
.
cbSize
=
sizeof
(
mii
);
...
...
@@ -177,9 +248,16 @@ void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
* IContextMenu_fnQueryContextMenu()
*/
static
HRESULT
WINAPI
IContextMenu_fnQueryContextMenu
(
IContextMenu
*
iface
,
HMENU
hmenu
,
UINT
indexMenu
,
UINT
idCmdFirst
,
UINT
idCmdLast
,
UINT
uFlags
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
static
HRESULT
WINAPI
IContextMenu_fnQueryContextMenu
(
IContextMenu
*
iface
,
HMENU
hmenu
,
UINT
indexMenu
,
UINT
idCmdFirst
,
UINT
idCmdLast
,
UINT
uFlags
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
BOOL
fExplore
;
TRACE
(
shell
,
"(%p)->(hmenu=%x indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )
\n
"
,
This
,
hmenu
,
indexMenu
,
idCmdFirst
,
idCmdLast
,
uFlags
);
...
...
@@ -193,19 +271,19 @@ static HRESULT WINAPI IContextMenu_fnQueryContextMenu(IContextMenu *iface, HMENU
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
idCmdFirst
+
IDM_OPEN
,
MFT_STRING
,
"&Open"
,
MFS_ENABLED
);
}
else
{
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
idCmdFirst
+
IDM_OPEN
,
MFT_STRING
,
"&Open"
,
MFS_ENABLED
|
MFS_DEFAULT
);
{
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
idCmdFirst
+
IDM_OPEN
,
MFT_STRING
,
"&Open"
,
MFS_ENABLED
|
MFS_DEFAULT
);
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
idCmdFirst
+
IDM_EXPLORE
,
MFT_STRING
,
"&Explore"
,
MFS_ENABLED
);
}
}
if
(
uFlags
&
CMF_CANRENAME
)
{
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
0
,
MFT_SEPARATOR
,
NULL
,
0
);
if
(
uFlags
&
CMF_CANRENAME
)
{
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
0
,
MFT_SEPARATOR
,
NULL
,
0
);
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
idCmdFirst
+
IDM_RENAME
,
MFT_STRING
,
"&Rename"
,
(
IContextMenu_CanRenameItems
(
This
)
?
MFS_ENABLED
:
MFS_DISABLED
));
}
}
else
/* file menu */
{
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
idCmdFirst
+
IDM_OPEN
,
MFT_STRING
,
"&Open"
,
MFS_ENABLED
|
MFS_DEFAULT
);
if
(
uFlags
&
CMF_CANRENAME
)
{
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
0
,
MFT_SEPARATOR
,
NULL
,
0
);
if
(
uFlags
&
CMF_CANRENAME
)
{
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
0
,
MFT_SEPARATOR
,
NULL
,
0
);
_InsertMenuItem
(
hmenu
,
indexMenu
++
,
TRUE
,
idCmdFirst
+
IDM_RENAME
,
MFT_STRING
,
"&Rename"
,
(
IContextMenu_CanRenameItems
(
This
)
?
MFS_ENABLED
:
MFS_DISABLED
));
}
}
...
...
@@ -217,8 +295,12 @@ static HRESULT WINAPI IContextMenu_fnQueryContextMenu(IContextMenu *iface, HMENU
/**************************************************************************
* IContextMenu_fnInvokeCommand()
*/
static
HRESULT
WINAPI
IContextMenu_fnInvokeCommand
(
IContextMenu
*
iface
,
LPCMINVOKECOMMANDINFO
lpcmi
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
static
HRESULT
WINAPI
IContextMenu_fnInvokeCommand
(
IContextMenu
*
iface
,
LPCMINVOKECOMMANDINFO
lpcmi
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
LPITEMIDLIST
pidlTemp
,
pidlFQ
;
LPSHELLBROWSER
lpSB
;
LPSHELLVIEW
lpSV
;
...
...
@@ -226,13 +308,13 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO
SHELLEXECUTEINFOA
sei
;
int
i
;
TRACE
(
shell
,
"(%p)->(invcom=%p verb=%p wnd=%x)
\n
"
,
This
,
lpcmi
,
lpcmi
->
lpVerb
,
lpcmi
->
hwnd
);
TRACE
(
shell
,
"(%p)->(invcom=%p verb=%p wnd=%x)
\n
"
,
This
,
lpcmi
,
lpcmi
->
lpVerb
,
lpcmi
->
hwnd
);
if
(
HIWORD
(
lpcmi
->
lpVerb
))
{
/* get the active IShellView */
lpSB
=
(
LPSHELLBROWSER
)
SendMessageA
(
lpcmi
->
hwnd
,
CWM_GETISHELLBROWSER
,
0
,
0
);
IShellBrowser_QueryActiveShellView
(
lpSB
,
&
lpSV
);
/* does AddRef() on lpSV */
lpSV
->
lpvtbl
->
fn
GetWindow
(
lpSV
,
&
hWndSV
);
IShellView_
GetWindow
(
lpSV
,
&
hWndSV
);
/* these verbs are used by the filedialogs*/
TRACE
(
shell
,
"%s
\n
"
,
lpcmi
->
lpVerb
);
...
...
@@ -248,7 +330,7 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO
else
{
FIXME
(
shell
,
"please report: unknown verb %s
\n
"
,
lpcmi
->
lpVerb
);
}
lpSV
->
lpvtbl
->
fn
Release
(
lpSV
);
IShellView_
Release
(
lpSV
);
return
NOERROR
;
}
...
...
@@ -258,18 +340,18 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO
switch
(
LOWORD
(
lpcmi
->
lpVerb
))
{
case
IDM_EXPLORE
:
case
IDM_OPEN
:
/* Find the first item in the list that is not a value. These commands
should never be invoked if there isn't at least one folder item in the list.*/
/* Find the first item in the list that is not a value. These commands
should never be invoked if there isn't at least one folder item in the list.*/
for
(
i
=
0
;
This
->
aPidls
[
i
];
i
++
)
{
if
(
!
_ILIsValue
(
This
->
aPidls
[
i
]))
break
;
break
;
}
pidlTemp
=
ILCombine
(((
IGenericSFImpl
*
)(
This
->
pSFParent
))
->
mpidl
,
This
->
aPidls
[
i
]);
pidlFQ
=
ILCombine
(((
IGenericSFImpl
*
)(
This
->
pSFParent
))
->
pMyPidl
,
pidlTemp
);
SHFree
(
pidlTemp
);
ZeroMemory
(
&
sei
,
sizeof
(
sei
));
sei
.
cbSize
=
sizeof
(
sei
);
sei
.
fMask
=
SEE_MASK_IDLIST
|
SEE_MASK_CLASSNAME
;
...
...
@@ -277,7 +359,7 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO
sei
.
lpClass
=
"folder"
;
sei
.
hwnd
=
lpcmi
->
hwnd
;
sei
.
nShow
=
SW_SHOWNORMAL
;
if
(
LOWORD
(
lpcmi
->
lpVerb
)
==
IDM_EXPLORE
)
{
sei
.
lpVerb
=
"explore"
;
}
...
...
@@ -299,9 +381,16 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO
/**************************************************************************
* IContextMenu_fnGetCommandString()
*/
static
HRESULT
WINAPI
IContextMenu_fnGetCommandString
(
IContextMenu
*
iface
,
UINT
idCommand
,
UINT
uFlags
,
LPUINT
lpReserved
,
LPSTR
lpszName
,
UINT
uMaxNameLen
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
static
HRESULT
WINAPI
IContextMenu_fnGetCommandString
(
IContextMenu
*
iface
,
UINT
idCommand
,
UINT
uFlags
,
LPUINT
lpReserved
,
LPSTR
lpszName
,
UINT
uMaxNameLen
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
HRESULT
hr
=
E_INVALIDARG
;
TRACE
(
shell
,
"(%p)->(idcom=%x flags=%x %p name=%p len=%x)
\n
"
,
This
,
idCommand
,
uFlags
,
lpReserved
,
lpszName
,
uMaxNameLen
);
...
...
@@ -310,7 +399,7 @@ static HRESULT WINAPI IContextMenu_fnGetCommandString(IContextMenu *iface, UINT
{
case
GCS_HELPTEXT
:
hr
=
E_NOTIMPL
;
break
;
case
GCS_VERBA
:
switch
(
idCommand
)
{
case
IDM_RENAME
:
...
...
@@ -345,84 +434,32 @@ static HRESULT WINAPI IContextMenu_fnGetCommandString(IContextMenu *iface, UINT
* should be only in IContextMenu2 and IContextMenu3
* is nevertheless called from word95
*/
static
HRESULT
WINAPI
IContextMenu_fnHandleMenuMsg
(
IContextMenu
*
iface
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
TRACE
(
shell
,
"(%p)->(msg=%x wp=%x lp=%lx)
\n
"
,
This
,
uMsg
,
wParam
,
lParam
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IContextMenu_fnHandleMenuMsg
(
IContextMenu
*
iface
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ICOM_THIS
(
IContextMenuImpl
,
iface
);
TRACE
(
shell
,
"(%p)->(msg=%x wp=%x lp=%lx)
\n
"
,
This
,
uMsg
,
wParam
,
lParam
);
/**************************************************************************
* IContextMenu_AllocPidlTable()
*/
BOOL
IContextMenu_AllocPidlTable
(
IContextMenuImpl
*
This
,
DWORD
dwEntries
)
{
TRACE
(
shell
,
"(%p)->(entrys=%lu)
\n
"
,
This
,
dwEntries
);
/*add one for NULL terminator */
dwEntries
++
;
This
->
aPidls
=
(
LPITEMIDLIST
*
)
SHAlloc
(
dwEntries
*
sizeof
(
LPITEMIDLIST
));
if
(
This
->
aPidls
)
{
ZeroMemory
(
This
->
aPidls
,
dwEntries
*
sizeof
(
LPITEMIDLIST
));
/*set all of the entries to NULL*/
}
return
(
This
->
aPidls
!=
NULL
);
}
/**************************************************************************
* IContextMenu_FreePidlTable()
*/
void
IContextMenu_FreePidlTable
(
IContextMenuImpl
*
This
)
{
int
i
;
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
);
if
(
This
->
aPidls
)
{
for
(
i
=
0
;
This
->
aPidls
[
i
];
i
++
)
{
SHFree
(
This
->
aPidls
[
i
]);
}
SHFree
(
This
->
aPidls
);
This
->
aPidls
=
NULL
;
}
}
/**************************************************************************
* IContextMenu_FillPidlTable()
*/
BOOL
IContextMenu_FillPidlTable
(
IContextMenuImpl
*
This
,
LPCITEMIDLIST
*
aPidls
,
UINT
uItemCount
)
{
UINT
i
;
TRACE
(
shell
,
"(%p)->(apidl=%p count=%u)
\n
"
,
This
,
aPidls
,
uItemCount
);
if
(
This
->
aPidls
)
{
for
(
i
=
0
;
i
<
uItemCount
;
i
++
)
{
This
->
aPidls
[
i
]
=
ILClone
(
aPidls
[
i
]);
}
return
TRUE
;
}
return
FALSE
;
return
E_NOTIMPL
;
}
/**************************************************************************
* IContextMenu_CanRenameItems()
* IContextMenu VTable
*
*/
BOOL
IContextMenu_CanRenameItems
(
IContextMenuImpl
*
This
)
{
UINT
i
;
DWORD
dwAttributes
;
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
);
if
(
This
->
aPidls
)
{
for
(
i
=
0
;
This
->
aPidls
[
i
];
i
++
){}
/*get the number of items assigned to This object*/
if
(
i
>
1
)
/*you can't rename more than one item at a time*/
{
return
FALSE
;
}
dwAttributes
=
SFGAO_CANRENAME
;
This
->
pSFParent
->
lpvtbl
->
fnGetAttributesOf
(
This
->
pSFParent
,
i
,
(
LPCITEMIDLIST
*
)
This
->
aPidls
,
&
dwAttributes
);
return
dwAttributes
&
SFGAO_CANRENAME
;
}
return
FALSE
;
}
static
struct
ICOM_VTABLE
(
IContextMenu
)
cmvt
=
{
IContextMenu_fnQueryInterface
,
IContextMenu_fnAddRef
,
IContextMenu_fnRelease
,
IContextMenu_fnQueryContextMenu
,
IContextMenu_fnInvokeCommand
,
IContextMenu_fnGetCommandString
,
IContextMenu_fnHandleMenuMsg
,
(
void
*
)
0xdeadbabe
/* just paranoia */
};
dlls/shell32/folders.c
View file @
8e7cb4db
...
...
@@ -6,113 +6,119 @@
#include <stdlib.h>
#include <string.h>
#include "debug.h"
#include "wine/obj_base.h"
#include "wine/obj_extracticon.h"
#include "debug.h"
#include "winerror.h"
#include "pidl.h"
#include "shell32_main.h"
#include "shlguid.h"
/***********************************************************************
*******
*
foreward declar
ation
/***********************************************************************
*
IExtractIconA implement
ation
*/
/* IExtractIcon implementation*/
static
HRESULT
WINAPI
IExtractIcon_QueryInterface
(
LPEXTRACTICON
,
REFIID
,
LPVOID
*
)
;
static
ULONG
WINAPI
IExtractIcon_AddRef
(
LPEXTRACTICON
)
;
static
ULONG
WINAPI
IExtractIcon_AddRef
(
LPEXTRACTICON
)
;
static
ULONG
WINAPI
IExtractIcon_Release
(
LPEXTRACTICON
)
;
static
HRESULT
WINAPI
IExtractIcon_GetIconLocation
(
LPEXTRACTICON
,
UINT
,
LPSTR
,
UINT
,
int
*
,
UINT
*
);
static
HRESULT
WINAPI
IExtractIcon_Extract
(
LPEXTRACTICON
,
LPCSTR
,
UINT
,
HICON
*
,
HICON
*
,
UINT
)
;
typedef
struct
{
ICOM_VTABLE
(
IExtractIconA
)
*
lpvtbl
;
DWORD
ref
;
LPITEMIDLIST
pidl
;
}
IExtractIconAImpl
;
static
struct
ICOM_VTABLE
(
IExtractIconA
)
eivt
;
/***********************************************************************
* IExtractIcon implementation
*/
static
struct
IExtractIcon_VTable
eivt
=
{
IExtractIcon_QueryInterface
,
IExtractIcon_AddRef
,
IExtractIcon_Release
,
IExtractIcon_GetIconLocation
,
IExtractIcon_Extract
};
/**************************************************************************
* IExtractIcon_Constructor
* IExtractIcon
A
_Constructor
*/
LPEXTRACTICON
IExtractIcon_Constructor
(
LPCITEMIDLIST
pidl
)
{
LPEXTRACTICON
ei
;
IExtractIconA
*
IExtractIconA_Constructor
(
LPCITEMIDLIST
pidl
)
{
IExtractIconAImpl
*
ei
;
ei
=
(
LPEXTRACTICON
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IExtractIcon
));
ei
->
ref
=
1
;
ei
->
lpvtbl
=&
eivt
;
ei
->
pidl
=
ILClone
(
pidl
);
ei
=
(
IExtractIconAImpl
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IExtractIconAImpl
));
ei
->
ref
=
1
;
ei
->
lpvtbl
=&
eivt
;
ei
->
pidl
=
ILClone
(
pidl
);
pdump
(
pidl
);
pdump
(
pidl
);
TRACE
(
shell
,
"(%p)
\n
"
,
ei
);
shell32_ObjCount
++
;
return
ei
;
return
(
IExtractIconA
*
)
ei
;
}
/**************************************************************************
* IExtractIcon_QueryInterface
* IExtractIcon
A
_QueryInterface
*/
static
HRESULT
WINAPI
IExtractIcon_QueryInterface
(
LPEXTRACTICON
this
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
char
xriid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
riid
,
xriid
);
TRACE
(
shell
,
"(%p)->(
\n\t
IID:
\t
%s,%p)
\n
"
,
this
,
xriid
,
ppvObj
);
*
ppvObj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
/*IUnknown*/
{
*
ppvObj
=
this
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IExtractIcon
))
/*IExtractIcon*/
{
*
ppvObj
=
(
IExtractIcon
*
)
this
;
}
if
(
*
ppvObj
)
{
(
*
(
LPEXTRACTICON
*
)
ppvObj
)
->
lpvtbl
->
fnAddRef
(
this
);
TRACE
(
shell
,
"-- Interface: (%p)->(%p)
\n
"
,
ppvObj
,
*
ppvObj
);
return
S_OK
;
}
static
HRESULT
WINAPI
IExtractIconA_fnQueryInterface
(
IExtractIconA
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
ICOM_THIS
(
IExtractIconAImpl
,
iface
);
char
xriid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
riid
,
xriid
);
TRACE
(
shell
,
"(%p)->(
\n\t
IID:
\t
%s,%p)
\n
"
,
This
,
xriid
,
ppvObj
);
*
ppvObj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
/*IUnknown*/
{
*
ppvObj
=
This
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IExtractIconA
))
/*IExtractIcon*/
{
*
ppvObj
=
(
IExtractIconA
*
)
This
;
}
if
(
*
ppvObj
)
{
IExtractIconA_AddRef
((
IExtractIconA
*
)
*
ppvObj
);
TRACE
(
shell
,
"-- Interface: (%p)->(%p)
\n
"
,
ppvObj
,
*
ppvObj
);
return
S_OK
;
}
TRACE
(
shell
,
"-- Interface: E_NOINTERFACE
\n
"
);
return
E_NOINTERFACE
;
}
}
/**************************************************************************
* IExtractIcon_AddRef
* IExtractIcon
A
_AddRef
*/
static
ULONG
WINAPI
IExtractIcon_AddRef
(
LPEXTRACTICON
this
)
{
TRACE
(
shell
,
"(%p)->(count=%lu)
\n
"
,
this
,(
this
->
ref
)
+
1
);
static
ULONG
WINAPI
IExtractIconA_fnAddRef
(
IExtractIconA
*
iface
)
{
ICOM_THIS
(
IExtractIconAImpl
,
iface
);
TRACE
(
shell
,
"(%p)->(count=%lu)
\n
"
,
This
,(
This
->
ref
)
+
1
);
shell32_ObjCount
++
;
return
++
(
t
his
->
ref
);
return
++
(
T
his
->
ref
);
}
/**************************************************************************
* IExtractIcon_Release
* IExtractIcon
A
_Release
*/
static
ULONG
WINAPI
IExtractIcon_Release
(
LPEXTRACTICON
this
)
{
TRACE
(
shell
,
"(%p)->()
\n
"
,
this
);
static
ULONG
WINAPI
IExtractIconA_fnRelease
(
IExtractIconA
*
iface
)
{
ICOM_THIS
(
IExtractIconAImpl
,
iface
);
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
);
shell32_ObjCount
--
;
if
(
!--
(
t
his
->
ref
))
{
TRACE
(
shell
,
" destroying IExtractIcon(%p)
\n
"
,
t
his
);
SHFree
(
t
his
->
pidl
);
HeapFree
(
GetProcessHeap
(),
0
,
t
his
);
return
0
;
}
return
t
his
->
ref
;
if
(
!--
(
T
his
->
ref
))
{
TRACE
(
shell
,
" destroying IExtractIcon(%p)
\n
"
,
T
his
);
SHFree
(
T
his
->
pidl
);
HeapFree
(
GetProcessHeap
(),
0
,
T
his
);
return
0
;
}
return
T
his
->
ref
;
}
/**************************************************************************
* IExtractIcon_GetIconLocation
* IExtractIcon
A
_GetIconLocation
*/
static
HRESULT
WINAPI
IExtractIcon_GetIconLocation
(
LPEXTRACTICON
this
,
UINT
uFlags
,
LPSTR
szIconFile
,
UINT
cchMax
,
int
*
piIndex
,
UINT
*
pwFlags
)
{
WARN
(
shell
,
"(%p) (flags=%u file=%s max=%u %p %p) semi-stub
\n
"
,
this
,
uFlags
,
szIconFile
,
cchMax
,
piIndex
,
pwFlags
);
static
HRESULT
WINAPI
IExtractIconA_fnGetIconLocation
(
IExtractIconA
*
iface
,
UINT
uFlags
,
LPSTR
szIconFile
,
UINT
cchMax
,
int
*
piIndex
,
UINT
*
pwFlags
)
{
ICOM_THIS
(
IExtractIconAImpl
,
iface
);
*
piIndex
=
(
int
)
SHMapPIDLToSystemImageListIndex
(
0
,
this
->
pidl
,
0
);
WARN
(
shell
,
"(%p) (flags=%u file=%s max=%u %p %p) semi-stub
\n
"
,
This
,
uFlags
,
szIconFile
,
cchMax
,
piIndex
,
pwFlags
);
*
piIndex
=
(
int
)
SHMapPIDLToSystemImageListIndex
(
0
,
This
->
pidl
,
0
);
*
pwFlags
=
GIL_NOTFILENAME
;
WARN
(
shell
,
"-- %x
\n
"
,
*
piIndex
);
...
...
@@ -120,12 +126,23 @@ static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT uFla
return
NOERROR
;
}
/**************************************************************************
* IExtractIcon_Extract
* IExtractIcon
A
_Extract
*/
static
HRESULT
WINAPI
IExtractIcon_Extract
(
LPEXTRACTICON
this
,
LPCSTR
pszFile
,
UINT
nIconIndex
,
HICON
*
phiconLarge
,
HICON
*
phiconSmall
,
UINT
nIconSize
)
{
FIXME
(
shell
,
"(%p) (file=%s index=%u %p %p size=%u) semi-stub
\n
"
,
this
,
pszFile
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIconSize
);
*
phiconLarge
=
pImageList_GetIcon
(
ShellBigIconList
,
nIconIndex
,
ILD_TRANSPARENT
);
*
phiconSmall
=
pImageList_GetIcon
(
ShellSmallIconList
,
nIconIndex
,
ILD_TRANSPARENT
);
return
S_OK
;
static
HRESULT
WINAPI
IExtractIconA_fnExtract
(
IExtractIconA
*
iface
,
LPCSTR
pszFile
,
UINT
nIconIndex
,
HICON
*
phiconLarge
,
HICON
*
phiconSmall
,
UINT
nIconSize
)
{
ICOM_THIS
(
IExtractIconAImpl
,
iface
);
FIXME
(
shell
,
"(%p) (file=%s index=%u %p %p size=%u) semi-stub
\n
"
,
This
,
pszFile
,
nIconIndex
,
phiconLarge
,
phiconSmall
,
nIconSize
);
*
phiconLarge
=
pImageList_GetIcon
(
ShellBigIconList
,
nIconIndex
,
ILD_TRANSPARENT
);
*
phiconSmall
=
pImageList_GetIcon
(
ShellSmallIconList
,
nIconIndex
,
ILD_TRANSPARENT
);
return
S_OK
;
}
static
struct
ICOM_VTABLE
(
IExtractIconA
)
eivt
=
{
IExtractIconA_fnQueryInterface
,
IExtractIconA_fnAddRef
,
IExtractIconA_fnRelease
,
IExtractIconA_fnGetIconLocation
,
IExtractIconA_fnExtract
};
dlls/shell32/shell32_main.c
View file @
8e7cb4db
...
...
@@ -1089,9 +1089,9 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
{
pdesktopfolder
->
lpvtbl
->
fnRelease
(
pdesktopfolder
);
}
/* this one is here
ot
check if AddRef/Release is balanced */
/* this one is here
to
check if AddRef/Release is balanced */
if
(
shell32_ObjCount
)
{
FIXME
(
shell
,
"%u objects left
\n
"
,
shell32_ObjCount
);
{
WARN
(
shell
,
"leaving with %u objects left (memory leak)
\n
"
,
shell32_ObjCount
);
}
}
TRACE
(
shell
,
"refcount=%u objcount=%u
\n
"
,
shell32_RefCount
,
shell32_ObjCount
);
...
...
dlls/shell32/shell32_main.h
View file @
8e7cb4db
...
...
@@ -86,7 +86,11 @@ extern LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER, LPCITEMIDLIST);
extern
LPSHELLLINK
IShellLink_Constructor
(
void
);
extern
LPSHELLLINKW
IShellLinkW_Constructor
(
void
);
extern
LPENUMIDLIST
IEnumIDList_Constructor
(
LPCSTR
,
DWORD
);
extern
LPEXTRACTICON
IExtractIcon_Constructor
(
LPITEMIDLIST
);
extern
LPEXTRACTICONA
IExtractIconA_Constructor
(
LPITEMIDLIST
);
/* fixme: rename the functions when the shell32.dll has it's own exports namespace */
HRESULT
WINAPI
SHELL32_DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
);
HRESULT
WINAPI
SHELL32_DllCanUnloadNow
(
void
);
/* elements of this structure are accessed directly from within shell32 */
typedef
struct
...
...
dlls/shell32/shellole.c
View file @
8e7cb4db
...
...
@@ -8,17 +8,23 @@
#include <stdlib.h>
#include <string.h>
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "winversion.h"
#include "wine/obj_shelllink.h"
#include "wine/obj_shellfolder.h"
#include "wine/obj_shellbrowser.h"
#include "wine/obj_contextmenu.h"
#include "wine/obj_shellextinit.h"
#include "wine/obj_extracticon.h"
#include "shlguid.h"
#include "
shlobj
.h"
#include "
shell32_main
.h"
#include "
winversion
.h"
#include "
winreg
.h"
#include "winerror.h"
#include "debug.h"
#include "shell32_main.h"
/*************************************************************************
*
*/
...
...
@@ -149,12 +155,9 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
* With this pointer it's possible to call the IClassFactory_CreateInstance
* method to get a instance of the requested Class.
* This function does NOT instantiate the Class!!!
*
* RETURNS
* HRESULT
*
*/
DWORD
WINAPI
SHELL32_DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
iid
,
LPVOID
*
ppv
)
HRESULT
WINAPI
SHELL32_DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
iid
,
LPVOID
*
ppv
)
{
HRESULT
hres
=
E_OUTOFMEMORY
;
LPCLASSFACTORY
lpclf
;
...
...
@@ -317,16 +320,16 @@ static HRESULT WINAPI IClassFactory_fnCreateInstance(
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IShellView
))
{
pObj
=
(
IUnknown
*
)
IShellView_Constructor
(
NULL
,
NULL
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IExtractIcon
))
{
pObj
=
(
IUnknown
*
)
IExtractIcon_Constructor
(
NULL
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IExtractIcon
A
))
{
pObj
=
(
IUnknown
*
)
IExtractIcon
A
_Constructor
(
NULL
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IContextMenu
))
{
pObj
=
(
IUnknown
*
)
IContextMenu_Constructor
(
NULL
,
NULL
,
0
);
}
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IDataObject
))
{
pObj
=
(
IUnknown
*
)
IDataObject_Constructor
(
0
,
NULL
,
NULL
,
0
);
}
}
else
{
ERR
(
shell
,
"unknown IID requested
\n\t
IID:
\t
%s
\n
"
,
xriid
);
return
(
E_NOINTERFACE
);
...
...
dlls/shell32/shlfolder.c
View file @
8e7cb4db
...
...
@@ -752,13 +752,13 @@ static HRESULT WINAPI IShellFolder_fnGetUIObjectOf(
pObj
=
(
LPUNKNOWN
)
IDataObject_Constructor
(
hwndOwner
,
(
IShellFolder
*
)
This
,
apidl
,
cidl
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IExtractIcon
))
else
if
(
IsEqualIID
(
riid
,
&
IID_IExtractIcon
A
))
{
if
(
cidl
!=
1
)
return
(
E_INVALIDARG
);
pidl
=
ILCombine
(
This
->
pMyPidl
,
apidl
[
0
]);
pObj
=
(
LPUNKNOWN
)
IExtractIcon_Constructor
(
pidl
);
pObj
=
(
LPUNKNOWN
)
IExtractIcon
A
_Constructor
(
pidl
);
SHFree
(
pidl
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IDropTarget
))
...
...
dlls/shell32/shlview.c
View file @
8e7cb4db
...
...
@@ -11,30 +11,57 @@
#include <stdlib.h>
#include <string.h>
#include "winerror.h"
#include "pidl.h"
#include "shlguid.h"
#include "shlobj.h"
#include "servprov.h"
#include "wine/obj_base.h"
#include "if_macros.h"
#include "shell32_main.h"
#include "wine/obj_shellfolder.h"
#include "wine/obj_shellview.h"
#include "wine/obj_commdlgbrowser.h"
#include "wine/obj_shellbrowser.h"
#include "wine/obj_dockingwindowframe.h"
#include "wine/obj_extracticon.h"
#include "shresdef.h"
#include "spy.h"
#include "debug.h"
#include "winerror.h"
#include "pidl.h"
#include "shell32_main.h"
typedef
struct
{
ICOM_VTABLE
(
IShellView
)
*
lpvtbl
;
DWORD
ref
;
LPITEMIDLIST
mpidl
;
IShellFolder
*
pSFParent
;
IShellBrowser
*
pShellBrowser
;
ICommDlgBrowser
*
pCommDlgBrowser
;
HWND
hWnd
;
HWND
hWndList
;
HWND
hWndParent
;
FOLDERSETTINGS
FolderSettings
;
HMENU
hMenu
;
UINT
uState
;
UINT
uSelected
;
LPITEMIDLIST
*
aSelectedItems
;
}
IShellViewImpl
;
static
struct
ICOM_VTABLE
(
IShellView
)
svvt
;
/***********************************************************************
* IShellView implementation
*/
/*
static HRESULT WINAPI IShellView_QueryInterface(LPSHELLVIEW,REFIID, LPVOID *);
static ULONG WINAPI IShellView_AddRef(LPSHELLVIEW) ;
static ULONG WINAPI IShellView_Release(LPSHELLVIEW);
*/
/* IOleWindow methods */
/*
static HRESULT WINAPI IShellView_GetWindow(LPSHELLVIEW,HWND * lphwnd);
static HRESULT WINAPI IShellView_ContextSensitiveHelp(LPSHELLVIEW,BOOL fEnterMode);
*/
/* IShellView methods */
/*
static HRESULT WINAPI IShellView_TranslateAccelerator(LPSHELLVIEW,LPMSG lpmsg);
static HRESULT WINAPI IShellView_EnableModeless(LPSHELLVIEW,BOOL fEnable);
static HRESULT WINAPI IShellView_UIActivate(LPSHELLVIEW,UINT uState);
...
...
@@ -48,26 +75,7 @@ static HRESULT WINAPI IShellView_SelectItem(LPSHELLVIEW, LPCITEMIDLIST pidlItem,
static HRESULT WINAPI IShellView_GetItemObject(LPSHELLVIEW, UINT uItem, REFIID riid,LPVOID *ppv);
static BOOL ShellView_CanDoIDockingWindow(LPSHELLVIEW);
static
struct
IShellView_VTable
svvt
=
{
IShellView_QueryInterface
,
IShellView_AddRef
,
IShellView_Release
,
IShellView_GetWindow
,
IShellView_ContextSensitiveHelp
,
IShellView_TranslateAccelerator
,
IShellView_EnableModeless
,
IShellView_UIActivate
,
IShellView_Refresh
,
IShellView_CreateViewWindow
,
IShellView_DestroyViewWindow
,
IShellView_GetCurrentInfo
,
IShellView_AddPropertySheetPages
,
IShellView_SaveViewState
,
IShellView_SelectItem
,
IShellView_GetItemObject
};
*/
/*menu items */
#define IDM_VIEW_FILES (FCIDM_SHVIEWFIRST + 0x500)
#define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501)
...
...
@@ -113,79 +121,84 @@ typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMa
/**************************************************************************
* IShellView_Constructor
*/
LPSHELLVIEW
IShellView_Constructor
(
LPSHELLFOLDER
pFolder
,
LPCITEMIDLIST
pidl
)
{
LPSHELLVIEW
sv
;
sv
=
(
LPSHELLVIEW
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IShellView
));
IShellView
*
IShellView_Constructor
(
IShellFolder
*
pFolder
,
LPCITEMIDLIST
pidl
)
{
IShellViewImpl
*
sv
;
sv
=
(
IShellViewImpl
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IShellViewImpl
));
sv
->
ref
=
1
;
sv
->
lpvtbl
=&
svvt
;
sv
->
mpidl
=
ILClone
(
pidl
);
sv
->
hMenu
=
0
;
sv
->
pSFParent
=
pFolder
;
sv
->
uSelected
=
0
;
sv
->
aSelectedItems
=
NULL
;
if
(
sv
->
pSFParent
)
sv
->
pSFParent
->
lpvtbl
->
fnAddRef
(
sv
->
pSFParent
);
if
(
pFolder
)
IShellFolder_AddRef
(
pFolder
);
TRACE
(
shell
,
"(%p)->(%p pidl=%p)
\n
"
,
sv
,
pFolder
,
pidl
);
shell32_ObjCount
++
;
return
sv
;
return
(
IShellView
*
)
sv
;
}
/**************************************************************************
* helperfunctions for communication with ICommDlgBrowser
*
*/
static
BOOL
IsInCommDlg
(
LPSHELLVIEW
t
his
)
{
return
(
t
his
->
pCommDlgBrowser
!=
NULL
);
static
BOOL
IsInCommDlg
(
IShellViewImpl
*
T
his
)
{
return
(
T
his
->
pCommDlgBrowser
!=
NULL
);
}
static
HRESULT
IncludeObject
(
LPSHELLVIEW
this
,
LPCITEMIDLIST
pidl
)
{
if
(
IsInCommDlg
(
this
)
)
static
HRESULT
IncludeObject
(
IShellViewImpl
*
This
,
LPCITEMIDLIST
pidl
)
{
if
(
IsInCommDlg
(
This
)
)
{
TRACE
(
shell
,
"ICommDlgBrowser::IncludeObject pidl=%p
\n
"
,
pidl
);
return
(
this
->
pCommDlgBrowser
->
lpvtbl
->
fnIncludeObject
(
this
->
pCommDlgBrowser
,
t
his
,
pidl
));
return
(
ICommDlgBrowser_IncludeObject
(
This
->
pCommDlgBrowser
,
(
IShellView
*
)
T
his
,
pidl
));
}
return
S_OK
;
}
static
HRESULT
OnDefaultCommand
(
LPSHELLVIEW
this
)
{
if
(
IsInCommDlg
(
this
))
static
HRESULT
OnDefaultCommand
(
IShellViewImpl
*
This
)
{
if
(
IsInCommDlg
(
This
))
{
TRACE
(
shell
,
"ICommDlgBrowser::OnDefaultCommand
\n
"
);
return
(
this
->
pCommDlgBrowser
->
lpvtbl
->
fnOnDefaultCommand
(
this
->
pCommDlgBrowser
,
t
his
));
return
(
ICommDlgBrowser_OnDefaultCommand
(
This
->
pCommDlgBrowser
,
(
IShellView
*
)
T
his
));
}
return
S_FALSE
;
}
static
HRESULT
OnStateChange
(
LPSHELLVIEW
this
,
UINT
uFlags
)
{
if
(
IsInCommDlg
(
this
))
static
HRESULT
OnStateChange
(
IShellViewImpl
*
This
,
UINT
uFlags
)
{
if
(
IsInCommDlg
(
This
))
{
TRACE
(
shell
,
"ICommDlgBrowser::OnStateChange flags=%x
\n
"
,
uFlags
);
return
(
this
->
pCommDlgBrowser
->
lpvtbl
->
fnOnStateChange
(
this
->
pCommDlgBrowser
,
t
his
,
uFlags
));
return
(
ICommDlgBrowser_OnStateChange
(
This
->
pCommDlgBrowser
,
(
IShellView
*
)
T
his
,
uFlags
));
}
return
S_FALSE
;
}
static
void
SetStyle
(
LPSHELLVIEW
t
his
,
DWORD
dwAdd
,
DWORD
dwRemove
)
static
void
SetStyle
(
IShellViewImpl
*
T
his
,
DWORD
dwAdd
,
DWORD
dwRemove
)
{
DWORD
tmpstyle
;
TRACE
(
shell
,
"(%p)
\n
"
,
t
his
);
TRACE
(
shell
,
"(%p)
\n
"
,
T
his
);
tmpstyle
=
GetWindowLongA
(
t
his
->
hWndList
,
GWL_STYLE
);
SetWindowLongA
(
t
his
->
hWndList
,
GWL_STYLE
,
dwAdd
|
(
tmpstyle
&
~
dwRemove
));
tmpstyle
=
GetWindowLongA
(
T
his
->
hWndList
,
GWL_STYLE
);
SetWindowLongA
(
T
his
->
hWndList
,
GWL_STYLE
,
dwAdd
|
(
tmpstyle
&
~
dwRemove
));
}
static
void
CheckToolbar
(
LPSHELLVIEW
t
his
)
static
void
CheckToolbar
(
IShellViewImpl
*
T
his
)
{
LRESULT
result
;
TRACE
(
shell
,
"
\n
"
);
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_CHECKBUTTON
,
FCIDM_TB_SMALLICON
,
(
t
his
->
FolderSettings
.
ViewMode
==
FVM_LIST
)
?
TRUE
:
FALSE
,
&
result
);
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_CHECKBUTTON
,
FCIDM_TB_REPORTVIEW
,
(
t
his
->
FolderSettings
.
ViewMode
==
FVM_DETAILS
)
?
TRUE
:
FALSE
,
&
result
);
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_ENABLEBUTTON
,
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_CHECKBUTTON
,
FCIDM_TB_SMALLICON
,
(
T
his
->
FolderSettings
.
ViewMode
==
FVM_LIST
)
?
TRUE
:
FALSE
,
&
result
);
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_CHECKBUTTON
,
FCIDM_TB_REPORTVIEW
,
(
T
his
->
FolderSettings
.
ViewMode
==
FVM_DETAILS
)
?
TRUE
:
FALSE
,
&
result
);
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_ENABLEBUTTON
,
FCIDM_TB_SMALLICON
,
TRUE
,
&
result
);
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_ENABLEBUTTON
,
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_ENABLEBUTTON
,
FCIDM_TB_REPORTVIEW
,
TRUE
,
&
result
);
TRACE
(
shell
,
"--
\n
"
);
}
static
void
MergeToolBar
(
LPSHELLVIEW
t
his
)
static
void
MergeToolBar
(
IShellViewImpl
*
T
his
)
{
LRESULT
iStdBMOffset
;
LRESULT
iViewBMOffset
;
TBADDBITMAP
ab
;
...
...
@@ -208,13 +221,13 @@ static void MergeToolBar(LPSHELLVIEW this)
ab
.
hInst
=
HINST_COMMCTRL
;
/* hinstCommctrl */
ab
.
nID
=
IDB_STD_SMALL_COLOR
;
/* std bitmaps */
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_TOOLBAR
,
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_ADDBITMAP
,
8
,
(
LPARAM
)
&
ab
,
&
iStdBMOffset
);
TRACE
(
shell
,
"TB_ADDBITMAP returns %lx
\n
"
,
iStdBMOffset
);
ab
.
nID
=
IDB_VIEW_SMALL_COLOR
;
/* std view bitmaps */
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_TOOLBAR
,
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_TOOLBAR
,
TB_ADDBITMAP
,
8
,
(
LPARAM
)
&
ab
,
&
iViewBMOffset
);
TRACE
(
shell
,
"TB_ADDBITMAP returns %lx
\n
"
,
iViewBMOffset
);
...
...
@@ -231,9 +244,9 @@ static void MergeToolBar(LPSHELLVIEW this)
}
}
IShellBrowser_SetToolbarItems
(
t
his
->
pShellBrowser
,
tbActual
,
6
,
FCT_MERGE
);
IShellBrowser_SetToolbarItems
(
T
his
->
pShellBrowser
,
tbActual
,
6
,
FCT_MERGE
);
CheckToolbar
(
t
his
);
CheckToolbar
(
T
his
);
TRACE
(
shell
,
"--
\n
"
);
}
...
...
@@ -243,35 +256,35 @@ static void MergeToolBar(LPSHELLVIEW this)
*
*/
BOOL
ShellView_CreateList
(
LPSHELLVIEW
t
his
)
BOOL
ShellView_CreateList
(
IShellViewImpl
*
T
his
)
{
DWORD
dwStyle
;
TRACE
(
shell
,
"%p
\n
"
,
t
his
);
TRACE
(
shell
,
"%p
\n
"
,
T
his
);
dwStyle
=
WS_TABSTOP
|
WS_VISIBLE
|
WS_CHILD
|
WS_BORDER
|
LVS_SHAREIMAGELISTS
|
LVS_EDITLABELS
|
LVS_ALIGNLEFT
;
switch
(
t
his
->
FolderSettings
.
ViewMode
)
switch
(
T
his
->
FolderSettings
.
ViewMode
)
{
case
FVM_ICON
:
dwStyle
|=
LVS_ICON
;
break
;
case
FVM_DETAILS
:
dwStyle
|=
LVS_REPORT
;
break
;
case
FVM_SMALLICON
:
dwStyle
|=
LVS_SMALLICON
;
break
;
case
FVM_LIST
:
dwStyle
|=
LVS_LIST
;
break
;
default:
dwStyle
|=
LVS_LIST
;
break
;
}
if
(
t
his
->
FolderSettings
.
fFlags
&&
FWF_AUTOARRANGE
)
dwStyle
|=
LVS_AUTOARRANGE
;
/*if (
t
his->FolderSettings.fFlags && FWF_DESKTOP); used from explorer*/
if
(
t
his
->
FolderSettings
.
fFlags
&&
FWF_SINGLESEL
)
dwStyle
|=
LVS_SINGLESEL
;
if
(
T
his
->
FolderSettings
.
fFlags
&&
FWF_AUTOARRANGE
)
dwStyle
|=
LVS_AUTOARRANGE
;
/*if (
T
his->FolderSettings.fFlags && FWF_DESKTOP); used from explorer*/
if
(
T
his
->
FolderSettings
.
fFlags
&&
FWF_SINGLESEL
)
dwStyle
|=
LVS_SINGLESEL
;
t
his
->
hWndList
=
CreateWindowExA
(
WS_EX_CLIENTEDGE
,
T
his
->
hWndList
=
CreateWindowExA
(
WS_EX_CLIENTEDGE
,
WC_LISTVIEWA
,
NULL
,
dwStyle
,
0
,
0
,
0
,
0
,
t
his
->
hWnd
,
T
his
->
hWnd
,
(
HMENU
)
ID_LISTVIEW
,
shell32_hInstance
,
NULL
);
if
(
!
t
his
->
hWndList
)
if
(
!
T
his
->
hWndList
)
return
FALSE
;
/* UpdateShellSettings(); */
...
...
@@ -288,13 +301,13 @@ int nColumn2=80;
int
nColumn3
=
170
;
int
nColumn4
=
60
;
BOOL
ShellView_InitList
(
LPSHELLVIEW
t
his
)
BOOL
ShellView_InitList
(
IShellViewImpl
*
T
his
)
{
LVCOLUMNA
lvColumn
;
CHAR
szString
[
50
];
TRACE
(
shell
,
"%p
\n
"
,
t
his
);
TRACE
(
shell
,
"%p
\n
"
,
T
his
);
ListView_DeleteAllItems
(
t
his
->
hWndList
);
ListView_DeleteAllItems
(
T
his
->
hWndList
);
/*initialize the columns */
lvColumn
.
mask
=
LVCF_FMT
|
LVCF_WIDTH
|
LVCF_TEXT
;
/* | LVCF_SUBITEM;*/
...
...
@@ -304,22 +317,22 @@ BOOL ShellView_InitList(LPSHELLVIEW this)
lvColumn
.
cx
=
nColumn1
;
strcpy
(
szString
,
"File"
);
/*LoadStringA(shell32_hInstance, IDS_COLUMN1, szString, sizeof(szString));*/
ListView_InsertColumnA
(
t
his
->
hWndList
,
0
,
&
lvColumn
);
ListView_InsertColumnA
(
T
his
->
hWndList
,
0
,
&
lvColumn
);
lvColumn
.
cx
=
nColumn2
;
strcpy
(
szString
,
"Size"
);
ListView_InsertColumnA
(
t
his
->
hWndList
,
1
,
&
lvColumn
);
ListView_InsertColumnA
(
T
his
->
hWndList
,
1
,
&
lvColumn
);
lvColumn
.
cx
=
nColumn3
;
strcpy
(
szString
,
"Type"
);
ListView_InsertColumnA
(
t
his
->
hWndList
,
2
,
&
lvColumn
);
ListView_InsertColumnA
(
T
his
->
hWndList
,
2
,
&
lvColumn
);
lvColumn
.
cx
=
nColumn4
;
strcpy
(
szString
,
"Modified"
);
ListView_InsertColumnA
(
t
his
->
hWndList
,
3
,
&
lvColumn
);
ListView_InsertColumnA
(
T
his
->
hWndList
,
3
,
&
lvColumn
);
ListView_SetImageList
(
t
his
->
hWndList
,
ShellSmallIconList
,
LVSIL_SMALL
);
ListView_SetImageList
(
t
his
->
hWndList
,
ShellBigIconList
,
LVSIL_NORMAL
);
ListView_SetImageList
(
T
his
->
hWndList
,
ShellSmallIconList
,
LVSIL_SMALL
);
ListView_SetImageList
(
T
his
->
hWndList
,
ShellBigIconList
,
LVSIL_NORMAL
);
return
TRUE
;
}
...
...
@@ -348,7 +361,7 @@ INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpDat
* internal
*/
static
HRESULT
ShellView_FillList
(
LPSHELLVIEW
t
his
)
static
HRESULT
ShellView_FillList
(
IShellViewImpl
*
T
his
)
{
LPENUMIDLIST
pEnumIDList
;
LPITEMIDLIST
pidl
;
DWORD
dwFetched
;
...
...
@@ -357,56 +370,56 @@ static HRESULT ShellView_FillList(LPSHELLVIEW this)
HRESULT
hRes
;
HDPA
hdpa
;
TRACE
(
shell
,
"%p
\n
"
,
t
his
);
TRACE
(
shell
,
"%p
\n
"
,
T
his
);
/* get the itemlist from the shfolder*/
hRes
=
this
->
pSFParent
->
lpvtbl
->
fnEnumObjects
(
this
->
pSFParent
,
t
his
->
hWnd
,
SHCONTF_NONFOLDERS
|
SHCONTF_FOLDERS
,
&
pEnumIDList
);
if
(
hRes
!=
S_OK
)
{
if
(
hRes
==
S_FALSE
)
hRes
=
IShellFolder_EnumObjects
(
This
->
pSFParent
,
T
his
->
hWnd
,
SHCONTF_NONFOLDERS
|
SHCONTF_FOLDERS
,
&
pEnumIDList
);
if
(
hRes
!=
S_OK
)
{
if
(
hRes
==
S_FALSE
)
return
(
NOERROR
);
return
(
hRes
);
}
}
/* create a pointer array */
hdpa
=
pDPA_Create
(
16
);
hdpa
=
pDPA_Create
(
16
);
if
(
!
hdpa
)
{
return
(
E_OUTOFMEMORY
);
}
/* copy the items into the array*/
while
((
S_OK
==
pEnumIDList
->
lpvtbl
->
fn
Next
(
pEnumIDList
,
1
,
&
pidl
,
&
dwFetched
))
&&
dwFetched
)
while
((
S_OK
==
IEnumIDList_
Next
(
pEnumIDList
,
1
,
&
pidl
,
&
dwFetched
))
&&
dwFetched
)
{
if
(
pDPA_InsertPtr
(
hdpa
,
0x7fff
,
pidl
)
==
-
1
)
{
SHFree
(
pidl
);
}
}
}
/*sort the array*/
pDPA_Sort
(
hdpa
,
ShellView_CompareItems
,
(
LPARAM
)
t
his
->
pSFParent
);
pDPA_Sort
(
hdpa
,
ShellView_CompareItems
,
(
LPARAM
)
T
his
->
pSFParent
);
/*turn the listview's redrawing off*/
SendMessageA
(
t
his
->
hWndList
,
WM_SETREDRAW
,
FALSE
,
0
);
SendMessageA
(
T
his
->
hWndList
,
WM_SETREDRAW
,
FALSE
,
0
);
for
(
i
=
0
;
i
<
DPA_GetPtrCount
(
hdpa
);
++
i
)
/* DPA_GetPtrCount is a macro*/
{
pidl
=
(
LPITEMIDLIST
)
DPA_GetPtr
(
hdpa
,
i
);
if
(
IncludeObject
(
this
,
pidl
)
==
S_OK
)
/* in a commdlg t
his works as a filemask*/
for
(
i
=
0
;
i
<
DPA_GetPtrCount
(
hdpa
);
++
i
)
/* DPA_GetPtrCount is a macro*/
{
pidl
=
(
LPITEMIDLIST
)
DPA_GetPtr
(
hdpa
,
i
);
if
(
IncludeObject
(
This
,
pidl
)
==
S_OK
)
/* in a commdlg T
his works as a filemask*/
{
ZeroMemory
(
&
lvItem
,
sizeof
(
lvItem
));
/* create the listviewitem*/
lvItem
.
mask
=
LVIF_TEXT
|
LVIF_IMAGE
|
LVIF_PARAM
;
/*set the mask*/
lvItem
.
iItem
=
ListView_GetItemCount
(
t
his
->
hWndList
);
/*add the item to the end of the list*/
lvItem
.
iItem
=
ListView_GetItemCount
(
T
his
->
hWndList
);
/*add the item to the end of the list*/
lvItem
.
lParam
=
(
LPARAM
)
pidl
;
/*set the item's data*/
lvItem
.
pszText
=
LPSTR_TEXTCALLBACKA
;
/*get text on a callback basis*/
lvItem
.
iImage
=
I_IMAGECALLBACK
;
/*get the image on a callback basis*/
ListView_InsertItemA
(
t
his
->
hWndList
,
&
lvItem
);
ListView_InsertItemA
(
T
his
->
hWndList
,
&
lvItem
);
}
else
SHFree
(
pidl
);
/* the listview has the COPY*/
}
}
/*turn the listview's redrawing back on and force it to draw*/
SendMessageA
(
t
his
->
hWndList
,
WM_SETREDRAW
,
TRUE
,
0
);
InvalidateRect
(
t
his
->
hWndList
,
NULL
,
TRUE
);
UpdateWindow
(
t
his
->
hWndList
);
SendMessageA
(
T
his
->
hWndList
,
WM_SETREDRAW
,
TRUE
,
0
);
InvalidateRect
(
T
his
->
hWndList
,
NULL
,
TRUE
);
UpdateWindow
(
T
his
->
hWndList
);
pEnumIDList
->
lpvtbl
->
fn
Release
(
pEnumIDList
);
/* destroy the list*/
IEnumIDList_
Release
(
pEnumIDList
);
/* destroy the list*/
pDPA_Destroy
(
hdpa
);
return
S_OK
;
...
...
@@ -418,12 +431,12 @@ static HRESULT ShellView_FillList(LPSHELLVIEW this)
* NOTES
* internal
*/
LRESULT
ShellView_OnCreate
(
LPSHELLVIEW
t
his
)
{
TRACE
(
shell
,
"%p
\n
"
,
t
his
);
LRESULT
ShellView_OnCreate
(
IShellViewImpl
*
T
his
)
{
TRACE
(
shell
,
"%p
\n
"
,
T
his
);
if
(
ShellView_CreateList
(
t
his
))
{
if
(
ShellView_InitList
(
t
his
))
{
ShellView_FillList
(
t
his
);
if
(
ShellView_CreateList
(
T
his
))
{
if
(
ShellView_InitList
(
T
his
))
{
ShellView_FillList
(
T
his
);
}
}
...
...
@@ -432,12 +445,12 @@ LRESULT ShellView_OnCreate(LPSHELLVIEW this)
/**************************************************************************
* ShellView_OnSize()
*/
LRESULT
ShellView_OnSize
(
LPSHELLVIEW
t
his
,
WORD
wWidth
,
WORD
wHeight
)
{
TRACE
(
shell
,
"%p width=%u height=%u
\n
"
,
t
his
,
wWidth
,
wHeight
);
LRESULT
ShellView_OnSize
(
IShellViewImpl
*
T
his
,
WORD
wWidth
,
WORD
wHeight
)
{
TRACE
(
shell
,
"%p width=%u height=%u
\n
"
,
T
his
,
wWidth
,
wHeight
);
/*resize the ListView to fit our window*/
if
(
t
his
->
hWndList
)
{
MoveWindow
(
t
his
->
hWndList
,
0
,
0
,
wWidth
,
wHeight
,
TRUE
);
if
(
T
his
->
hWndList
)
{
MoveWindow
(
T
his
->
hWndList
,
0
,
0
,
wWidth
,
wHeight
,
TRUE
);
}
return
S_OK
;
...
...
@@ -445,13 +458,13 @@ LRESULT ShellView_OnSize(LPSHELLVIEW this, WORD wWidth, WORD wHeight)
/**************************************************************************
* ShellView_BuildFileMenu()
*/
HMENU
ShellView_BuildFileMenu
(
LPSHELLVIEW
t
his
)
HMENU
ShellView_BuildFileMenu
(
IShellViewImpl
*
T
his
)
{
CHAR
szText
[
MAX_PATH
];
MENUITEMINFOA
mii
;
int
nTools
,
i
;
HMENU
hSubMenu
;
TRACE
(
shell
,
"(%p) semi-stub
\n
"
,
t
his
);
TRACE
(
shell
,
"(%p) semi-stub
\n
"
,
T
his
);
hSubMenu
=
CreatePopupMenu
();
if
(
hSubMenu
)
...
...
@@ -475,7 +488,7 @@ HMENU ShellView_BuildFileMenu(LPSHELLVIEW this)
else
{
mii
.
fType
=
MFT_SEPARATOR
;
}
/* tack
t
his item onto the end of the menu */
/* tack
T
his item onto the end of the menu */
InsertMenuItemA
(
hSubMenu
,
(
UINT
)
-
1
,
TRUE
,
&
mii
);
}
}
...
...
@@ -485,11 +498,11 @@ HMENU ShellView_BuildFileMenu(LPSHELLVIEW this)
/**************************************************************************
* ShellView_MergeFileMenu()
*/
void
ShellView_MergeFileMenu
(
LPSHELLVIEW
t
his
,
HMENU
hSubMenu
)
{
TRACE
(
shell
,
"(%p)->(submenu=0x%08x) stub
\n
"
,
t
his
,
hSubMenu
);
void
ShellView_MergeFileMenu
(
IShellViewImpl
*
T
his
,
HMENU
hSubMenu
)
{
TRACE
(
shell
,
"(%p)->(submenu=0x%08x) stub
\n
"
,
T
his
,
hSubMenu
);
if
(
hSubMenu
)
{
/*insert
t
his item at the beginning of the menu */
{
/*insert
T
his item at the beginning of the menu */
_InsertMenuItem
(
hSubMenu
,
0
,
TRUE
,
0
,
MFT_SEPARATOR
,
NULL
,
MFS_ENABLED
);
_InsertMenuItem
(
hSubMenu
,
0
,
TRUE
,
IDM_MYFILEITEM
,
MFT_STRING
,
"dummy45"
,
MFS_ENABLED
);
...
...
@@ -501,10 +514,10 @@ void ShellView_MergeFileMenu(LPSHELLVIEW this, HMENU hSubMenu)
* ShellView_MergeViewMenu()
*/
void
ShellView_MergeViewMenu
(
LPSHELLVIEW
t
his
,
HMENU
hSubMenu
)
void
ShellView_MergeViewMenu
(
IShellViewImpl
*
T
his
,
HMENU
hSubMenu
)
{
MENUITEMINFOA
mii
;
TRACE
(
shell
,
"(%p)->(submenu=0x%08x)
\n
"
,
t
his
,
hSubMenu
);
TRACE
(
shell
,
"(%p)->(submenu=0x%08x)
\n
"
,
T
his
,
hSubMenu
);
if
(
hSubMenu
)
{
/*add a separator at the correct position in the menu*/
...
...
@@ -513,20 +526,45 @@ void ShellView_MergeViewMenu(LPSHELLVIEW this, HMENU hSubMenu)
ZeroMemory
(
&
mii
,
sizeof
(
mii
));
mii
.
cbSize
=
sizeof
(
mii
);
mii
.
fMask
=
MIIM_SUBMENU
|
MIIM_TYPE
|
MIIM_DATA
;;
mii
.
fType
=
MFT_STRING
;
mii
.
dwTypeData
=
"View"
;
mii
.
fType
=
MFT_STRING
;
mii
.
dwTypeData
=
"View"
;
mii
.
hSubMenu
=
LoadMenuIndirectA
(
&
_Resource_Men_MENU_001_0_data
);
InsertMenuItemA
(
hSubMenu
,
FCIDM_MENU_VIEW_SEP_OPTIONS
,
FALSE
,
&
mii
);
}
}
/**************************************************************************
* ShellView_CanDoIDockingWindow()
*/
BOOL
ShellView_CanDoIDockingWindow
(
IShellViewImpl
*
This
)
{
BOOL
bReturn
=
FALSE
;
HRESULT
hr
;
LPSERVICEPROVIDER
pSP
;
LPDOCKINGWINDOWFRAME
pFrame
;
FIXME
(
shell
,
"(%p) stub
\n
"
,
This
);
/*get the browser's IServiceProvider*/
hr
=
IShellBrowser_QueryInterface
(
This
->
pShellBrowser
,
(
REFIID
)
&
IID_IServiceProvider
,
(
LPVOID
*
)
&
pSP
);
if
(
hr
==
S_OK
)
{
hr
=
IServiceProvider_QueryService
(
pSP
,
(
REFGUID
)
&
SID_SShellBrowser
,
(
REFIID
)
&
IID_IDockingWindowFrame
,
(
LPVOID
*
)
&
pFrame
);
if
(
SUCCEEDED
(
hr
))
{
bReturn
=
TRUE
;
pFrame
->
lpvtbl
->
fnRelease
(
pFrame
);
}
IServiceProvider_Release
(
pSP
);
}
return
bReturn
;
}
/**************************************************************************
* ShellView_UpdateMenu()
*/
LRESULT
ShellView_UpdateMenu
(
LPSHELLVIEW
t
his
,
HMENU
hMenu
)
{
TRACE
(
shell
,
"(%p)->(menu=0x%08x)
\n
"
,
t
his
,
hMenu
);
LRESULT
ShellView_UpdateMenu
(
IShellViewImpl
*
T
his
,
HMENU
hMenu
)
{
TRACE
(
shell
,
"(%p)->(menu=0x%08x)
\n
"
,
T
his
,
hMenu
);
CheckMenuItem
(
hMenu
,
IDM_VIEW_FILES
,
MF_BYCOMMAND
|
(
g_bViewKeys
?
MF_CHECKED
:
MF_UNCHECKED
));
if
(
ShellView_CanDoIDockingWindow
(
t
his
))
if
(
ShellView_CanDoIDockingWindow
(
T
his
))
{
EnableMenuItem
(
hMenu
,
IDM_VIEW_IDW
,
MF_BYCOMMAND
|
MF_ENABLED
);
CheckMenuItem
(
hMenu
,
IDM_VIEW_IDW
,
MF_BYCOMMAND
|
(
g_bShowIDW
?
MF_CHECKED
:
MF_UNCHECKED
));
}
...
...
@@ -543,44 +581,44 @@ LRESULT ShellView_UpdateMenu(LPSHELLVIEW this, HMENU hMenu)
* NOTES
* internal
*/
void
ShellView_OnDeactivate
(
LPSHELLVIEW
t
his
)
{
TRACE
(
shell
,
"%p
\n
"
,
t
his
);
if
(
t
his
->
uState
!=
SVUIA_DEACTIVATE
)
{
if
(
t
his
->
hMenu
)
{
IShellBrowser_SetMenuSB
(
t
his
->
pShellBrowser
,
0
,
0
,
0
);
IShellBrowser_RemoveMenusSB
(
this
->
pShellBrowser
,
t
his
->
hMenu
);
DestroyMenu
(
t
his
->
hMenu
);
t
his
->
hMenu
=
0
;
void
ShellView_OnDeactivate
(
IShellViewImpl
*
T
his
)
{
TRACE
(
shell
,
"%p
\n
"
,
T
his
);
if
(
T
his
->
uState
!=
SVUIA_DEACTIVATE
)
{
if
(
T
his
->
hMenu
)
{
IShellBrowser_SetMenuSB
(
T
his
->
pShellBrowser
,
0
,
0
,
0
);
IShellBrowser_RemoveMenusSB
(
This
->
pShellBrowser
,
T
his
->
hMenu
);
DestroyMenu
(
T
his
->
hMenu
);
T
his
->
hMenu
=
0
;
}
t
his
->
uState
=
SVUIA_DEACTIVATE
;
T
his
->
uState
=
SVUIA_DEACTIVATE
;
}
}
/**************************************************************************
* ShellView_OnActivate()
*/
LRESULT
ShellView_OnActivate
(
LPSHELLVIEW
t
his
,
UINT
uState
)
LRESULT
ShellView_OnActivate
(
IShellViewImpl
*
T
his
,
UINT
uState
)
{
OLEMENUGROUPWIDTHS
omw
=
{
{
0
,
0
,
0
,
0
,
0
,
0
}
};
MENUITEMINFOA
mii
;
CHAR
szText
[
MAX_PATH
];
TRACE
(
shell
,
"%p uState=%x
\n
"
,
t
his
,
uState
);
TRACE
(
shell
,
"%p uState=%x
\n
"
,
T
his
,
uState
);
/*don't do anything if the state isn't really changing */
if
(
t
his
->
uState
==
uState
)
if
(
T
his
->
uState
==
uState
)
{
return
S_OK
;
}
ShellView_OnDeactivate
(
t
his
);
ShellView_OnDeactivate
(
T
his
);
/*only do
t
his if we are active */
/*only do
T
his if we are active */
if
(
uState
!=
SVUIA_DEACTIVATE
)
{
/*merge the menus */
t
his
->
hMenu
=
CreateMenu
();
T
his
->
hMenu
=
CreateMenu
();
if
(
t
his
->
hMenu
)
{
IShellBrowser_InsertMenusSB
(
this
->
pShellBrowser
,
t
his
->
hMenu
,
&
omw
);
if
(
T
his
->
hMenu
)
{
IShellBrowser_InsertMenusSB
(
This
->
pShellBrowser
,
T
his
->
hMenu
,
&
omw
);
TRACE
(
shell
,
"-- after fnInsertMenusSB
\n
"
);
/*build the top level menu get the menu item's text*/
strcpy
(
szText
,
"dummy 31"
);
...
...
@@ -591,11 +629,11 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState)
mii
.
fType
=
MFT_STRING
;
mii
.
fState
=
MFS_ENABLED
;
mii
.
dwTypeData
=
szText
;
mii
.
hSubMenu
=
ShellView_BuildFileMenu
(
t
his
);
mii
.
hSubMenu
=
ShellView_BuildFileMenu
(
T
his
);
/*insert our menu into the menu bar*/
if
(
mii
.
hSubMenu
)
{
InsertMenuItemA
(
t
his
->
hMenu
,
FCIDM_MENU_HELP
,
FALSE
,
&
mii
);
{
InsertMenuItemA
(
T
his
->
hMenu
,
FCIDM_MENU_HELP
,
FALSE
,
&
mii
);
}
/*get the view menu so we can merge with it*/
...
...
@@ -603,8 +641,8 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState)
mii
.
cbSize
=
sizeof
(
mii
);
mii
.
fMask
=
MIIM_SUBMENU
;
if
(
GetMenuItemInfoA
(
t
his
->
hMenu
,
FCIDM_MENU_VIEW
,
FALSE
,
&
mii
))
{
ShellView_MergeViewMenu
(
t
his
,
mii
.
hSubMenu
);
if
(
GetMenuItemInfoA
(
T
his
->
hMenu
,
FCIDM_MENU_VIEW
,
FALSE
,
&
mii
))
{
ShellView_MergeViewMenu
(
T
his
,
mii
.
hSubMenu
);
}
/*add the items that should only be added if we have the focus*/
...
...
@@ -614,15 +652,15 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState)
mii
.
cbSize
=
sizeof
(
mii
);
mii
.
fMask
=
MIIM_SUBMENU
;
if
(
GetMenuItemInfoA
(
t
his
->
hMenu
,
FCIDM_MENU_FILE
,
FALSE
,
&
mii
))
{
ShellView_MergeFileMenu
(
t
his
,
mii
.
hSubMenu
);
if
(
GetMenuItemInfoA
(
T
his
->
hMenu
,
FCIDM_MENU_FILE
,
FALSE
,
&
mii
))
{
ShellView_MergeFileMenu
(
T
his
,
mii
.
hSubMenu
);
}
}
TRACE
(
shell
,
"-- before fnSetMenuSB
\n
"
);
IShellBrowser_SetMenuSB
(
this
->
pShellBrowser
,
this
->
hMenu
,
0
,
t
his
->
hWnd
);
IShellBrowser_SetMenuSB
(
This
->
pShellBrowser
,
This
->
hMenu
,
0
,
T
his
->
hWnd
);
}
}
t
his
->
uState
=
uState
;
T
his
->
uState
=
uState
;
TRACE
(
shell
,
"--
\n
"
);
return
S_OK
;
}
...
...
@@ -633,13 +671,13 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState)
* NOTES
* internal
*/
LRESULT
ShellView_OnSetFocus
(
LPSHELLVIEW
t
his
)
{
TRACE
(
shell
,
"%p
\n
"
,
t
his
);
LRESULT
ShellView_OnSetFocus
(
IShellViewImpl
*
T
his
)
{
TRACE
(
shell
,
"%p
\n
"
,
T
his
);
/* Tell the browser one of our windows has received the focus. This should always
be done before merging menus (OnActivate merges the menus) if one of our
windows has the focus.*/
IShellBrowser_OnViewWindowActive
(
this
->
pShellBrowser
,
t
his
);
ShellView_OnActivate
(
t
his
,
SVUIA_ACTIVATE_FOCUS
);
IShellBrowser_OnViewWindowActive
(
This
->
pShellBrowser
,(
IShellView
*
)
T
his
);
ShellView_OnActivate
(
T
his
,
SVUIA_ACTIVATE_FOCUS
);
return
0
;
}
...
...
@@ -647,25 +685,25 @@ LRESULT ShellView_OnSetFocus(LPSHELLVIEW this)
/**************************************************************************
* ShellView_OnKillFocus()
*/
LRESULT
ShellView_OnKillFocus
(
LPSHELLVIEW
t
his
)
{
TRACE
(
shell
,
"(%p) stub
\n
"
,
t
his
);
ShellView_OnActivate
(
t
his
,
SVUIA_ACTIVATE_NOFOCUS
);
LRESULT
ShellView_OnKillFocus
(
IShellViewImpl
*
T
his
)
{
TRACE
(
shell
,
"(%p) stub
\n
"
,
T
his
);
ShellView_OnActivate
(
T
his
,
SVUIA_ACTIVATE_NOFOCUS
);
return
0
;
}
/**************************************************************************
* ShellView_AddRemoveDockingWindow()
*/
BOOL
ShellView_AddRemoveDockingWindow
(
LPSHELLVIEW
t
his
,
BOOL
bAdd
)
BOOL
ShellView_AddRemoveDockingWindow
(
IShellViewImpl
*
T
his
,
BOOL
bAdd
)
{
BOOL
bReturn
=
FALSE
;
HRESULT
hr
;
LPSERVICEPROVIDER
pSP
;
LPDOCKINGWINDOWFRAME
pFrame
;
WARN
(
shell
,
"(%p)->(badd=0x%08x) semi-stub
\n
"
,
t
his
,
bAdd
);
WARN
(
shell
,
"(%p)->(badd=0x%08x) semi-stub
\n
"
,
T
his
,
bAdd
);
/* get the browser's IServiceProvider */
hr
=
IShellBrowser_QueryInterface
(
t
his
->
pShellBrowser
,
(
REFIID
)
&
IID_IServiceProvider
,
(
LPVOID
*
)
&
pSP
);
hr
=
IShellBrowser_QueryInterface
(
T
his
->
pShellBrowser
,
(
REFIID
)
&
IID_IServiceProvider
,
(
LPVOID
*
)
&
pSP
);
if
(
SUCCEEDED
(
hr
))
{
/*get the IDockingWindowFrame pointer*/
hr
=
IServiceProvider_QueryService
(
pSP
,
(
REFGUID
)
&
SID_SShellBrowser
,
(
REFIID
)
&
IID_IDockingWindowFrame
,
(
LPVOID
*
)
&
pFrame
);
...
...
@@ -674,14 +712,14 @@ BOOL ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL bAdd)
{
hr
=
S_OK
;
FIXME
(
shell
,
"no docking implemented
\n
"
);
#if 0
if(!
t
his->pDockingWindow)
if(!
T
his->pDockingWindow)
{ /* create the toolbar object */
this->pDockingWindow = DockingWindow_Constructor(this, t
his->hWnd);
This->pDockingWindow = DockingWindow_Constructor(This, T
his->hWnd);
}
if(
t
his->pDockingWindow)
if(
T
his->pDockingWindow)
{ /*add the toolbar object */
hr = pFrame->lpvtbl->fnAddToolbar(pFrame, (IDockingWindow*)
t
his->pDockingWindow, TOOLBAR_ID, 0);
hr = pFrame->lpvtbl->fnAddToolbar(pFrame, (IDockingWindow*)
T
his->pDockingWindow, TOOLBAR_ID, 0);
if(SUCCEEDED(hr))
{ bReturn = TRUE;
...
...
@@ -692,15 +730,15 @@ BOOL ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL bAdd)
else
{
FIXME
(
shell
,
"no docking implemented
\n
"
);
#if 0
if(
t
his->pDockingWindow)
{ hr = pFrame->lpvtbl->fnRemoveToolbar(pFrame, (IDockingWindow*)
t
his->pDockingWindow, DWFRF_NORMAL);
if(
T
his->pDockingWindow)
{ hr = pFrame->lpvtbl->fnRemoveToolbar(pFrame, (IDockingWindow*)
T
his->pDockingWindow, DWFRF_NORMAL);
if(SUCCEEDED(hr))
{ /* RemoveToolbar should release the toolbar object which will cause */
/*it to destroy itself. Our toolbar object is no longer valid at */
/*
t
his point. */
/*
T
his point. */
t
his->pDockingWindow = NULL;
T
his->pDockingWindow = NULL;
bReturn = TRUE;
}
}
...
...
@@ -714,34 +752,10 @@ BOOL ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL bAdd)
}
/**************************************************************************
* ShellView_CanDoIDockingWindow()
*/
BOOL
ShellView_CanDoIDockingWindow
(
LPSHELLVIEW
this
)
{
BOOL
bReturn
=
FALSE
;
HRESULT
hr
;
LPSERVICEPROVIDER
pSP
;
LPDOCKINGWINDOWFRAME
pFrame
;
FIXME
(
shell
,
"(%p) stub
\n
"
,
this
);
/*get the browser's IServiceProvider*/
hr
=
IShellBrowser_QueryInterface
(
this
->
pShellBrowser
,
(
REFIID
)
&
IID_IServiceProvider
,
(
LPVOID
*
)
&
pSP
);
if
(
hr
==
S_OK
)
{
hr
=
IServiceProvider_QueryService
(
pSP
,
(
REFGUID
)
&
SID_SShellBrowser
,
(
REFIID
)
&
IID_IDockingWindowFrame
,
(
LPVOID
*
)
&
pFrame
);
if
(
SUCCEEDED
(
hr
))
{
bReturn
=
TRUE
;
pFrame
->
lpvtbl
->
fnRelease
(
pFrame
);
}
IServiceProvider_Release
(
pSP
);
}
return
bReturn
;
}
/**************************************************************************
* ShellView_UpdateShellSettings()
*/
void
ShellView_UpdateShellSettings
(
LPSHELLVIEW
t
his
)
{
FIXME
(
shell
,
"(%p) stub
\n
"
,
t
his
);
void
ShellView_UpdateShellSettings
(
IShellViewImpl
*
T
his
)
{
FIXME
(
shell
,
"(%p) stub
\n
"
,
T
his
);
return
;
/*
SHELLFLAGSTATE sfs;
...
...
@@ -774,17 +788,17 @@ void ShellView_UpdateShellSettings(LPSHELLVIEW this)
if(!sfs.fWin95Classic && !sfs.fDoubleClickInWebView)
dwExStyles |= LVS_EX_ONECLICKACTIVATE | LVS_EX_TRACKSELECT | LVS_EX_UNDERLINEHOT;
ListView_SetExtendedListViewStyle(
t
his->hWndList, dwExStyles);
ListView_SetExtendedListViewStyle(
T
his->hWndList, dwExStyles);
*/
}
/**************************************************************************
* ShellView_OnSettingChange()
*/
LRESULT
ShellView_OnSettingChange
(
LPSHELLVIEW
t
his
,
LPCSTR
lpszSection
)
{
TRACE
(
shell
,
"(%p) stub
\n
"
,
t
his
);
LRESULT
ShellView_OnSettingChange
(
IShellViewImpl
*
T
his
,
LPCSTR
lpszSection
)
{
TRACE
(
shell
,
"(%p) stub
\n
"
,
T
his
);
/*if(0 == lstrcmpi(lpszSection, "ShellState"))*/
{
ShellView_UpdateShellSettings
(
t
his
);
{
ShellView_UpdateShellSettings
(
T
his
);
return
0
;
}
return
0
;
...
...
@@ -792,17 +806,17 @@ LRESULT ShellView_OnSettingChange(LPSHELLVIEW this, LPCSTR lpszSection)
/**************************************************************************
* ShellView_OnCommand()
*/
LRESULT
ShellView_OnCommand
(
LPSHELLVIEW
t
his
,
DWORD
dwCmdID
,
DWORD
dwCmd
,
HWND
hwndCmd
)
{
TRACE
(
shell
,
"(%p)->(0x%08lx 0x%08lx 0x%08x) stub
\n
"
,
t
his
,
dwCmdID
,
dwCmd
,
hwndCmd
);
LRESULT
ShellView_OnCommand
(
IShellViewImpl
*
T
his
,
DWORD
dwCmdID
,
DWORD
dwCmd
,
HWND
hwndCmd
)
{
TRACE
(
shell
,
"(%p)->(0x%08lx 0x%08lx 0x%08x) stub
\n
"
,
T
his
,
dwCmdID
,
dwCmd
,
hwndCmd
);
switch
(
dwCmdID
)
{
case
IDM_VIEW_FILES
:
g_bViewKeys
=
!
g_bViewKeys
;
IShellView_Refresh
(
t
his
);
IShellView_Refresh
(
(
IShellView
*
)
T
his
);
break
;
case
IDM_VIEW_IDW
:
g_bShowIDW
=
!
g_bShowIDW
;
ShellView_AddRemoveDockingWindow
(
t
his
,
g_bShowIDW
);
ShellView_AddRemoveDockingWindow
(
T
his
,
g_bShowIDW
);
break
;
case
IDM_MYFILEITEM
:
...
...
@@ -810,23 +824,23 @@ LRESULT ShellView_OnCommand(LPSHELLVIEW this,DWORD dwCmdID, DWORD dwCmd, HWND hw
break
;
case
FCIDM_SHVIEW_SMALLICON
:
t
his
->
FolderSettings
.
ViewMode
=
FVM_SMALLICON
;
SetStyle
(
t
his
,
LVS_SMALLICON
,
LVS_TYPEMASK
);
T
his
->
FolderSettings
.
ViewMode
=
FVM_SMALLICON
;
SetStyle
(
T
his
,
LVS_SMALLICON
,
LVS_TYPEMASK
);
break
;
case
FCIDM_SHVIEW_BIGICON
:
t
his
->
FolderSettings
.
ViewMode
=
FVM_ICON
;
SetStyle
(
t
his
,
LVS_ICON
,
LVS_TYPEMASK
);
T
his
->
FolderSettings
.
ViewMode
=
FVM_ICON
;
SetStyle
(
T
his
,
LVS_ICON
,
LVS_TYPEMASK
);
break
;
case
FCIDM_SHVIEW_LISTVIEW
:
t
his
->
FolderSettings
.
ViewMode
=
FVM_LIST
;
SetStyle
(
t
his
,
LVS_LIST
,
LVS_TYPEMASK
);
T
his
->
FolderSettings
.
ViewMode
=
FVM_LIST
;
SetStyle
(
T
his
,
LVS_LIST
,
LVS_TYPEMASK
);
break
;
case
FCIDM_SHVIEW_REPORTVIEW
:
t
his
->
FolderSettings
.
ViewMode
=
FVM_DETAILS
;
SetStyle
(
t
his
,
LVS_REPORT
,
LVS_TYPEMASK
);
T
his
->
FolderSettings
.
ViewMode
=
FVM_DETAILS
;
SetStyle
(
T
his
,
LVS_REPORT
,
LVS_TYPEMASK
);
break
;
default:
...
...
@@ -841,22 +855,22 @@ LRESULT ShellView_OnCommand(LPSHELLVIEW this,DWORD dwCmdID, DWORD dwCmd, HWND hw
* RETURNS
* number of selected items
*/
UINT
ShellView_GetSelections
(
LPSHELLVIEW
t
his
)
UINT
ShellView_GetSelections
(
IShellViewImpl
*
T
his
)
{
LVITEMA
lvItem
;
UINT
i
;
if
(
t
his
->
aSelectedItems
)
{
SHFree
(
t
his
->
aSelectedItems
);
if
(
T
his
->
aSelectedItems
)
{
SHFree
(
T
his
->
aSelectedItems
);
}
this
->
uSelected
=
ListView_GetSelectedCount
(
t
his
->
hWndList
);
this
->
aSelectedItems
=
(
LPITEMIDLIST
*
)
SHAlloc
(
t
his
->
uSelected
*
sizeof
(
LPITEMIDLIST
));
This
->
uSelected
=
ListView_GetSelectedCount
(
T
his
->
hWndList
);
This
->
aSelectedItems
=
(
LPITEMIDLIST
*
)
SHAlloc
(
T
his
->
uSelected
*
sizeof
(
LPITEMIDLIST
));
TRACE
(
shell
,
"selected=%i
\n
"
,
t
his
->
uSelected
);
TRACE
(
shell
,
"selected=%i
\n
"
,
T
his
->
uSelected
);
if
(
t
his
->
aSelectedItems
)
{
TRACE
(
shell
,
"-- Items selected =%u
\n
"
,
t
his
->
uSelected
);
if
(
T
his
->
aSelectedItems
)
{
TRACE
(
shell
,
"-- Items selected =%u
\n
"
,
T
his
->
uSelected
);
ZeroMemory
(
&
lvItem
,
sizeof
(
lvItem
));
lvItem
.
mask
=
LVIF_STATE
|
LVIF_PARAM
;
lvItem
.
stateMask
=
LVIS_SELECTED
;
...
...
@@ -864,22 +878,22 @@ UINT ShellView_GetSelections(LPSHELLVIEW this)
i
=
0
;
while
(
ListView_GetItemA
(
this
->
hWndList
,
&
lvItem
)
&&
(
i
<
t
his
->
uSelected
))
while
(
ListView_GetItemA
(
This
->
hWndList
,
&
lvItem
)
&&
(
i
<
T
his
->
uSelected
))
{
if
(
lvItem
.
state
&
LVIS_SELECTED
)
{
t
his
->
aSelectedItems
[
i
]
=
(
LPITEMIDLIST
)
lvItem
.
lParam
;
{
T
his
->
aSelectedItems
[
i
]
=
(
LPITEMIDLIST
)
lvItem
.
lParam
;
i
++
;
TRACE
(
shell
,
"-- selected Item found
\n
"
);
}
lvItem
.
iItem
++
;
}
}
return
t
his
->
uSelected
;
return
T
his
->
uSelected
;
}
/**************************************************************************
* ShellView_DoContextMenu()
*/
void
ShellView_DoContextMenu
(
LPSHELLVIEW
t
his
,
WORD
x
,
WORD
y
,
BOOL
fDefault
)
void
ShellView_DoContextMenu
(
IShellViewImpl
*
T
his
,
WORD
x
,
WORD
y
,
BOOL
fDefault
)
{
UINT
uCommand
;
DWORD
wFlags
;
HMENU
hMenu
;
...
...
@@ -890,12 +904,12 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault)
LPCONTEXTMENU
pContextMenu
=
NULL
;
CMINVOKECOMMANDINFO
cmi
;
TRACE
(
shell
,
"(%p)->(0x%08x 0x%08x 0x%08x) stub
\n
"
,
t
his
,
x
,
y
,
fDefault
);
TRACE
(
shell
,
"(%p)->(0x%08x 0x%08x 0x%08x) stub
\n
"
,
T
his
,
x
,
y
,
fDefault
);
/* look, what's selected and create a context menu object of it*/
if
(
ShellView_GetSelections
(
t
his
))
{
this
->
pSFParent
->
lpvtbl
->
fnGetUIObjectOf
(
this
->
pSFParent
,
this
->
hWndParent
,
t
his
->
uSelected
,
t
his
->
aSelectedItems
,
(
REFIID
)
&
IID_IContextMenu
,
if
(
ShellView_GetSelections
(
T
his
))
{
This
->
pSFParent
->
lpvtbl
->
fnGetUIObjectOf
(
This
->
pSFParent
,
This
->
hWndParent
,
T
his
->
uSelected
,
T
his
->
aSelectedItems
,
(
REFIID
)
&
IID_IContextMenu
,
NULL
,
(
LPVOID
*
)
&
pContextMenu
);
if
(
pContextMenu
)
...
...
@@ -906,12 +920,12 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault)
{
/* See if we are in Explore or Open mode. If the browser's tree
is present, then we are in Explore mode.*/
if
(
SUCCEEDED
(
IShellBrowser_GetControlWindow
(
t
his
->
pShellBrowser
,
FCW_TREE
,
&
hwndTree
))
&&
hwndTree
)
if
(
SUCCEEDED
(
IShellBrowser_GetControlWindow
(
T
his
->
pShellBrowser
,
FCW_TREE
,
&
hwndTree
))
&&
hwndTree
)
{
TRACE
(
shell
,
"-- explore mode
\n
"
);
fExplore
=
TRUE
;
}
wFlags
=
CMF_NORMAL
|
(
t
his
->
uSelected
!=
1
?
0
:
CMF_CANRENAME
)
|
(
fExplore
?
CMF_EXPLORE
:
0
);
wFlags
=
CMF_NORMAL
|
(
T
his
->
uSelected
!=
1
?
0
:
CMF_CANRENAME
)
|
(
fExplore
?
CMF_EXPLORE
:
0
);
if
(
SUCCEEDED
(
pContextMenu
->
lpvtbl
->
fnQueryContextMenu
(
pContextMenu
,
hMenu
,
0
,
MENU_OFFSET
,
MENU_MAX
,
wFlags
)))
{
if
(
fDefault
)
...
...
@@ -932,20 +946,20 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault)
}
else
{
TRACE
(
shell
,
"-- track popup
\n
"
);
uCommand
=
TrackPopupMenu
(
hMenu
,
TPM_LEFTALIGN
|
TPM_RETURNCMD
,
x
,
y
,
0
,
t
his
->
hWnd
,
NULL
);
uCommand
=
TrackPopupMenu
(
hMenu
,
TPM_LEFTALIGN
|
TPM_RETURNCMD
,
x
,
y
,
0
,
T
his
->
hWnd
,
NULL
);
}
if
(
uCommand
>
0
)
{
TRACE
(
shell
,
"-- uCommand=%u
\n
"
,
uCommand
);
if
(
IsInCommDlg
(
t
his
)
&&
(((
uCommand
-
MENU_OFFSET
)
==
IDM_EXPLORE
)
||
((
uCommand
-
MENU_OFFSET
)
==
IDM_OPEN
)))
if
(
IsInCommDlg
(
T
his
)
&&
(((
uCommand
-
MENU_OFFSET
)
==
IDM_EXPLORE
)
||
((
uCommand
-
MENU_OFFSET
)
==
IDM_OPEN
)))
{
TRACE
(
shell
,
"-- dlg: OnDefaultCommand
\n
"
);
OnDefaultCommand
(
t
his
);
OnDefaultCommand
(
T
his
);
}
else
{
TRACE
(
shell
,
"-- explore -- invoke command
\n
"
);
ZeroMemory
(
&
cmi
,
sizeof
(
cmi
));
cmi
.
cbSize
=
sizeof
(
cmi
);
cmi
.
hwnd
=
t
his
->
hWndParent
;
cmi
.
hwnd
=
T
his
->
hWndParent
;
cmi
.
lpVerb
=
(
LPCSTR
)
MAKEINTRESOURCEA
(
uCommand
-
MENU_OFFSET
);
pContextMenu
->
lpvtbl
->
fnInvokeCommand
(
pContextMenu
,
&
cmi
);
}
...
...
@@ -959,8 +973,8 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault)
}
else
/* background context menu */
{
hMenu
=
LoadMenuIndirectA
(
&
_Resource_Men_MENU_002_0_data
);
uCommand
=
TrackPopupMenu
(
GetSubMenu
(
hMenu
,
0
),
TPM_LEFTALIGN
|
TPM_RETURNCMD
,
x
,
y
,
0
,
t
his
->
hWnd
,
NULL
);
ShellView_OnCommand
(
t
his
,
uCommand
,
0
,
0
);
uCommand
=
TrackPopupMenu
(
GetSubMenu
(
hMenu
,
0
),
TPM_LEFTALIGN
|
TPM_RETURNCMD
,
x
,
y
,
0
,
T
his
->
hWnd
,
NULL
);
ShellView_OnCommand
(
T
his
,
uCommand
,
0
,
0
);
DestroyMenu
(
hMenu
);
}
}
...
...
@@ -969,7 +983,7 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault)
* ShellView_OnNotify()
*/
LRESULT
ShellView_OnNotify
(
LPSHELLVIEW
t
his
,
UINT
CtlID
,
LPNMHDR
lpnmh
)
LRESULT
ShellView_OnNotify
(
IShellViewImpl
*
T
his
,
UINT
CtlID
,
LPNMHDR
lpnmh
)
{
NM_LISTVIEW
*
lpnmlv
=
(
NM_LISTVIEW
*
)
lpnmh
;
NMLVDISPINFOA
*
lpdi
=
(
NMLVDISPINFOA
*
)
lpnmh
;
LPITEMIDLIST
pidl
;
...
...
@@ -978,50 +992,50 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh)
UINT
uFlags
;
IExtractIcon
*
pei
;
TRACE
(
shell
,
"%p CtlID=%u lpnmh->code=%x
\n
"
,
t
his
,
CtlID
,
lpnmh
->
code
);
TRACE
(
shell
,
"%p CtlID=%u lpnmh->code=%x
\n
"
,
T
his
,
CtlID
,
lpnmh
->
code
);
switch
(
lpnmh
->
code
)
{
case
NM_SETFOCUS
:
TRACE
(
shell
,
"-- NM_SETFOCUS %p
\n
"
,
t
his
);
ShellView_OnSetFocus
(
t
his
);
TRACE
(
shell
,
"-- NM_SETFOCUS %p
\n
"
,
T
his
);
ShellView_OnSetFocus
(
T
his
);
break
;
case
NM_KILLFOCUS
:
TRACE
(
shell
,
"-- NM_KILLFOCUS %p
\n
"
,
t
his
);
ShellView_OnDeactivate
(
t
his
);
TRACE
(
shell
,
"-- NM_KILLFOCUS %p
\n
"
,
T
his
);
ShellView_OnDeactivate
(
T
his
);
break
;
case
HDN_ENDTRACKA
:
TRACE
(
shell
,
"-- HDN_ENDTRACKA %p
\n
"
,
t
his
);
/*nColumn1 = ListView_GetColumnWidth(
t
his->hWndList, 0);
nColumn2 = ListView_GetColumnWidth(
t
his->hWndList, 1);*/
TRACE
(
shell
,
"-- HDN_ENDTRACKA %p
\n
"
,
T
his
);
/*nColumn1 = ListView_GetColumnWidth(
T
his->hWndList, 0);
nColumn2 = ListView_GetColumnWidth(
T
his->hWndList, 1);*/
break
;
case
LVN_DELETEITEM
:
TRACE
(
shell
,
"-- LVN_DELETEITEM %p
\n
"
,
t
his
);
TRACE
(
shell
,
"-- LVN_DELETEITEM %p
\n
"
,
T
his
);
SHFree
((
LPITEMIDLIST
)
lpnmlv
->
lParam
);
/*delete the pidl because we made a copy of it*/
break
;
case
LVN_ITEMACTIVATE
:
TRACE
(
shell
,
"-- LVN_ITEMACTIVATE %p
\n
"
,
t
his
);
OnStateChange
(
t
his
,
CDBOSC_SELCHANGE
);
/* the browser will get the IDataObject now */
ShellView_DoContextMenu
(
t
his
,
0
,
0
,
TRUE
);
TRACE
(
shell
,
"-- LVN_ITEMACTIVATE %p
\n
"
,
T
his
);
OnStateChange
(
T
his
,
CDBOSC_SELCHANGE
);
/* the browser will get the IDataObject now */
ShellView_DoContextMenu
(
T
his
,
0
,
0
,
TRUE
);
break
;
case
NM_RCLICK
:
TRACE
(
shell
,
"-- NM_RCLICK %p
\n
"
,
t
his
);
TRACE
(
shell
,
"-- NM_RCLICK %p
\n
"
,
T
his
);
dwCursor
=
GetMessagePos
();
ShellView_DoContextMenu
(
t
his
,
LOWORD
(
dwCursor
),
HIWORD
(
dwCursor
),
FALSE
);
ShellView_DoContextMenu
(
T
his
,
LOWORD
(
dwCursor
),
HIWORD
(
dwCursor
),
FALSE
);
break
;
case
LVN_GETDISPINFOA
:
TRACE
(
shell
,
"-- LVN_GETDISPINFOA %p
\n
"
,
t
his
);
TRACE
(
shell
,
"-- LVN_GETDISPINFOA %p
\n
"
,
T
his
);
pidl
=
(
LPITEMIDLIST
)
lpdi
->
item
.
lParam
;
if
(
lpdi
->
item
.
iSubItem
)
/*is the sub-item information being requested?*/
{
if
(
lpdi
->
item
.
mask
&
LVIF_TEXT
)
/*is the text being requested?*/
{
if
(
_ILIsValue
(
pidl
))
/*is
t
his a value or a folder?*/
{
if
(
_ILIsValue
(
pidl
))
/*is
T
his a value or a folder?*/
{
switch
(
lpdi
->
item
.
iSubItem
)
{
case
1
:
/* size */
_ILGetFileSize
(
pidl
,
lpdi
->
item
.
pszText
,
lpdi
->
item
.
cchTextMax
);
...
...
@@ -1063,7 +1077,7 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh)
}
else
/*the item text is being requested*/
{
if
(
lpdi
->
item
.
mask
&
LVIF_TEXT
)
/*is the text being requested?*/
{
if
(
SUCCEEDED
(
this
->
pSFParent
->
lpvtbl
->
fnGetDisplayNameOf
(
t
his
->
pSFParent
,
pidl
,
SHGDN_NORMAL
|
SHGDN_INFOLDER
,
&
str
)))
{
if
(
SUCCEEDED
(
IShellFolder_GetDisplayNameOf
(
T
his
->
pSFParent
,
pidl
,
SHGDN_NORMAL
|
SHGDN_INFOLDER
,
&
str
)))
{
if
(
STRRET_WSTR
==
str
.
uType
)
{
WideCharToLocal
(
lpdi
->
item
.
pszText
,
str
.
u
.
pOleStr
,
lpdi
->
item
.
cchTextMax
);
SHFree
(
str
.
u
.
pOleStr
);
...
...
@@ -1079,10 +1093,10 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh)
}
if
(
lpdi
->
item
.
mask
&
LVIF_IMAGE
)
/*is the image being requested?*/
{
if
(
SUCCEEDED
(
this
->
pSFParent
->
lpvtbl
->
fnGetUIObjectOf
(
this
->
pSFParent
,
t
his
->
hWnd
,
1
,
(
LPCITEMIDLIST
*
)
&
pidl
,
(
REFIID
)
&
IID_IExtractIcon
,
NULL
,
(
LPVOID
*
)
&
pei
)))
{
pei
->
lpvtbl
->
fn
GetIconLocation
(
pei
,
GIL_FORSHELL
,
NULL
,
0
,
&
lpdi
->
item
.
iImage
,
&
uFlags
);
pei
->
lpvtbl
->
fn
Release
(
pei
);
{
if
(
SUCCEEDED
(
IShellFolder_GetUIObjectOf
(
This
->
pSFParent
,
T
his
->
hWnd
,
1
,
(
LPCITEMIDLIST
*
)
&
pidl
,
(
REFIID
)
&
IID_IExtractIcon
A
,
NULL
,
(
LPVOID
*
)
&
pei
)))
{
IExtractIconA_
GetIconLocation
(
pei
,
GIL_FORSHELL
,
NULL
,
0
,
&
lpdi
->
item
.
iImage
,
&
uFlags
);
IExtractIconA_
Release
(
pei
);
TRACE
(
shell
,
"-- image=%x
\n
"
,
lpdi
->
item
.
iImage
);
}
}
...
...
@@ -1090,13 +1104,13 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh)
break
;
case
LVN_ITEMCHANGED
:
TRACE
(
shell
,
"-- LVN_ITEMCHANGED %p
\n
"
,
t
his
);
ShellView_GetSelections
(
t
his
);
OnStateChange
(
t
his
,
CDBOSC_SELCHANGE
);
/* the browser will get the IDataObject now */
TRACE
(
shell
,
"-- LVN_ITEMCHANGED %p
\n
"
,
T
his
);
ShellView_GetSelections
(
T
his
);
OnStateChange
(
T
his
,
CDBOSC_SELCHANGE
);
/* the browser will get the IDataObject now */
break
;
default:
TRACE
(
shell
,
"-- %p WM_COMMAND %s unhandled
\n
"
,
t
his
,
SPY_GetMsgName
(
lpnmh
->
code
));
TRACE
(
shell
,
"-- %p WM_COMMAND %s unhandled
\n
"
,
T
his
,
SPY_GetMsgName
(
lpnmh
->
code
));
break
;;
}
return
0
;
...
...
@@ -1107,7 +1121,7 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh)
*/
LRESULT
CALLBACK
ShellView_WndProc
(
HWND
hWnd
,
UINT
uMessage
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LPSHELLVIEW
pThis
=
(
LPSHELLVIEW
)
GetWindowLongA
(
hWnd
,
GWL_USERDATA
);
{
IShellViewImpl
*
pThis
=
(
IShellViewImpl
*
)
GetWindowLongA
(
hWnd
,
GWL_USERDATA
);
LPCREATESTRUCTA
lpcs
;
DWORD
dwCursor
;
...
...
@@ -1117,7 +1131,7 @@ LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPAR
{
case
WM_NCCREATE
:
{
TRACE
(
shell
,
"-- WM_NCCREATE
\n
"
);
lpcs
=
(
LPCREATESTRUCTA
)
lParam
;
pThis
=
(
LPSHELLVIEW
)(
lpcs
->
lpCreateParams
);
pThis
=
(
IShellViewImpl
*
)(
lpcs
->
lpCreateParams
);
SetWindowLongA
(
hWnd
,
GWL_USERDATA
,
(
LONG
)
pThis
);
pThis
->
hWnd
=
hWnd
;
/*set the window handle*/
}
...
...
@@ -1190,73 +1204,92 @@ LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPAR
***************************************************************************
* IShellView_QueryInterface
*/
static
HRESULT
WINAPI
IShellView_QueryInterface
(
LPSHELLVIEW
this
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
char
xriid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
riid
,
xriid
);
TRACE
(
shell
,
"(%p)->(
\n\t
IID:
\t
%s,%p)
\n
"
,
this
,
xriid
,
ppvObj
);
static
HRESULT
WINAPI
IShellView_fnQueryInterface
(
IShellView
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
*
ppvObj
=
NULL
;
char
xriid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
riid
,
xriid
);
TRACE
(
shell
,
"(%p)->(
\n\t
IID:
\t
%s,%p)
\n
"
,
This
,
xriid
,
ppvObj
);
*
ppvObj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
/*IUnknown*/
{
*
ppvObj
=
This
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IShellView
))
/*IShellView*/
{
*
ppvObj
=
(
IShellView
*
)
This
;
}
if
(
*
ppvObj
)
{
IShellView_AddRef
(
(
IShellView
*
)
*
ppvObj
);
TRACE
(
shell
,
"-- Interface: (%p)->(%p)
\n
"
,
ppvObj
,
*
ppvObj
);
return
S_OK
;
}
TRACE
(
shell
,
"-- Interface: E_NOINTERFACE
\n
"
);
return
E_NOINTERFACE
;
}
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
/*IUnknown*/
{
*
ppvObj
=
this
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IShellView
))
/*IShellView*/
{
*
ppvObj
=
(
IShellView
*
)
this
;
}
if
(
*
ppvObj
)
{
(
*
(
LPSHELLVIEW
*
)
ppvObj
)
->
lpvtbl
->
fnAddRef
(
this
);
TRACE
(
shell
,
"-- Interface: (%p)->(%p)
\n
"
,
ppvObj
,
*
ppvObj
);
return
S_OK
;
}
TRACE
(
shell
,
"-- Interface: E_NOINTERFACE
\n
"
);
return
E_NOINTERFACE
;
}
/**************************************************************************
* IShellView::AddRef
*/
static
ULONG
WINAPI
IShellView_AddRef
(
LPSHELLVIEW
this
)
{
TRACE
(
shell
,
"(%p)->(count=%lu)
\n
"
,
this
,(
this
->
ref
)
+
1
);
static
ULONG
WINAPI
IShellView_fnAddRef
(
IShellView
*
iface
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
TRACE
(
shell
,
"(%p)->(count=%lu)
\n
"
,
This
,(
This
->
ref
)
+
1
);
shell32_ObjCount
++
;
return
++
(
t
his
->
ref
);
return
++
(
T
his
->
ref
);
}
/**************************************************************************
* IShellView_Release
*/
static
ULONG
WINAPI
IShellView_Release
(
LPSHELLVIEW
this
)
{
TRACE
(
shell
,
"(%p)->()
\n
"
,
this
);
static
ULONG
WINAPI
IShellView_fnRelease
(
IShellView
*
iface
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
TRACE
(
shell
,
"(%p)->()
\n
"
,
This
);
shell32_ObjCount
--
;
if
(
!--
(
t
his
->
ref
))
{
TRACE
(
shell
,
" destroying IShellView(%p)
\n
"
,
t
his
);
if
(
!--
(
T
his
->
ref
))
{
TRACE
(
shell
,
" destroying IShellView(%p)
\n
"
,
T
his
);
if
(
t
his
->
pSFParent
)
this
->
pSFParent
->
lpvtbl
->
fnRelease
(
t
his
->
pSFParent
);
if
(
T
his
->
pSFParent
)
IShellFolder_Release
(
T
his
->
pSFParent
);
if
(
t
his
->
aSelectedItems
)
SHFree
(
t
his
->
aSelectedItems
);
if
(
T
his
->
aSelectedItems
)
SHFree
(
T
his
->
aSelectedItems
);
if
(
t
his
->
pCommDlgBrowser
)
this
->
pCommDlgBrowser
->
lpvtbl
->
fnRelease
(
t
his
->
pCommDlgBrowser
);
if
(
T
his
->
pCommDlgBrowser
)
ICommDlgBrowser_Release
(
T
his
->
pCommDlgBrowser
);
HeapFree
(
GetProcessHeap
(),
0
,
t
his
);
HeapFree
(
GetProcessHeap
(),
0
,
T
his
);
return
0
;
}
return
t
his
->
ref
;
return
T
his
->
ref
;
}
/**************************************************************************
* ShellView_GetWindow
*/
static
HRESULT
WINAPI
IShellView_GetWindow
(
LPSHELLVIEW
this
,
HWND
*
phWnd
)
{
TRACE
(
shell
,
"(%p)
\n
"
,
this
);
*
phWnd
=
this
->
hWnd
;
static
HRESULT
WINAPI
IShellView_fnGetWindow
(
IShellView
*
iface
,
HWND
*
phWnd
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
TRACE
(
shell
,
"(%p)
\n
"
,
This
);
*
phWnd
=
This
->
hWnd
;
return
S_OK
;
}
static
HRESULT
WINAPI
IShellView_ContextSensitiveHelp
(
LPSHELLVIEW
this
,
BOOL
fEnterMode
)
{
FIXME
(
shell
,
"(%p) stub
\n
"
,
this
);
return
E_NOTIMPL
;
static
HRESULT
WINAPI
IShellView_fnContextSensitiveHelp
(
IShellView
*
iface
,
BOOL
fEnterMode
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
FIXME
(
shell
,
"(%p) stub
\n
"
,
This
);
return
E_NOTIMPL
;
}
/**************************************************************************
* IShellView_TranslateAccelerator
...
...
@@ -1264,8 +1297,11 @@ static HRESULT WINAPI IShellView_ContextSensitiveHelp(LPSHELLVIEW this,BOOL fEnt
* FIXME:
* use the accel functions
*/
static
HRESULT
WINAPI
IShellView_TranslateAccelerator
(
LPSHELLVIEW
this
,
LPMSG
lpmsg
)
{
FIXME
(
shell
,
"(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub
\n
"
,
this
,
lpmsg
,
lpmsg
->
hwnd
,
lpmsg
->
message
,
lpmsg
->
lParam
,
lpmsg
->
wParam
);
static
HRESULT
WINAPI
IShellView_fnTranslateAccelerator
(
IShellView
*
iface
,
LPMSG
lpmsg
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
FIXME
(
shell
,
"(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub
\n
"
,
This
,
lpmsg
,
lpmsg
->
hwnd
,
lpmsg
->
message
,
lpmsg
->
lParam
,
lpmsg
->
wParam
);
switch
(
lpmsg
->
message
)
...
...
@@ -1273,83 +1309,95 @@ static HRESULT WINAPI IShellView_TranslateAccelerator(LPSHELLVIEW this,LPMSG lpm
}
return
S_FALSE
;
}
static
HRESULT
WINAPI
IShellView_EnableModeless
(
LPSHELLVIEW
this
,
BOOL
fEnable
)
{
FIXME
(
shell
,
"(%p) stub
\n
"
,
this
);
return
E_NOTIMPL
;
static
HRESULT
WINAPI
IShellView_fnEnableModeless
(
IShellView
*
iface
,
BOOL
fEnable
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
FIXME
(
shell
,
"(%p) stub
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IShellView_UIActivate
(
LPSHELLVIEW
this
,
UINT
uState
)
{
CHAR
szName
[
MAX_PATH
];
static
HRESULT
WINAPI
IShellView_fnUIActivate
(
IShellView
*
iface
,
UINT
uState
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
CHAR
szName
[
MAX_PATH
];
LRESULT
lResult
;
int
nPartArray
[
1
]
=
{
-
1
};
TRACE
(
shell
,
"(%p)->(state=%x) stub
\n
"
,
t
his
,
uState
);
TRACE
(
shell
,
"(%p)->(state=%x) stub
\n
"
,
T
his
,
uState
);
/*don't do anything if the state isn't really changing*/
if
(
t
his
->
uState
==
uState
)
if
(
T
his
->
uState
==
uState
)
{
return
S_OK
;
}
/*OnActivate handles the menu merging and internal state*/
ShellView_OnActivate
(
t
his
,
uState
);
ShellView_OnActivate
(
T
his
,
uState
);
/*remove the docking window*/
if
(
g_bShowIDW
)
{
ShellView_AddRemoveDockingWindow
(
t
his
,
FALSE
);
{
ShellView_AddRemoveDockingWindow
(
T
his
,
FALSE
);
}
/*only do
t
his if we are active*/
/*only do
T
his if we are active*/
if
(
uState
!=
SVUIA_DEACTIVATE
)
{
/*update the status bar */
strcpy
(
szName
,
"dummy32"
);
this
->
pSFParent
->
lpvtbl
->
fnGetFolderPath
(
this
->
pSFParent
,
szName
+
strlen
(
szName
),
sizeof
(
szName
)
-
strlen
(
szName
));
IShellFolder_GetFolderPath
(
This
->
pSFParent
,
szName
+
strlen
(
szName
),
sizeof
(
szName
)
-
strlen
(
szName
));
/* set the number of parts */
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_STATUS
,
SB_SETPARTS
,
1
,
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_STATUS
,
SB_SETPARTS
,
1
,
(
LPARAM
)
nPartArray
,
&
lResult
);
/* set the text for the parts */
IShellBrowser_SendControlMsg
(
t
his
->
pShellBrowser
,
FCW_STATUS
,
SB_SETTEXTA
,
IShellBrowser_SendControlMsg
(
T
his
->
pShellBrowser
,
FCW_STATUS
,
SB_SETTEXTA
,
0
,
(
LPARAM
)
szName
,
&
lResult
);
/*add the docking window if necessary */
if
(
g_bShowIDW
)
{
ShellView_AddRemoveDockingWindow
(
t
his
,
TRUE
);
{
ShellView_AddRemoveDockingWindow
(
T
his
,
TRUE
);
}
}
return
S_OK
;
}
static
HRESULT
WINAPI
IShellView_Refresh
(
LPSHELLVIEW
this
)
{
TRACE
(
shell
,
"(%p)
\n
"
,
this
);
static
HRESULT
WINAPI
IShellView_fnRefresh
(
IShellView
*
iface
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
ListView_DeleteAllItems
(
this
->
hWndList
);
ShellView_FillList
(
this
);
TRACE
(
shell
,
"(%p)
\n
"
,
This
);
ListView_DeleteAllItems
(
This
->
hWndList
);
ShellView_FillList
(
This
);
return
S_OK
;
}
static
HRESULT
WINAPI
IShellView_
CreateViewWindow
(
LPSHELLVIEW
this
,
IShellView
*
lpPrevView
,
static
HRESULT
WINAPI
IShellView_
fnCreateViewWindow
(
IShellView
*
iface
,
IShellView
*
lpPrevView
,
LPCFOLDERSETTINGS
lpfs
,
IShellBrowser
*
psb
,
RECT
*
prcView
,
HWND
*
phWnd
)
{
WNDCLASSA
wc
;
/* LRESULT dwResult;*/
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
WNDCLASSA
wc
;
*
phWnd
=
0
;
TRACE
(
shell
,
"(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete
\n
"
,
t
his
,
lpPrevView
,
lpfs
,
psb
,
prcView
,
phWnd
);
TRACE
(
shell
,
"(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete
\n
"
,
T
his
,
lpPrevView
,
lpfs
,
psb
,
prcView
,
phWnd
);
TRACE
(
shell
,
"-- vmode=%x flags=%x left=%i top=%i right=%i bottom=%i
\n
"
,
lpfs
->
ViewMode
,
lpfs
->
fFlags
,
prcView
->
left
,
prcView
->
top
,
prcView
->
right
,
prcView
->
bottom
);
/*set up the member variables*/
t
his
->
pShellBrowser
=
psb
;
t
his
->
FolderSettings
=
*
lpfs
;
T
his
->
pShellBrowser
=
psb
;
T
his
->
FolderSettings
=
*
lpfs
;
/*get our parent window*/
IShellBrowser_AddRef
(
t
his
->
pShellBrowser
);
IShellBrowser_GetWindow
(
this
->
pShellBrowser
,
&
(
t
his
->
hWndParent
));
IShellBrowser_AddRef
(
T
his
->
pShellBrowser
);
IShellBrowser_GetWindow
(
This
->
pShellBrowser
,
&
(
T
his
->
hWndParent
));
/* try to get the ICommDlgBrowserInterface, adds a reference !!! */
t
his
->
pCommDlgBrowser
=
NULL
;
if
(
SUCCEEDED
(
IShellBrowser_QueryInterface
(
t
his
->
pShellBrowser
,
(
REFIID
)
&
IID_ICommDlgBrowser
,
(
LPVOID
*
)
&
t
his
->
pCommDlgBrowser
)))
T
his
->
pCommDlgBrowser
=
NULL
;
if
(
SUCCEEDED
(
IShellBrowser_QueryInterface
(
T
his
->
pShellBrowser
,
(
REFIID
)
&
IID_ICommDlgBrowser
,
(
LPVOID
*
)
&
T
his
->
pCommDlgBrowser
)))
{
TRACE
(
shell
,
"-- CommDlgBrowser
\n
"
);
}
...
...
@@ -1366,16 +1414,16 @@ static HRESULT WINAPI IShellView_CreateViewWindow(LPSHELLVIEW this, IShellView *
wc
.
hbrBackground
=
(
HBRUSH
)
(
COLOR_WINDOW
+
1
);
wc
.
lpszMenuName
=
NULL
;
wc
.
lpszClassName
=
SV_CLASS_NAME
;
if
(
!
RegisterClassA
(
&
wc
))
return
E_FAIL
;
}
*
phWnd
=
CreateWindowExA
(
0
,
SV_CLASS_NAME
,
NULL
,
WS_CHILD
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
,
prcView
->
left
,
prcView
->
top
,
prcView
->
right
-
prcView
->
left
,
prcView
->
bottom
-
prcView
->
top
,
this
->
hWndParent
,
0
,
shell32_hInstance
,
(
LPVOID
)
t
his
);
MergeToolBar
(
t
his
);
prcView
->
left
,
prcView
->
top
,
prcView
->
right
-
prcView
->
left
,
prcView
->
bottom
-
prcView
->
top
,
This
->
hWndParent
,
0
,
shell32_hInstance
,
(
LPVOID
)
T
his
);
MergeToolBar
(
T
his
);
if
(
!*
phWnd
)
return
E_FAIL
;
...
...
@@ -1383,62 +1431,107 @@ static HRESULT WINAPI IShellView_CreateViewWindow(LPSHELLVIEW this, IShellView *
return
S_OK
;
}
static
HRESULT
WINAPI
IShellView_DestroyViewWindow
(
LPSHELLVIEW
this
)
{
TRACE
(
shell
,
"(%p)
\n
"
,
this
);
static
HRESULT
WINAPI
IShellView_fnDestroyViewWindow
(
IShellView
*
iface
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
TRACE
(
shell
,
"(%p)
\n
"
,
This
);
/*Make absolutely sure all our UI is cleaned up.*/
IShellView_UIActivate
(
t
his
,
SVUIA_DEACTIVATE
);
if
(
t
his
->
hMenu
)
{
DestroyMenu
(
t
his
->
hMenu
);
IShellView_UIActivate
(
(
IShellView
*
)
T
his
,
SVUIA_DEACTIVATE
);
if
(
T
his
->
hMenu
)
{
DestroyMenu
(
T
his
->
hMenu
);
}
DestroyWindow
(
t
his
->
hWnd
);
IShellBrowser_Release
(
t
his
->
pShellBrowser
);
DestroyWindow
(
T
his
->
hWnd
);
IShellBrowser_Release
(
T
his
->
pShellBrowser
);
return
S_OK
;
}
static
HRESULT
WINAPI
IShellView_GetCurrentInfo
(
LPSHELLVIEW
this
,
LPFOLDERSETTINGS
lpfs
)
{
TRACE
(
shell
,
"(%p)->(%p) vmode=%x flags=%x
\n
"
,
this
,
lpfs
,
this
->
FolderSettings
.
ViewMode
,
this
->
FolderSettings
.
fFlags
);
static
HRESULT
WINAPI
IShellView_fnGetCurrentInfo
(
IShellView
*
iface
,
LPFOLDERSETTINGS
lpfs
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
TRACE
(
shell
,
"(%p)->(%p) vmode=%x flags=%x
\n
"
,
This
,
lpfs
,
This
->
FolderSettings
.
ViewMode
,
This
->
FolderSettings
.
fFlags
);
if
(
lpfs
)
{
*
lpfs
=
t
his
->
FolderSettings
;
{
*
lpfs
=
T
his
->
FolderSettings
;
return
NOERROR
;
}
else
return
E_INVALIDARG
;
}
static
HRESULT
WINAPI
IShellView_AddPropertySheetPages
(
LPSHELLVIEW
this
,
DWORD
dwReserved
,
LPFNADDPROPSHEETPAGE
lpfn
,
LPARAM
lparam
)
{
FIXME
(
shell
,
"(%p) stub
\n
"
,
this
);
return
E_NOTIMPL
;
static
HRESULT
WINAPI
IShellView_fnAddPropertySheetPages
(
IShellView
*
iface
,
DWORD
dwReserved
,
LPFNADDPROPSHEETPAGE
lpfn
,
LPARAM
lparam
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
FIXME
(
shell
,
"(%p) stub
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IShellView_SaveViewState
(
LPSHELLVIEW
this
)
{
FIXME
(
shell
,
"(%p) stub
\n
"
,
this
);
return
S_OK
;
static
HRESULT
WINAPI
IShellView_fnSaveViewState
(
IShellView
*
iface
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
FIXME
(
shell
,
"(%p) stub
\n
"
,
This
);
return
S_OK
;
}
static
HRESULT
WINAPI
IShellView_SelectItem
(
LPSHELLVIEW
this
,
LPCITEMIDLIST
pidlItem
,
UINT
uFlags
)
{
FIXME
(
shell
,
"(%p)->(pidl=%p, 0x%08x) stub
\n
"
,
this
,
pidlItem
,
uFlags
);
return
E_NOTIMPL
;
static
HRESULT
WINAPI
IShellView_fnSelectItem
(
IShellView
*
iface
,
LPCITEMIDLIST
pidlItem
,
UINT
uFlags
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
FIXME
(
shell
,
"(%p)->(pidl=%p, 0x%08x) stub
\n
"
,
This
,
pidlItem
,
uFlags
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IShellView_GetItemObject
(
LPSHELLVIEW
this
,
UINT
uItem
,
REFIID
riid
,
LPVOID
*
ppvOut
)
{
LPUNKNOWN
pObj
=
NULL
;
static
HRESULT
WINAPI
IShellView_fnGetItemObject
(
IShellView
*
iface
,
UINT
uItem
,
REFIID
riid
,
LPVOID
*
ppvOut
)
{
ICOM_THIS
(
IShellViewImpl
,
iface
);
LPUNKNOWN
pObj
=
NULL
;
char
xriid
[
50
];
WINE_StringFromCLSID
((
LPCLSID
)
riid
,
xriid
);
TRACE
(
shell
,
"(%p)->(uItem=0x%08x,
\n\t
IID=%s, ppv=%p)
\n
"
,
t
his
,
uItem
,
xriid
,
ppvOut
);
TRACE
(
shell
,
"(%p)->(uItem=0x%08x,
\n\t
IID=%s, ppv=%p)
\n
"
,
T
his
,
uItem
,
xriid
,
ppvOut
);
*
ppvOut
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IContextMenu
))
{
ShellView_GetSelections
(
t
his
);
pObj
=
(
LPUNKNOWN
)
IContextMenu_Constructor
(
this
->
pSFParent
,
this
->
aSelectedItems
,
t
his
->
uSelected
);
{
ShellView_GetSelections
(
T
his
);
pObj
=
(
LPUNKNOWN
)
IContextMenu_Constructor
(
This
->
pSFParent
,
This
->
aSelectedItems
,
T
his
->
uSelected
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IDataObject
))
{
ShellView_GetSelections
(
t
his
);
pObj
=
(
LPUNKNOWN
)
IDataObject_Constructor
(
this
->
hWndParent
,
this
->
pSFParent
,
this
->
aSelectedItems
,
t
his
->
uSelected
);
{
ShellView_GetSelections
(
T
his
);
pObj
=
(
LPUNKNOWN
)
IDataObject_Constructor
(
This
->
hWndParent
,
This
->
pSFParent
,
This
->
aSelectedItems
,
T
his
->
uSelected
);
}
TRACE
(
shell
,
"-- (%p)->(interface=%p)
\n
"
,
t
his
,
ppvOut
);
TRACE
(
shell
,
"-- (%p)->(interface=%p)
\n
"
,
T
his
,
ppvOut
);
if
(
!
pObj
)
return
E_OUTOFMEMORY
;
*
ppvOut
=
pObj
;
return
S_OK
;
}
static
struct
ICOM_VTABLE
(
IShellView
)
svvt
=
{
IShellView_fnQueryInterface
,
IShellView_fnAddRef
,
IShellView_fnRelease
,
IShellView_fnGetWindow
,
IShellView_fnContextSensitiveHelp
,
IShellView_fnTranslateAccelerator
,
IShellView_fnEnableModeless
,
IShellView_fnUIActivate
,
IShellView_fnRefresh
,
IShellView_fnCreateViewWindow
,
IShellView_fnDestroyViewWindow
,
IShellView_fnGetCurrentInfo
,
IShellView_fnAddPropertySheetPages
,
IShellView_fnSaveViewState
,
IShellView_fnSelectItem
,
IShellView_fnGetItemObject
};
include/shlguid.h
View file @
8e7cb4db
...
...
@@ -15,30 +15,20 @@ DEFINE_SHLGUID(CGID_ShellDocView, 0x000214D1L, 0, 0);
/* shell32interface ids */
DEFINE_SHLGUID
(
IID_INewShortcutHookA
,
0x000214E1L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellBrowser
,
0x000214E2L
,
0
,
0
);
#define SID_SShellBrowser IID_IShellBrowser
DEFINE_SHLGUID
(
IID_IShellView
,
0x000214E3L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IContextMenu
,
0x000214E4L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellIcon
,
0x000214E5L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellExtInit
,
0x000214E8L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellPropSheetExt
,
0x000214E9L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IExtractIcon
,
0x000214EBL
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellCopyHook
,
0x000214EFL
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IFileViewer
,
0x000214F0L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_ICommDlgBrowser
,
0x000214F1L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IFileViewerSite
,
0x000214F3L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IContextMenu2
,
0x000214F4L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellExecuteHookA
,
0x000214F5L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IPropSheetPage
,
0x000214F6L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_INewShortcutHookW
,
0x000214F7L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IFileViewerW
,
0x000214F8L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IExtractIconW
,
0x000214FAL
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellExecuteHookW
,
0x000214FBL
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IShellCopyHookW
,
0x000214FCL
,
0
,
0
);
DEFINE_GUID
(
IID_IDockingWindow
,
0x012dd920L
,
0x7B26
,
0x11D0
,
0x8C
,
0xA9
,
0x00
,
0xA0
,
0xC9
,
0x2D
,
0xBF
,
0xE8
);
DEFINE_GUID
(
IID_IDockingWindowSite
,
0x2A342FC2L
,
0x7B26
,
0x11D0
,
0x8C
,
0xA9
,
0x00
,
0xA0
,
0xC9
,
0x2D
,
0xBF
,
0xE8
);
DEFINE_GUID
(
IID_IDockingWindowFrame
,
0x47D2657AL
,
0x7B27
,
0x11D0
,
0x8C
,
0xA9
,
0x00
,
0xA0
,
0xC9
,
0x2D
,
0xBF
,
0xE8
);
/****************************************************************************
* the following should be moved to the right place
...
...
include/shlobj.h
View file @
8e7cb4db
#ifndef __WINE_SHLOBJ_H
#define __WINE_SHLOBJ_H
#include "windef.h"
#include "winbase.h"
/* WIN32_FIND_* */
#include "wine/obj_base.h"
#include "wine/obj_shelllink.h"
#include "wine/obj_shellfolder.h"
#include "wine/obj_shellbrowser.h"
#include "wine/obj_contextmenu.h"
#include "wine/obj_shellextinit.h"
#include "wine/obj_extracticon.h"
#include "wine/obj_commdlgbrowser.h"
#include "wine/obj_dockingwindowframe.h"
#include "windef.h"
#include "winbase.h"
/* WIN32_FIND_* */
#include "ole2.h"
#include "shell.h"
#include "commctrl.h"
...
...
@@ -17,142 +24,14 @@
#define FAR
#define THIS_ THIS,
/****************************************************************************
* DllGetClassObject
*/
DWORD
WINAPI
SHELL32_DllGetClassObject
(
REFCLSID
,
REFIID
,
LPVOID
*
);
/* foreward declaration of the objects*/
typedef
struct
IContextMenu
IContextMenu
,
*
LPCONTEXTMENU
;
typedef
struct
tagSHELLEXTINIT
*
LPSHELLEXTINIT
,
IShellExtInit
;
typedef
struct
tagSHELLVIEW
*
LPSHELLVIEW
,
IShellView
;
typedef
struct
tagSHELLBROWSER
*
LPSHELLBROWSER
,
IShellBrowser
;
typedef
struct
tagSHELLICON
*
LPSHELLICON
,
IShellIcon
;
typedef
struct
tagDOCKINGWINDOWFRAME
*
LPDOCKINGWINDOWFRAME
,
IDockingWindowFrame
;
typedef
struct
tagCOMMDLGBROWSER
*
LPCOMMDLGBROWSER
,
ICommDlgBrowser
;
/*****************************************************************************
* IContextMenu interface
*/
#define THIS LPCONTEXTMENU me
/* default menu items*/
#define IDM_EXPLORE 0
#define IDM_OPEN 1
#define IDM_RENAME 2
#define IDM_LAST IDM_RENAME
/* QueryContextMenu uFlags */
#define CMF_NORMAL 0x00000000
#define CMF_DEFAULTONLY 0x00000001
#define CMF_VERBSONLY 0x00000002
#define CMF_EXPLORE 0x00000004
#define CMF_NOVERBS 0x00000008
#define CMF_CANRENAME 0x00000010
#define CMF_NODEFAULT 0x00000020
#define CMF_INCLUDESTATIC 0x00000040
#define CMF_RESERVED 0xffff0000
/* View specific */
/* GetCommandString uFlags */
#define GCS_VERBA 0x00000000
/* canonical verb */
#define GCS_HELPTEXTA 0x00000001
/* help text (for status bar) */
#define GCS_VALIDATEA 0x00000002
/* validate command exists */
#define GCS_VERBW 0x00000004
/* canonical verb (unicode) */
#define GCS_HELPTEXTW 0x00000005
/* help text (unicode version) */
#define GCS_VALIDATEW 0x00000006
/* validate command exists (unicode) */
#define GCS_UNICODE 0x00000004
/* for bit testing - Unicode string */
#define GCS_VERB GCS_VERBA
#define GCS_HELPTEXT GCS_HELPTEXTA
#define GCS_VALIDATE GCS_VALIDATEA
#define CMDSTR_NEWFOLDERA "NewFolder"
#define CMDSTR_VIEWLISTA "ViewList"
#define CMDSTR_VIEWDETAILSA "ViewDetails"
#define CMDSTR_NEWFOLDERW L"NewFolder"
#define CMDSTR_VIEWLISTW L"ViewList"
#define CMDSTR_VIEWDETAILSW L"ViewDetails"
#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
#define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
#define CMIC_MASK_ICON SEE_MASK_ICON
#define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
#define CMIC_MASK_UNICODE SEE_MASK_UNICODE
#define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
#define CMIC_MASK_PTINVOKE 0x20000000
/*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */
typedef
struct
tagCMINVOKECOMMANDINFO
{
DWORD
cbSize
;
/* sizeof(CMINVOKECOMMANDINFO) */
DWORD
fMask
;
/* any combination of CMIC_MASK_* */
HWND
hwnd
;
/* might be NULL (indicating no owner window) */
LPCSTR
lpVerb
;
/* either a string or MAKEINTRESOURCE(idOffset) */
LPCSTR
lpParameters
;
/* might be NULL (indicating no parameter) */
LPCSTR
lpDirectory
;
/* might be NULL (indicating no specific directory) */
INT
nShow
;
/* one of SW_ values for ShowWindow() API */
DWORD
dwHotKey
;
HANDLE
hIcon
;
}
CMINVOKECOMMANDINFO
,
*
LPCMINVOKECOMMANDINFO
;
typedef
struct
tagCMInvokeCommandInfoEx
{
DWORD
cbSize
;
/* must be sizeof(CMINVOKECOMMANDINFOEX) */
DWORD
fMask
;
/* any combination of CMIC_MASK_* */
HWND
hwnd
;
/* might be NULL (indicating no owner window) */
LPCSTR
lpVerb
;
/* either a string or MAKEINTRESOURCE(idOffset) */
LPCSTR
lpParameters
;
/* might be NULL (indicating no parameter) */
LPCSTR
lpDirectory
;
/* might be NULL (indicating no specific directory) */
INT
nShow
;
/* one of SW_ values for ShowWindow() API */
DWORD
dwHotKey
;
HANDLE
hIcon
;
LPCSTR
lpTitle
;
/* For CreateProcess-StartupInfo.lpTitle */
LPCWSTR
lpVerbW
;
/* Unicode verb (for those who can use it) */
LPCWSTR
lpParametersW
;
/* Unicode parameters (for those who can use it) */
LPCWSTR
lpDirectoryW
;
/* Unicode directory (for those who can use it) */
LPCWSTR
lpTitleW
;
/* Unicode title (for those who can use it) */
POINT
ptInvoke
;
/* Point where it's invoked */
}
CMINVOKECOMMANDINFOEX
,
*
LPCMINVOKECOMMANDINFOEX
;
#undef THIS
#define ICOM_INTERFACE IContextMenu
#define IContextMenu_METHODS \
ICOM_METHOD5(HRESULT,QueryContextMenu, HMENU,hmenu, UINT,indexMenu, UINT,idCmdFirst, UINT,idCmdLast, UINT,uFlags) \
ICOM_METHOD1(HRESULT,InvokeCommand, LPCMINVOKECOMMANDINFO,lpici) \
ICOM_METHOD5(HRESULT,GetCommandString, UINT,idCmd, UINT,uType, UINT*,pwReserved, LPSTR,pszName, UINT,cchMax) \
ICOM_METHOD3(HRESULT,HandleMenuMsg, UINT,uMsg,WPARAM,wParam,LPARAM,lParam) \
void * guard;
/*possibly another nasty entry from ContextMenu3 ?*/
#define IContextMenu_IMETHODS \
IUnknown_IMETHODS \
IContextMenu_METHODS
ICOM_DEFINE
(
IContextMenu
,
IUnknown
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
// *** IUnknown methods *** //
#define IContextMenu_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IContextMenu_AddRef(p) ICOM_CALL (AddRef,p)
#define IContextMenu_Release(p) ICOM_CALL (Release,p)
// *** IContextMenu methods *** //
#define IContextMenu_QueryContextMenu(p,a,b,c,d,e) ICOM_CALL5(QueryContextMenu,p,a,b,c,d,e)
#define IContextMenu_InvokeCommand(p,a) ICOM_CALL1(InvokeCommand,p,a)
#define IContextMenu_GetCommandString(p,a,b,c,d,e) ICOM_CALL5(GetCommandString,p,a,b,c,d,e)
#define IContextMenu_HandleMenuMsg(p,a,b,c) ICOM_CALL3(HandleMenuMsg,p,a,b,c)
#endif
/* DATAOBJECT_InitShellIDList*/
#define CFSTR_SHELLIDLIST "Shell IDList Array"
/* CF_IDLIST */
...
...
@@ -225,357 +104,15 @@ extern void IDLList_Destructor(LPIDLLIST me);
#undef THIS
/*****************************************************************************
* IShellExtInit interface
*/
#define THIS LPSHELLEXTINIT me
typedef
struct
IShellExtInit_VTable
{
/* *** IUnknown methods *** */
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
/* *** IShellExtInit methods *** */
STDMETHOD
(
Initialize
)(
THIS_
LPCITEMIDLIST
pidlFolder
,
LPDATAOBJECT
lpdobj
,
HKEY
hkeyProgID
)
PURE
;
}
IShellExtInit_VTable
,
*
LPSHELLEXTINIT_VTABLE
;
struct
tagSHELLEXTINIT
{
LPSHELLEXTINIT_VTABLE
lpvtbl
;
DWORD
ref
;
};
#undef THIS
/*-------------------------------------------------------------------------- */
/* */
/* FOLDERSETTINGS */
/* */
/* FOLDERSETTINGS is a data structure that explorer passes from one folder */
/* view to another, when the user is browsing. It calls ISV::GetCurrentInfo */
/* member to get the current settings and pass it to ISV::CreateViewWindow */
/* to allow the next folder view "inherit" it. These settings assumes a */
/* particular UI (which the shell's folder view has), and shell extensions */
/* may or may not use those settings. */
/* */
/*-------------------------------------------------------------------------- */
typedef
LPBYTE
LPVIEWSETTINGS
;
/* NB Bitfields. */
/* FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL */
typedef
enum
{
FWF_AUTOARRANGE
=
0x0001
,
FWF_ABBREVIATEDNAMES
=
0x0002
,
FWF_SNAPTOGRID
=
0x0004
,
FWF_OWNERDATA
=
0x0008
,
FWF_BESTFITWINDOW
=
0x0010
,
FWF_DESKTOP
=
0x0020
,
FWF_SINGLESEL
=
0x0040
,
FWF_NOSUBFOLDERS
=
0x0080
,
FWF_TRANSPARENT
=
0x0100
,
FWF_NOCLIENTEDGE
=
0x0200
,
FWF_NOSCROLL
=
0x0400
,
FWF_ALIGNLEFT
=
0x0800
,
FWF_SINGLECLICKACTIVATE
=
0x8000
/* TEMPORARY -- NO UI FOR THIS */
}
FOLDERFLAGS
;
typedef
enum
{
FVM_ICON
=
1
,
FVM_SMALLICON
=
2
,
FVM_LIST
=
3
,
FVM_DETAILS
=
4
}
FOLDERVIEWMODE
;
typedef
struct
{
UINT
ViewMode
;
/* View mode (FOLDERVIEWMODE values) */
UINT
fFlags
;
/* View options (FOLDERFLAGS bits) */
}
FOLDERSETTINGS
,
*
LPFOLDERSETTINGS
;
typedef
const
FOLDERSETTINGS
*
LPCFOLDERSETTINGS
;
/************************************************************************
* IShellBrowser interface
*/
#define THIS LPSHELLBROWSER me
/* targets for GetWindow/SendControlMsg */
#define FCW_STATUS 0x0001
#define FCW_TOOLBAR 0x0002
#define FCW_TREE 0x0003
#define FCW_INTERNETBAR 0x0006
#define FCW_PROGRESS 0x0008
/* wFlags for BrowseObject*/
#define SBSP_DEFBROWSER 0x0000
#define SBSP_SAMEBROWSER 0x0001
#define SBSP_NEWBROWSER 0x0002
#define SBSP_DEFMODE 0x0000
#define SBSP_OPENMODE 0x0010
#define SBSP_EXPLOREMODE 0x0020
#define SBSP_ABSOLUTE 0x0000
#define SBSP_RELATIVE 0x1000
#define SBSP_PARENT 0x2000
#define SBSP_NAVIGATEBACK 0x4000
#define SBSP_NAVIGATEFORWARD 0x8000
#define SBSP_ALLOW_AUTONAVIGATE 0x10000
#define SBSP_INITIATEDBYHLINKFRAME 0x80000000
#define SBSP_REDIRECT 0x40000000
#define SBSP_WRITENOHISTORY 0x08000000
/* uFlage for SetToolbarItems */
#define FCT_MERGE 0x0001
#define FCT_CONFIGABLE 0x0002
#define FCT_ADDTOEND 0x0004
/* undocumented, found in the web posted by Chris Becke */
#define CWM_SETPATH (WM_USER+2)
#define CWM_WANTIDLE (WM_USER+3)
#define CWM_GETSETCURRENTINFO (WM_USER+4)
#define CWM_SELECTITEM (WM_USER+5)
#define CWM_STOPWAITING (WM_USER+6)
#define CWM_GETISHELLBROWSER (WM_USER+7)
typedef
struct
IShellBrowser_VTable
{
/* *** IUnknown methods *** */
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
/* *** IOleWindow methods *** */
STDMETHOD
(
GetWindow
)
(
THIS_
HWND
*
lphwnd
)
PURE
;
STDMETHOD
(
ContextSensitiveHelp
)
(
THIS_
BOOL
fEnterMode
)
PURE
;
/* *** IShellBrowser methods *** (same as IOleInPlaceFrame) */
STDMETHOD
(
InsertMenusSB
)
(
THIS_
HMENU
hmenuShared
,
LPOLEMENUGROUPWIDTHS
lpMenuWidths
)
PURE
;
STDMETHOD
(
SetMenuSB
)
(
THIS_
HMENU
hmenuShared
,
HOLEMENU
holemenuReserved
,
HWND
hwndActiveObject
)
PURE
;
STDMETHOD
(
RemoveMenusSB
)
(
THIS_
HMENU
hmenuShared
)
PURE
;
STDMETHOD
(
SetStatusTextSB
)
(
THIS_
LPCOLESTR
lpszStatusText
)
PURE
;
STDMETHOD
(
EnableModelessSB
)
(
THIS_
BOOL
fEnable
)
PURE
;
STDMETHOD
(
TranslateAcceleratorSB
)
(
THIS_
LPMSG
lpmsg
,
WORD
wID
)
PURE
;
/* *** IShellBrowser methods *** */
STDMETHOD
(
BrowseObject
)(
THIS_
LPCITEMIDLIST
pidl
,
UINT
wFlags
)
PURE
;
STDMETHOD
(
GetViewStateStream
)(
THIS_
DWORD
grfMode
,
LPSTREAM
*
ppStrm
)
PURE
;
STDMETHOD
(
GetControlWindow
)(
THIS_
UINT
id
,
HWND
*
lphwnd
)
PURE
;
STDMETHOD
(
SendControlMsg
)(
THIS_
UINT
id
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
pret
)
PURE
;
STDMETHOD
(
QueryActiveShellView
)(
THIS_
IShellView
**
ppshv
)
PURE
;
STDMETHOD
(
OnViewWindowActive
)(
THIS_
IShellView
*
ppshv
)
PURE
;
STDMETHOD
(
SetToolbarItems
)(
THIS_
LPTBBUTTON
lpButtons
,
UINT
nButtons
,
UINT
uFlags
)
PURE
;
}
*
LPSHELLBROWSER_VTABLE
,
IShellBrowser_VTable
;
struct
tagSHELLBROWSER
{
LPSHELLBROWSER_VTABLE
lpvtbl
;
DWORD
ref
;
};
#undef THIS
/************************************************************************
* IShellView interface
*/
#define THIS LPSHELLVIEW me
/* shellview select item flags*/
#define SVSI_DESELECT 0x0000
#define SVSI_SELECT 0x0001
#define SVSI_EDIT 0x0003
/* includes select */
#define SVSI_DESELECTOTHERS 0x0004
#define SVSI_ENSUREVISIBLE 0x0008
#define SVSI_FOCUSED 0x0010
/* shellview get item object flags */
#define SVGIO_BACKGROUND 0x00000000
#define SVGIO_SELECTION 0x00000001
#define SVGIO_ALLVIEW 0x00000002
/* The explorer dispatches WM_COMMAND messages based on the range of
command/menuitem IDs. All the IDs of menuitems that the view (right
pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
won't dispatch them). The view should not deal with any menuitems
in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
version of the shell).
FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView)
FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser)
FCIDM_GLOBAL/LAST for the explorer's submenu IDs
*/
#define FCIDM_SHVIEWFIRST 0x0000
/* undocumented */
#define FCIDM_SHVIEW_ARRANGE 0x7001
#define FCIDM_SHVIEW_DELETE 0x7011
#define FCIDM_SHVIEW_PROPERTIES 0x7013
#define FCIDM_SHVIEW_CUT 0x7018
#define FCIDM_SHVIEW_COPY 0x7019
#define FCIDM_SHVIEW_INSERT 0x701A
#define FCIDM_SHVIEW_UNDO 0x701B
#define FCIDM_SHVIEW_INSERTLINK 0x701C
#define FCIDM_SHVIEW_SELECTALL 0x7021
#define FCIDM_SHVIEW_INVERTSELECTION 0x7022
#define FCIDM_SHVIEW_BIGICON 0x7029
#define FCIDM_SHVIEW_SMALLICON 0x702A
#define FCIDM_SHVIEW_LISTVIEW 0x702B
#define FCIDM_SHVIEW_REPORTVIEW 0x702C
#define FCIDM_SHVIEW_AUTOARRANGE 0x7031
#define FCIDM_SHVIEW_SNAPTOGRID 0x7032
#define FCIDM_SHVIEW_HELP 0x7041
#define FCIDM_SHVIEWLAST 0x7fff
#define FCIDM_BROWSERFIRST 0xA000
/* undocumented toolbar items from stddlg's*/
#define FCIDM_TB_SMALLICON 0xA003
#define FCIDM_TB_REPORTVIEW 0xA004
#define FCIDM_BROWSERLAST 0xbf00
#define FCIDM_GLOBALFIRST 0x8000
#define FCIDM_GLOBALLAST 0x9fff
/*
* Global submenu IDs and separator IDs
*/
#define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000)
#define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040)
#define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080)
#define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
#define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0)
#define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1)
#define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100)
#define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140)
#define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150)
#define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170)
/* control IDs known to the view */
#define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0)
#define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1)
/* uState values for IShellView::UIActivate */
typedef
enum
{
SVUIA_DEACTIVATE
=
0
,
SVUIA_ACTIVATE_NOFOCUS
=
1
,
SVUIA_ACTIVATE_FOCUS
=
2
,
SVUIA_INPLACEACTIVATE
=
3
/* new flag for IShellView2 */
}
SVUIA_STATUS
;
typedef
struct
IShellView_VTable
{
/* *** IUnknown methods *** */
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
/* *** IOleWindow methods *** */
STDMETHOD
(
GetWindow
)
(
THIS_
HWND
*
lphwnd
)
PURE
;
STDMETHOD
(
ContextSensitiveHelp
)
(
THIS_
BOOL
fEnterMode
)
PURE
;
/* *** IShellView methods *** */
STDMETHOD
(
TranslateAccelerator
)
(
THIS_
LPMSG
lpmsg
)
PURE
;
STDMETHOD
(
EnableModeless
)
(
THIS_
BOOL
fEnable
)
PURE
;
STDMETHOD
(
UIActivate
)
(
THIS_
UINT
uState
)
PURE
;
STDMETHOD
(
Refresh
)
(
THIS
)
PURE
;
STDMETHOD
(
CreateViewWindow
)(
THIS_
IShellView
*
lpPrevView
,
LPCFOLDERSETTINGS
lpfs
,
IShellBrowser
*
psb
,
RECT
*
prcView
,
HWND
*
phWnd
)
PURE
;
STDMETHOD
(
DestroyViewWindow
)(
THIS
)
PURE
;
STDMETHOD
(
GetCurrentInfo
)(
THIS_
LPFOLDERSETTINGS
lpfs
)
PURE
;
STDMETHOD
(
AddPropertySheetPages
)(
THIS_
DWORD
dwReserved
,
LPFNADDPROPSHEETPAGE
lpfn
,
LPARAM
lparam
)
PURE
;
STDMETHOD
(
SaveViewState
)(
THIS
)
PURE
;
STDMETHOD
(
SelectItem
)(
THIS_
LPCITEMIDLIST
pidlItem
,
UINT
uFlags
)
PURE
;
STDMETHOD
(
GetItemObject
)(
THIS_
UINT
uItem
,
REFIID
riid
,
LPVOID
*
ppv
)
PURE
;
}
IShellView_VTable
,
*
LPSHELLVIEW_VTABLE
;
struct
tagSHELLVIEW
{
LPSHELLVIEW_VTABLE
lpvtbl
;
DWORD
ref
;
LPITEMIDLIST
mpidl
;
LPSHELLFOLDER
pSFParent
;
LPSHELLBROWSER
pShellBrowser
;
LPCOMMDLGBROWSER
pCommDlgBrowser
;
HWND
hWnd
;
HWND
hWndList
;
HWND
hWndParent
;
FOLDERSETTINGS
FolderSettings
;
HMENU
hMenu
;
UINT
uState
;
UINT
uSelected
;
LPITEMIDLIST
*
aSelectedItems
;
};
typedef
GUID
SHELLVIEWID
;
#define SV_CLASS_NAME ("SHELLDLL_DefView")
#undef THIS
/****************************************************************************
* ICommDlgBrowser interface
*/
#define THIS LPCOMMDLGBROWSER me
/* for OnStateChange*/
#define CDBOSC_SETFOCUS 0x00000000
#define CDBOSC_KILLFOCUS 0x00000001
#define CDBOSC_SELCHANGE 0x00000002
#define CDBOSC_RENAME 0x00000003
typedef
struct
ICommDlgBrowser_VTable
{
/* IUnknown methods */
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
/* ICommDlgBrowser methods */
STDMETHOD
(
OnDefaultCommand
)
(
THIS_
LPSHELLVIEW
ppshv
)
PURE
;
STDMETHOD
(
OnStateChange
)
(
THIS_
LPSHELLVIEW
ppshv
,
ULONG
uChange
)
PURE
;
STDMETHOD
(
IncludeObject
)
(
THIS_
LPSHELLVIEW
ppshv
,
LPCITEMIDLIST
pidl
)
PURE
;
}
ICommDlgBrowser_VTable
,
*
LPCOMMDLGBROWSER_VTABLE
;
struct
tagCOMMDLGBROWSER
{
LPCOMMDLGBROWSER_VTABLE
lpvtbl
;
DWORD
ref
;
};
#undef THIS
/****************************************************************************
* IExtractIconinterface
*
* FIXME
* Is the ExtractIconA interface
*/
#define THIS LPEXTRACTICON me
/* GetIconLocation() input flags*/
#define GIL_OPENICON 0x0001
/* allows containers to specify an "open" look */
#define GIL_FORSHELL 0x0002
/* icon is to be displayed in a ShellFolder */
#define GIL_ASYNC 0x0020
/* this is an async extract, return E_ASYNC */
/* GetIconLocation() return flags */
#define GIL_SIMULATEDOC 0x0001
/* simulate this document icon for this */
#define GIL_PERINSTANCE 0x0002
/* icons from this class are per instance (each file has its own) */
#define GIL_PERCLASS 0x0004
/* icons from this class per class (shared for all files of this type) */
#define GIL_NOTFILENAME 0x0008
/* location is not a filename, must call ::ExtractIcon */
#define GIL_DONTCACHE 0x0010
/* this icon should not be cached */
typedef
struct
IExtractIcon
IExtractIcon
,
*
LPEXTRACTICON
;
typedef
struct
IExtractIcon_VTable
{
/*** IUnknown methods ***/
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
/*** IExtractIcon methods ***/
STDMETHOD
(
GetIconLocation
)(
THIS_
UINT
uFlags
,
LPSTR
szIconFile
,
UINT
cchMax
,
INT
*
piIndex
,
UINT
*
pwFlags
)
PURE
;
STDMETHOD
(
Extract
)(
THIS_
LPCSTR
pszFile
,
UINT
nIconIndex
,
HICON
*
phiconLarge
,
HICON
*
phiconSmall
,
UINT
nIconSize
)
PURE
;
}
IExtractIcon_VTable
,
*
LPEXTRACTICON_VTABLE
;
struct
IExtractIcon
{
LPEXTRACTICON_VTABLE
lpvtbl
;
DWORD
ref
;
LPITEMIDLIST
pidl
;
};
#undef THIS
DWORD
WINAPI
SHMapPIDLToSystemImageListIndex
(
LPSHELLFOLDER
sh
,
LPITEMIDLIST
pidl
,
DWORD
z
);
/****************************************************************************
...
...
@@ -599,36 +136,7 @@ struct tagSHELLICON
DWORD
ref
;
};
#undef THIS
/****************************************************************************
* IDockingWindowFrame interface
*/
#define THIS LPDOCKINGWINDOWFRAME me
#define DWFRF_NORMAL 0x0000
/* femove toolbar flags*/
#define DWFRF_DELETECONFIGDATA 0x0001
#define DWFAF_HIDDEN 0x0001
/* add tolbar*/
typedef
struct
IDockingWindowFrame_VTable
{
STDMETHOD
(
QueryInterface
)
(
THIS_
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)
(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)
(
THIS
)
PURE
;
/*** IOleWindow methods ***/
STDMETHOD
(
GetWindow
)
(
THIS_
HWND
*
lphwnd
)
PURE
;
STDMETHOD
(
ContextSensitiveHelp
)
(
THIS_
BOOL
fEnterMode
)
PURE
;
/*** IDockingWindowFrame methods ***/
STDMETHOD
(
AddToolbar
)
(
THIS_
IUnknown
*
punkSrc
,
LPCWSTR
pwszItem
,
DWORD
dwAddFlags
)
PURE
;
STDMETHOD
(
RemoveToolbar
)
(
THIS_
IUnknown
*
punkSrc
,
DWORD
dwRemoveFlags
)
PURE
;
STDMETHOD
(
FindToolbar
)
(
THIS_
LPCWSTR
pwszItem
,
REFIID
riid
,
LPVOID
*
ppvObj
)
PURE
;
}
IDockingWindowFrame_VTable
,
*
LPDOCKINGWINDOWFRAME_VTABLE
;
struct
tagDOCKINGWINDOWFRAME
{
LPDOCKINGWINDOWFRAME_VTABLE
lpvtbl
;
DWORD
ref
;
};
#undef THIS
/****************************************************************************
* Shell Execute API
*/
...
...
include/wine/obj_base.h
View file @
8e7cb4db
...
...
@@ -854,6 +854,12 @@ HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsC
HRESULT
WINAPI
CoRevokeClassObject
(
DWORD
dwRegister
);
/*****************************************************************************
* COM Server dll - exports
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
);
HRESULT
WINAPI
DllCanUnloadNow
(
void
);
/*****************************************************************************
* Internal WINE API
*/
#ifdef __WINE__
...
...
include/wine/obj_commdlgbrowser.h
0 → 100644
View file @
8e7cb4db
/************************************************************
* ICommDlgBrowser
*/
#ifndef __WINE_WINE_OBJ_ICOMMDLGBROWSER_H
#define __WINE_WINE_OBJ_ICOMMDLGBROWSER_H
#include "winbase.h"
#include "winuser.h"
#include "wine/obj_base.h"
#include "wine/obj_shellview.h"
DEFINE_SHLGUID
(
IID_ICommDlgBrowser
,
0x000214F1L
,
0
,
0
);
typedef
struct
ICommDlgBrowser
ICommDlgBrowser
,
*
LPCOMMDLGBROWSER
;
/* for OnStateChange*/
#define CDBOSC_SETFOCUS 0x00000000
#define CDBOSC_KILLFOCUS 0x00000001
#define CDBOSC_SELCHANGE 0x00000002
#define CDBOSC_RENAME 0x00000003
#define ICOM_INTERFACE ICommDlgBrowser
#define ICommDlgBrowser_METHODS \
ICOM_METHOD1(HRESULT, OnDefaultCommand, IShellView*, IShellView) \
ICOM_METHOD2(HRESULT, OnStateChange, IShellView*, IShellView, ULONG, uChange) \
ICOM_METHOD2(HRESULT, IncludeObject, IShellView*, IShellView, LPCITEMIDLIST, pidl)
#define ICommDlgBrowser_IMETHODS \
IUnknown_IMETHODS \
ICommDlgBrowser_METHODS
ICOM_DEFINE
(
ICommDlgBrowser
,
IUnknown
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
#define ICommDlgBrowser_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define ICommDlgBrowser_AddRef(p) ICOM_CALL(AddRef,p)
#define ICommDlgBrowser_Release(p) ICOM_CALL(Release,p)
#define ICommDlgBrowser_OnDefaultCommand(p,a) ICOM_CALL1(OnDefaultCommand,p,a)
#define ICommDlgBrowser_OnStateChange(p,a,b) ICOM_CALL2(OnStateChange,p,a,b)
#define ICommDlgBrowser_IncludeObject(p,a,b) ICOM_CALL2(IncludeObject,p,a,b)
#endif
#endif
/* __WINE_WINE_OBJ_ICOMMDLGBROWSER_H */
include/wine/obj_contextmenu.h
0 → 100644
View file @
8e7cb4db
/************************************************************
* IContextMenu
*/
#ifndef __WINE_WINE_OBJ_ICONTEXTMENU_H
#define __WINE_WINE_OBJ_ICONTEXTMENU_H
#include "winbase.h"
#include "winuser.h"
#include "wine/obj_base.h"
DEFINE_SHLGUID
(
IID_IContextMenu
,
0x000214E4L
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IContextMenu2
,
0x000214F4L
,
0
,
0
);
typedef
struct
IContextMenu
IContextMenu
,
*
LPCONTEXTMENU
;
/* default menu items*/
#define IDM_EXPLORE 0
#define IDM_OPEN 1
#define IDM_RENAME 2
#define IDM_LAST IDM_RENAME
/* QueryContextMenu uFlags */
#define CMF_NORMAL 0x00000000
#define CMF_DEFAULTONLY 0x00000001
#define CMF_VERBSONLY 0x00000002
#define CMF_EXPLORE 0x00000004
#define CMF_NOVERBS 0x00000008
#define CMF_CANRENAME 0x00000010
#define CMF_NODEFAULT 0x00000020
#define CMF_INCLUDESTATIC 0x00000040
#define CMF_RESERVED 0xffff0000
/* View specific */
/* GetCommandString uFlags */
#define GCS_VERBA 0x00000000
/* canonical verb */
#define GCS_HELPTEXTA 0x00000001
/* help text (for status bar) */
#define GCS_VALIDATEA 0x00000002
/* validate command exists */
#define GCS_VERBW 0x00000004
/* canonical verb (unicode) */
#define GCS_HELPTEXTW 0x00000005
/* help text (unicode version) */
#define GCS_VALIDATEW 0x00000006
/* validate command exists (unicode) */
#define GCS_UNICODE 0x00000004
/* for bit testing - Unicode string */
#define GCS_VERB GCS_VERBA
#define GCS_HELPTEXT GCS_HELPTEXTA
#define GCS_VALIDATE GCS_VALIDATEA
#define CMDSTR_NEWFOLDERA "NewFolder"
#define CMDSTR_VIEWLISTA "ViewList"
#define CMDSTR_VIEWDETAILSA "ViewDetails"
#define CMDSTR_NEWFOLDERW L"NewFolder"
#define CMDSTR_VIEWLISTW L"ViewList"
#define CMDSTR_VIEWDETAILSW L"ViewDetails"
#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
#define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
#define CMIC_MASK_ICON SEE_MASK_ICON
#define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
#define CMIC_MASK_UNICODE SEE_MASK_UNICODE
#define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
#define CMIC_MASK_PTINVOKE 0x20000000
/*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */
typedef
struct
tagCMINVOKECOMMANDINFO
{
DWORD
cbSize
;
/* sizeof(CMINVOKECOMMANDINFO) */
DWORD
fMask
;
/* any combination of CMIC_MASK_* */
HWND
hwnd
;
/* might be NULL (indicating no owner window) */
LPCSTR
lpVerb
;
/* either a string or MAKEINTRESOURCE(idOffset) */
LPCSTR
lpParameters
;
/* might be NULL (indicating no parameter) */
LPCSTR
lpDirectory
;
/* might be NULL (indicating no specific directory) */
INT
nShow
;
/* one of SW_ values for ShowWindow() API */
DWORD
dwHotKey
;
HANDLE
hIcon
;
}
CMINVOKECOMMANDINFO
,
*
LPCMINVOKECOMMANDINFO
;
typedef
struct
tagCMInvokeCommandInfoEx
{
DWORD
cbSize
;
/* must be sizeof(CMINVOKECOMMANDINFOEX) */
DWORD
fMask
;
/* any combination of CMIC_MASK_* */
HWND
hwnd
;
/* might be NULL (indicating no owner window) */
LPCSTR
lpVerb
;
/* either a string or MAKEINTRESOURCE(idOffset) */
LPCSTR
lpParameters
;
/* might be NULL (indicating no parameter) */
LPCSTR
lpDirectory
;
/* might be NULL (indicating no specific directory) */
INT
nShow
;
/* one of SW_ values for ShowWindow() API */
DWORD
dwHotKey
;
HANDLE
hIcon
;
LPCSTR
lpTitle
;
/* For CreateProcess-StartupInfo.lpTitle */
LPCWSTR
lpVerbW
;
/* Unicode verb (for those who can use it) */
LPCWSTR
lpParametersW
;
/* Unicode parameters (for those who can use it) */
LPCWSTR
lpDirectoryW
;
/* Unicode directory (for those who can use it) */
LPCWSTR
lpTitleW
;
/* Unicode title (for those who can use it) */
POINT
ptInvoke
;
/* Point where it's invoked */
}
CMINVOKECOMMANDINFOEX
,
*
LPCMINVOKECOMMANDINFOEX
;
#define ICOM_INTERFACE IContextMenu
#define IContextMenu_METHODS \
ICOM_METHOD5(HRESULT, QueryContextMenu, HMENU, hmenu, UINT, indexMenu, UINT, idCmdFirst, UINT, idCmdLast, UINT, uFlags) \
ICOM_METHOD1(HRESULT, InvokeCommand, LPCMINVOKECOMMANDINFO, lpici) \
ICOM_METHOD5(HRESULT, GetCommandString, UINT, idCmd, UINT, uType, UINT*, pwReserved, LPSTR, pszName, UINT, cchMax) \
ICOM_METHOD3(HRESULT, HandleMenuMsg, UINT, uMsg, WPARAM, wParam, LPARAM, lParam) \
void * guard;
/*possibly another nasty entry from ContextMenu3 ?*/
#define IContextMenu_IMETHODS \
IUnknown_IMETHODS \
IContextMenu_METHODS
ICOM_DEFINE
(
IContextMenu
,
IUnknown
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
#define IContextMenu_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IContextMenu_AddRef(p) ICOM_CALL(AddRef,p)
#define IContextMenu_Release(p) ICOM_CALL(Release,p)
#define IContextMenu_QueryContextMenu(p,a,b,c,d,e) ICOM_CALL5(QueryContextMenu,p,a,b,c,d,e)
#define IContextMenu_InvokeCommand(p,a) ICOM_CALL1(InvokeCommand,p,a)
#define IContextMenu_GetCommandString(p,a,b,c,d,e) ICOM_CALL5(GetCommandString,p,a,b,c,d,e)
#define IContextMenu_HandleMenuMsg(p,a,b,c) ICOM_CALL3(HandleMenuMsg,p,a,b,c)
#endif
#endif
/* __WINE_WINE_OBJ_ICONTEXTMENU_H */
include/wine/obj_dockingwindowframe.h
0 → 100644
View file @
8e7cb4db
/************************************************************
* IDockingWindowFrame
*/
#ifndef __WINE_WINE_OBJ_IDOCKINGWINDOWFRAME_H
#define __WINE_WINE_OBJ_IDOCKINGWINDOWFRAME_H
#include "winbase.h"
#include "winuser.h"
#include "wine/obj_base.h"
#include "wine/obj_inplace.h"
typedef
struct
IDockingWindowFrame
IDockingWindowFrame
,
*
LPDOCKINGWINDOWFRAME
;
DEFINE_GUID
(
IID_IDockingWindowFrame
,
0x47D2657AL
,
0x7B27
,
0x11D0
,
0x8C
,
0xA9
,
0x00
,
0xA0
,
0xC9
,
0x2D
,
0xBF
,
0xE8
);
#define DWFRF_NORMAL 0x0000
/* femove toolbar flags*/
#define DWFRF_DELETECONFIGDATA 0x0001
#define DWFAF_HIDDEN 0x0001
/* add tolbar*/
#define ICOM_INTERFACE IDockingWindowFrame
#define IDockingWindowFrame_METHODS \
ICOM_METHOD3(HRESULT, AddToolbar, IUnknown*, punkSrc, LPCWSTR, pwszItem, DWORD, dwAddFlags) \
ICOM_METHOD2(HRESULT, RemoveToolbar, IUnknown*, punkSrc, DWORD, dwRemoveFlags) \
ICOM_METHOD3(HRESULT, FindToolbar, LPCWSTR, pwszItem, REFIID, riid, LPVOID*, ppvObj)
#define IDockingWindowFrame_IMETHODS \
IOleWindow_IMETHODS \
IDockingWindowFrame_METHODS
ICOM_DEFINE
(
IDockingWindowFrame
,
IOleWindow
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
#define IDockingWindowFrame_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IDockingWindowFrame_AddRef(p) ICOM_CALL(AddRef,p)
#define IDockingWindowFrame_Release(p) ICOM_CALL(Release,p)
#define IDockingWindowFrame_GetWindow(p,a) ICOM_CALL1(GetWindow,p,a)
#define IDockingWindowFrame_ContextSensitiveHelp(p,a) ICOM_CALL1(ContextSensitiveHelp,p,a)
#define IDockingWindowFrame_AddToolbar(p,a,b,c) ICOM_CALL3(AddToolbar,p,a,b,c)
#define IDockingWindowFrame_RemoveToolbar(p,a,b) ICOM_CALL2(RemoveToolbar,p,a,b)
#define IDockingWindowFrame_FindToolbar(p,a,b,c) ICOM_CALL3(FindToolbar,p,a,b,c)
#endif
#endif
/* __WINE_WINE_OBJ_IDOCKINGWINDOWFRAME_H */
include/wine/obj_extracticon.h
0 → 100644
View file @
8e7cb4db
/************************************************************
* IExtractIconA
*/
#ifndef __WINE_WINE_OBJ_IEXTRACTICONA_H
#define __WINE_WINE_OBJ_IEXTRACTICONA_H
#include "winbase.h"
#include "winuser.h"
#include "wine/obj_base.h"
DEFINE_SHLGUID
(
IID_IExtractIconA
,
0x000214EBL
,
0
,
0
);
DEFINE_SHLGUID
(
IID_IExtractIconW
,
0x000214FAL
,
0
,
0
);
typedef
struct
IExtractIconA
IExtractIconA
,
*
LPEXTRACTICONA
;
/* GetIconLocation() input flags*/
#define GIL_OPENICON 0x0001
/* allows containers to specify an "open" look */
#define GIL_FORSHELL 0x0002
/* icon is to be displayed in a ShellFolder */
#define GIL_ASYNC 0x0020
/* this is an async extract, return E_ASYNC */
/* GetIconLocation() return flags */
#define GIL_SIMULATEDOC 0x0001
/* simulate this document icon for this */
#define GIL_PERINSTANCE 0x0002
/* icons from this class are per instance (each file has its own) */
#define GIL_PERCLASS 0x0004
/* icons from this class per class (shared for all files of this type) */
#define GIL_NOTFILENAME 0x0008
/* location is not a filename, must call ::ExtractIcon */
#define GIL_DONTCACHE 0x0010
/* this icon should not be cached */
#define ICOM_INTERFACE IExtractIconA
#define IExtractIconA_METHODS \
ICOM_METHOD5(HRESULT, GetIconLocation, UINT, uFlags, LPSTR, szIconFile, UINT, cchMax, INT*, piIndex, UINT *, pwFlags) \
ICOM_METHOD5(HRESULT, Extract, LPCSTR, pszFile, UINT, nIconIndex, HICON*, phiconLarge, HICON*, phiconSmall, UINT, nIconSize)
#define IExtractIconA_IMETHODS \
IUnknown_IMETHODS \
IExtractIconA_METHODS
ICOM_DEFINE
(
IExtractIconA
,
IUnknown
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
#define IExtractIconA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IExtractIconA_AddRef(p) ICOM_CALL(AddRef,p)
#define IExtractIconA_Release(p) ICOM_CALL(Release,p)
#define IExtractIconA_GetIconLocation(p,a,b,c,d,e) ICOM_CALL5(GetIconLocation,p,a,b,c,d,e)
#define IExtractIconA_Extract(p,a,b,c,d,e) ICOM_CALL5(Extract,p,a,b,c,d,e)
#endif
#define IExtractIcon IExtractIconA
#endif
/* __WINE_WINE_OBJ_IEXTRACTICONA_H */
include/wine/obj_shellbrowser.h
0 → 100644
View file @
8e7cb4db
/************************************************************
* IShellBrowser
*/
#ifndef __WINE_WINE_OBJ_ISHELLBROWSER_H
#define __WINE_WINE_OBJ_ISHELLBROWSER_H
#include "winbase.h"
#include "winuser.h"
#include "wine/obj_base.h"
#include "wine/obj_inplace.h"
/* IOleWindow */
#include "wine/obj_shellview.h"
/* IShellView */
#include "commctrl.h"
/* TBBUTTON */
/* it's ok commented out, see obj_shellview.h
typedef struct IShellBrowser IShellBrowser, *LPSHELLBROWSER;
*/
DEFINE_SHLGUID
(
IID_IShellBrowser
,
0x000214E2L
,
0
,
0
);
#define SID_SShellBrowser IID_IShellBrowser
/* targets for GetWindow/SendControlMsg */
#define FCW_STATUS 0x0001
#define FCW_TOOLBAR 0x0002
#define FCW_TREE 0x0003
#define FCW_INTERNETBAR 0x0006
#define FCW_PROGRESS 0x0008
/* wFlags for BrowseObject*/
#define SBSP_DEFBROWSER 0x0000
#define SBSP_SAMEBROWSER 0x0001
#define SBSP_NEWBROWSER 0x0002
#define SBSP_DEFMODE 0x0000
#define SBSP_OPENMODE 0x0010
#define SBSP_EXPLOREMODE 0x0020
#define SBSP_ABSOLUTE 0x0000
#define SBSP_RELATIVE 0x1000
#define SBSP_PARENT 0x2000
#define SBSP_NAVIGATEBACK 0x4000
#define SBSP_NAVIGATEFORWARD 0x8000
#define SBSP_ALLOW_AUTONAVIGATE 0x10000
#define SBSP_INITIATEDBYHLINKFRAME 0x80000000
#define SBSP_REDIRECT 0x40000000
#define SBSP_WRITENOHISTORY 0x08000000
/* uFlage for SetToolbarItems */
#define FCT_MERGE 0x0001
#define FCT_CONFIGABLE 0x0002
#define FCT_ADDTOEND 0x0004
/* undocumented, found in the web posted by Chris Becke */
#define CWM_SETPATH (WM_USER+2)
#define CWM_WANTIDLE (WM_USER+3)
#define CWM_GETSETCURRENTINFO (WM_USER+4)
#define CWM_SELECTITEM (WM_USER+5)
#define CWM_STOPWAITING (WM_USER+6)
#define CWM_GETISHELLBROWSER (WM_USER+7)
#define ICOM_INTERFACE IShellBrowser
#define IShellBrowser_METHODS \
ICOM_METHOD2(HRESULT, InsertMenusSB, HMENU, hmenuShared, LPOLEMENUGROUPWIDTHS, lpMenuWidths) \
ICOM_METHOD3(HRESULT, SetMenuSB, HMENU, hmenuShared, HOLEMENU, holemenuReserved, HWND, hwndActiveObject) \
ICOM_METHOD1(HRESULT, RemoveMenusSB, HMENU, hmenuShared) \
ICOM_METHOD1(HRESULT, SetStatusTextSB, LPCOLESTR, lpszStatusText) \
ICOM_METHOD1(HRESULT, EnableModelessSB, BOOL, fEnable) \
ICOM_METHOD2(HRESULT, TranslateAcceleratorSB, LPMSG, lpmsg, WORD, wID) \
ICOM_METHOD2(HRESULT, BrowseObject, LPCITEMIDLIST, pidl, UINT, wFlags) \
ICOM_METHOD2(HRESULT, GetViewStateStream, DWORD, grfMode, LPSTREAM*, ppStrm) \
ICOM_METHOD2(HRESULT, GetControlWindow, UINT, id, HWND*, lphwnd) \
ICOM_METHOD5(HRESULT, SendControlMsg, UINT, id, UINT, uMsg, WPARAM, wParam, LPARAM, lParam, LRESULT*, pret) \
ICOM_METHOD1(HRESULT, QueryActiveShellView, IShellView**, IShellView) \
ICOM_METHOD1(HRESULT, OnViewWindowActive, IShellView*, IShellView) \
ICOM_METHOD3(HRESULT, SetToolbarItems, LPTBBUTTON, lpButtons, UINT, nButtons, UINT, uFlags)
#define IShellBrowser_IMETHODS \
IOleWindow_IMETHODS \
IShellBrowser_METHODS
ICOM_DEFINE
(
IShellBrowser
,
IOleWindow
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
#define IShellBrowser_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IShellBrowser_AddRef(p) ICOM_CALL(AddRef,p)
#define IShellBrowser_Release(p) ICOM_CALL(Release,p)
#define IShellBrowser_GetWindow(p,a) ICOM_CALL1(GetWindow,p,a)
#define IShellBrowser_ContextSensitiveHelp(p,a) ICOM_CALL1(ContextSensitiveHelp,p,a)
#define IShellBrowser_InsertMenusSB(p,a,b) ICOM_CALL2(InsertMenusSB,p,a,b)
#define IShellBrowser_SetMenuSB(p,a,b,c) ICOM_CALL3(SetMenuSB,p,a,b,c)
#define IShellBrowser_RemoveMenusSB(p,a) ICOM_CALL1(RemoveMenusSB,p,a)
#define IShellBrowser_SetStatusTextSB(p,a) ICOM_CALL1(SetStatusTextSB,p,a)
#define IShellBrowser_EnableModelessSB(p,a) ICOM_CALL1(EnableModelessSB,p,a)
#define IShellBrowser_TranslateAcceleratorSB(p,a,b) ICOM_CALL2(TranslateAcceleratorSB,p,a,b)
#define IShellBrowser_BrowseObject(p,a,b) ICOM_CALL2(BrowseObject,p,a,b)
#define IShellBrowser_GetViewStateStream(p,a,b) ICOM_CALL2(GetViewStateStream,p,a,b)
#define IShellBrowser_GetControlWindow(p,a,b) ICOM_CALL2(GetControlWindow,p,a,b)
#define IShellBrowser_SendControlMsg(p,a,b,c,d,e) ICOM_CALL5(SendControlMsg,p,a,b,c,d,e)
#define IShellBrowser_QueryActiveShellView(p,a) ICOM_CALL1(QueryActiveShellView,p,a)
#define IShellBrowser_OnViewWindowActive(p,a) ICOM_CALL1(OnViewWindowActive,p,a)
#define IShellBrowser_SetToolbarItems(p,a,b,c) ICOM_CALL3(SetToolbarItems,p,a,b,c)
#endif
#endif
/* __WINE_WINE_OBJ_ISHELLBROWSER_H */
include/wine/obj_shellextinit.h
0 → 100644
View file @
8e7cb4db
/************************************************************
* IShellExtInit
*/
#ifndef __WINE_WINE_OBJ_ISHELLEXTINIT_H
#define __WINE_WINE_OBJ_ISHELLEXTINIT_H
#include "winbase.h"
#include "winuser.h"
#include "wine/obj_base.h"
#include "wine/obj_dataobject.h"
typedef
struct
IShellExtInit
IShellExtInit
,
*
LPSHELLEXTINIT
;
DEFINE_SHLGUID
(
IID_IShellExtInit
,
0x000214E8L
,
0
,
0
);
#define ICOM_INTERFACE IShellExtInit
#define IShellExtInit_METHODS \
ICOM_METHOD3(HRESULT, Initialize, LPCITEMIDLIST, pidlFolder, LPDATAOBJECT, lpdobj, HKEY, hkeyProgID)
#define IShellExtInit_IMETHODS \
IUnknown_IMETHODS \
IShellExtInit_METHODS
ICOM_DEFINE
(
IShellExtInit
,
IUnknown
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
#define IShellExtInit_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IShellExtInit_AddRef(p) ICOM_CALL(AddRef,p)
#define IShellExtInit_Release(p) ICOM_CALL(Release,p)
#define IShellExtInit_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
#endif
#endif
/* __WINE_WINE_OBJ_ISHELLEXTINIT_H */
include/wine/obj_shellfolder.h
View file @
8e7cb4db
...
...
@@ -88,6 +88,45 @@ typedef enum tagSHCONTF
#define SFGAO_REMOVABLE 0x02000000L
/* is this removeable media? */
/************************************************************************
*
* FOLDERSETTINGS
*/
typedef
LPBYTE
LPVIEWSETTINGS
;
/* NB Bitfields. */
/* FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL */
typedef
enum
{
FWF_AUTOARRANGE
=
0x0001
,
FWF_ABBREVIATEDNAMES
=
0x0002
,
FWF_SNAPTOGRID
=
0x0004
,
FWF_OWNERDATA
=
0x0008
,
FWF_BESTFITWINDOW
=
0x0010
,
FWF_DESKTOP
=
0x0020
,
FWF_SINGLESEL
=
0x0040
,
FWF_NOSUBFOLDERS
=
0x0080
,
FWF_TRANSPARENT
=
0x0100
,
FWF_NOCLIENTEDGE
=
0x0200
,
FWF_NOSCROLL
=
0x0400
,
FWF_ALIGNLEFT
=
0x0800
,
FWF_SINGLECLICKACTIVATE
=
0x8000
/* TEMPORARY -- NO UI FOR THIS */
}
FOLDERFLAGS
;
typedef
enum
{
FVM_ICON
=
1
,
FVM_SMALLICON
=
2
,
FVM_LIST
=
3
,
FVM_DETAILS
=
4
}
FOLDERVIEWMODE
;
typedef
struct
{
UINT
ViewMode
;
/* View mode (FOLDERVIEWMODE values) */
UINT
fFlags
;
/* View options (FOLDERFLAGS bits) */
}
FOLDERSETTINGS
,
*
LPFOLDERSETTINGS
;
typedef
const
FOLDERSETTINGS
*
LPCFOLDERSETTINGS
;
/************************************************************************
* Desktopfolder
*/
...
...
@@ -133,7 +172,7 @@ ICOM_DEFINE(IShellFolder,IUnknown)
#define IShellFolder_GetUIObjectOf(p,a,b,c,d,e,f) ICOM_CALL6(GetUIObjectOf,p,a,b,c,d,e,f)
#define IShellFolder_GetDisplayNameOf(p,a,b,c) ICOM_CALL3(GetDisplayNameOf,p,a,b,c)
#define IShellFolder_SetNameOf(p,a,b,c,d,e) ICOM_CALL5(SetNameOf,p,a,b,c,d,e)
#define IShellFolder_GetFolderPath(p,a,b) ICOM_CALL2(Get
DisplayNameOf
,p,a,b)
#define IShellFolder_GetFolderPath(p,a,b) ICOM_CALL2(Get
FolderPath
,p,a,b)
#endif
/*****************************************************************************
...
...
include/wine/obj_shellview.h
0 → 100644
View file @
8e7cb4db
/************************************************************
* IShellView
*/
#ifndef __WINE_WINE_OBJ_ISHELLVIEW_H
#define __WINE_WINE_OBJ_ISHELLVIEW_H
#include "winbase.h"
#include "winuser.h"
#include "wine/obj_base.h"
#include "wine/obj_inplace.h"
#include "wine/obj_shellfolder.h"
#include "prsht.h"
/* LPFNADDPROPSHEETPAGE */
/****************************************************************************
* IShellBrowser is here defined because of a cyclic dependance between
* IShellBrowser and IShellView
*/
typedef
struct
IShellBrowser
IShellBrowser
,
*
LPSHELLBROWSER
;
DEFINE_SHLGUID
(
IID_IShellView
,
0x000214E3L
,
0
,
0
);
typedef
struct
IShellView
IShellView
,
*
LPSHELLVIEW
;
/* shellview select item flags*/
#define SVSI_DESELECT 0x0000
#define SVSI_SELECT 0x0001
#define SVSI_EDIT 0x0003
/* includes select */
#define SVSI_DESELECTOTHERS 0x0004
#define SVSI_ENSUREVISIBLE 0x0008
#define SVSI_FOCUSED 0x0010
/* shellview get item object flags */
#define SVGIO_BACKGROUND 0x00000000
#define SVGIO_SELECTION 0x00000001
#define SVGIO_ALLVIEW 0x00000002
/* The explorer dispatches WM_COMMAND messages based on the range of
command/menuitem IDs. All the IDs of menuitems that the view (right
pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
won't dispatch them). The view should not deal with any menuitems
in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
version of the shell).
FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView)
FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser)
FCIDM_GLOBAL/LAST for the explorer's submenu IDs
*/
#define FCIDM_SHVIEWFIRST 0x0000
/* undocumented */
#define FCIDM_SHVIEW_ARRANGE 0x7001
#define FCIDM_SHVIEW_DELETE 0x7011
#define FCIDM_SHVIEW_PROPERTIES 0x7013
#define FCIDM_SHVIEW_CUT 0x7018
#define FCIDM_SHVIEW_COPY 0x7019
#define FCIDM_SHVIEW_INSERT 0x701A
#define FCIDM_SHVIEW_UNDO 0x701B
#define FCIDM_SHVIEW_INSERTLINK 0x701C
#define FCIDM_SHVIEW_SELECTALL 0x7021
#define FCIDM_SHVIEW_INVERTSELECTION 0x7022
#define FCIDM_SHVIEW_BIGICON 0x7029
#define FCIDM_SHVIEW_SMALLICON 0x702A
#define FCIDM_SHVIEW_LISTVIEW 0x702B
#define FCIDM_SHVIEW_REPORTVIEW 0x702C
#define FCIDM_SHVIEW_AUTOARRANGE 0x7031
#define FCIDM_SHVIEW_SNAPTOGRID 0x7032
#define FCIDM_SHVIEW_HELP 0x7041
#define FCIDM_SHVIEWLAST 0x7fff
#define FCIDM_BROWSERFIRST 0xA000
/* undocumented toolbar items from stddlg's*/
#define FCIDM_TB_SMALLICON 0xA003
#define FCIDM_TB_REPORTVIEW 0xA004
#define FCIDM_BROWSERLAST 0xbf00
#define FCIDM_GLOBALFIRST 0x8000
#define FCIDM_GLOBALLAST 0x9fff
/*
* Global submenu IDs and separator IDs
*/
#define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000)
#define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040)
#define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080)
#define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
#define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0)
#define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1)
#define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100)
#define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140)
#define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150)
#define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170)
/* control IDs known to the view */
#define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0)
#define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1)
/* uState values for IShellView::UIActivate */
typedef
enum
{
SVUIA_DEACTIVATE
=
0
,
SVUIA_ACTIVATE_NOFOCUS
=
1
,
SVUIA_ACTIVATE_FOCUS
=
2
,
SVUIA_INPLACEACTIVATE
=
3
/* new flag for IShellView2 */
}
SVUIA_STATUS
;
#define ICOM_INTERFACE IShellView
#define IShellView_METHODS \
ICOM_METHOD1(HRESULT, TranslateAccelerator, LPMSG, lpmsg) \
ICOM_METHOD1(HRESULT, EnableModeless, BOOL, fEnable) \
ICOM_METHOD1(HRESULT, UIActivate, UINT, uState) \
ICOM_METHOD(HRESULT, Refresh) \
ICOM_METHOD5(HRESULT, CreateViewWindow, IShellView*, lpPrevView, LPCFOLDERSETTINGS, lpfs, IShellBrowser*, psb, RECT*, prcView, HWND*, phWnd) \
ICOM_METHOD(HRESULT, DestroyViewWindow) \
ICOM_METHOD1(HRESULT, GetCurrentInfo, LPFOLDERSETTINGS, lpfs) \
ICOM_METHOD3(HRESULT, AddPropertySheetPages, DWORD, dwReserved, LPFNADDPROPSHEETPAGE, lpfn, LPARAM, lparam) \
ICOM_METHOD (HRESULT, SaveViewState) \
ICOM_METHOD2(HRESULT, SelectItem, LPCITEMIDLIST, pidlItem, UINT, uFlags) \
ICOM_METHOD3(HRESULT, GetItemObject, UINT, uItem, REFIID, riid, LPVOID*, ppv)
#define IShellView_IMETHODS \
IOleWindow_IMETHODS \
IShellView_METHODS
ICOM_DEFINE
(
IShellView
,
IOleWindow
)
#undef ICOM_INTERFACE
#ifdef ICOM_CINTERFACE
#define IShellView_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IShellView_AddRef(p) ICOM_CALL(AddRef,p)
#define IShellView_Release(p) ICOM_CALL(Release,p)
#define IShellView_GetWindow(p,a) ICOM_CALL1(GetWindow,p,a)
#define IShellView_ContextSensitiveHelp(p,a) ICOM_CALL1(ContextSensitiveHelp,p,a)
#define IShellView_TranslateAccelerator(p,a) ICOM_CALL1(TranslateAccelerator,p,a)
#define IShellView_EnableModeless(p,a) ICOM_CALL1(EnableModeless,p,a)
#define IShellView_UIActivate(p,a) ICOM_CALL1(UIActivate,p,a)
#define IShellView_Refresh(p) ICOM_CALL(Refresh,p)
#define IShellView_CreateViewWindow(p,a,b,c,d,e) ICOM_CALL5(CreateViewWindow,p,a,b,c,d,e)
#define IShellView_DestroyViewWindow(p) ICOM_CALL(DestroyViewWindow,p)
#define IShellView_GetCurrentInfo(p,a) ICOM_CALL1(GetCurrentInfo,p,a)
#define IShellView_AddPropertySheetPages(p,a,b,c) ICOM_CALL3(AddPropertySheetPages,p,a,b,c)
#define IShellView_SaveViewState(p) ICOM_CALL(SaveViewState,p)
#define IShellView_SelectItem(p,a,b) ICOM_CALL2(SelectItem,p,a,b)
#define IShellView_GetItemObject(p,a,b,c) ICOM_CALL3(GetItemObject,p,a,b,c)
#endif
#endif
/* __WINE_WINE_OBJ_ISHELLVIEW_H */
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