Buy now, 799$, online ordering, delivery by email

Partial source code

This source code is included on the web site because it is considered of general use, not only to users of NSELib.

The included file makes undocumented Windows Shell functionality available. Furthermore, it makes newly documented functionality available to users who have an older version of the Platform SDK.

ShlExt.h

//==========================================================================
// File : shlext.h
//
// Some general definitions
//
// Author : Henk Devos / Andrew Le Bihan
//
//
// This file is part of the NSELib library.
// NSELib can be found on the web on this URL:
// http://www.whirlingdervishes.com/nselib
//
// This file can be considered to be in the public domain.
// The latest version can normally be found here:
// http://www.whirlingdervishes.com/nselib/public
// The file is based on various sources, and includes definitions
// that were taken over from various places, including
// Microsoft documentation and header files. It also contains
// many definitions that were introduced by Whirling Dervishes
// Software.
// Other people have maintained this file before.
// Their copyright notices are still included here.
//
// Copyright (C) 1998-2003 Whirling Dervishes Software
//
// This software is provided 'as-is', without any express or implied
// warranty.  In no event will the authors be held liable for any damages
// arising from the use of this software.
//
//==========================================================================


///////////////////////////////////////////////////////////////////////
//
//	shlext.h
//
//	Definitions of Undocumented Shell Structures
//
//  The latest copy of this file should be available at:
//  
//
//  History:
//    februari 2003: Henk Devos: Made compatible with the
//                   october 2003 Platform SDK
//    januari 2003: Henk Devos: added some more undefined flags,
//                  including the ones for CDefFolderMenu_Create2.
//    september 2002: Henk Devos: Made compatible with new Platform SDK
//    januari 2002: Henk Devos: Added comments with ordinals of 
//    all exports in Windows 2000 version of shell32.dll
//    24/06/99  Some changes made by Henk Devos
//    20/11/97  Removed IID_IShellUndoc (was actually IID_IDropTarget!)
//    20/11/97  Chopped further irrelevant CABVIEW related items
//    19/11/97	Added some dox for SHShellFolderView_Message
//    15/11/97  Fixed IShellDetails interface
//     7/10/97	removed stuff already availible in  and 
//     7/10/97	documented some ILxxx Functions, added annotations. changed
//              SHCreateShellViewEx structure with new info...
//    25/ 2/97  added default shell menu id's
//    22/ 2/97  removed cabobj - suppose this makes us incompatable with vc prior to 4.2
//    24/ 1/97  added annotations. minor mod's
//     9/ 1/97  changed SHCreateShellViewEx structure with new info...
//    13/12/96  added _all_ the undocumented shell32 exports
//    12/12/96  removed the IShellViewCallback Class
//    ??/??/??  added the stuff hacked from the CABView example MS released
//
//  If you have any changes to make to this file, feel free to mail them
//  to me at , so I can integrate them with the
//  original available on my homepage.
//
///////////////////////////////////////////////////////////////////////
#ifndef _SHLEXT_H_
#define _SHLEXT_H_

#include 

// This version of shlext.h complies with the october 2002 
// platform sdk. If you have this sdk, everything should work.
// If you have the september 2002 version, it should also work.
// If you don't have this one, you have to define OLD_PLATFORM_SDK
// to make it compile. Furthermore you will have to link with the
// shell32.lib import library from the september or october 2002
// platform sdk.

//#define OLD_PLATFORM_SDK

#ifdef __cplusplus
extern "C" {
#endif

// These definitions are taken from ShLwApi.h
// for users who don't have this yes.
// This header defines the functions that are in the newer versions
// of the Platform SDK. The newer definitions are copied from the
// Platform SDK.
// Users who don't have this newer SDK will need to do the linking
// to these functions themselves. The ordinals are at the end of this header.
#ifndef LWSTDAPI
#define LWSTDAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
#endif
#ifndef LWSTDAPI_
#define LWSTDAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
#endif
#ifndef LWSTDAPIV
#define LWSTDAPIV         EXTERN_C DECLSPEC_IMPORT HRESULT STDAPIVCALLTYPE
#endif
#ifndef LWSTDAPIV_
#define LWSTDAPIV_(type)  EXTERN_C DECLSPEC_IMPORT type STDAPIVCALLTYPE
#endif


#ifndef SHSTDAPI
#define SHSTDAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
#define SHSTDAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
#endif // SHSTDAPI



// Here i'm doing a bad thing, but its a damn pain trying to get the
// include order sorted out otherwise
#define DEFINE_SHLGUID(name, l, w1, w2) DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)

//
// Interface IDs    xx=E0-FF
//
// Missing IID's: E0, E7, F4-FF
DEFINE_SHLGUID(IID_IShellDetails,         0x000214ECL, 0, 0);
DEFINE_SHLGUID(IID_IDelayedRelease,       0x000214EDL, 0, 0);

//The Briefcase is a shell extension...
DEFINE_GUID(IID_IBriefcaseStg,            0x8BCE1FA1L, 0x0921, 0x101B, 0xB1, 0xFF, 0x00, 0xDD, 0x01, 0x0C, 0xCC, 0x48);
DEFINE_GUID(IID_IShellDirectory,          0xF3364BA0L, 0x65B9, 0x11CE, 0xA9, 0xBA, 0x00, 0xAA, 0x00, 0x4A, 0xE8, 0x37);

// This GUID is dedfined in the Platform SDK but
// the interface definition is not.
DEFINE_GUID(IID_IDelegateFolder,        0xADD8BA80L, 0x002B, 0x11D0, 0x8F, 0x0F, 0x00, 0xC0, 0x4F, 0xD7, 0xD0, 0x62);

///////////////////////////////////////////////////////////////////////
// typeDefine the undocumented interfaces
//
typedef interface IShellDetails      IShellDetails;


//==========================================================================
// Stuff used by the IShellBrowser/IShellView objects.
//==========================================================================

// Defines the range of command IDs used by view windows.
//		FCIDM_SHVIEWFIRST/LAST	for the right pane (IShellView)
#define FCIDM_SHVIEWFIRST           0x0000
#define FCIDM_SHVIEWLAST            0x7fff
//		FCIDM_BROWSERFIRST/LAST	for the explorer frame (IShellBrowser)
#define FCIDM_BROWSERFIRST          0xa000
#define FCIDM_BROWSERLAST           0xbf00
//		FCIDM_GLOBAL/LAST		for the explorer's submenu IDs
#define FCIDM_GLOBALFIRST           0x8000
#define FCIDM_GLOBALLAST            0x9fff

// Global submenu 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_TOOLS	(FCIDM_GLOBALFIRST+0x00c0)
#define FCIDM_MENU_HELP		(FCIDM_GLOBALFIRST+0x0100)

// The shell handles internally all the following ID's without calling
// InvokeCommand()
#define FCIDM_SHVIEWSHELL           0x7000

// File menu options
#define FCIDM_MENU_FILE_CREATESHORTCUT   (FCIDM_SHVIEWSHELL + 0x0010) //28688
#define FCIDM_MENU_FILE_DELETE           (FCIDM_SHVIEWSHELL + 0x0011) //28689
#define FCIDM_MENU_FILE_RENAME           (FCIDM_SHVIEWSHELL + 0x0012) //28690
#define FCIDM_MENU_FILE_PROPERTIES       (FCIDM_SHVIEWSHELL + 0x0013) //28691

// Edit menu options
#define FCIDM_MENU_EDIT_CUT              (FCIDM_SHVIEWSHELL + 0x0018) //28696
#define FCIDM_MENU_EDIT_COPY             (FCIDM_SHVIEWSHELL + 0x0019) //28697
#define FCIDM_MENU_EDIT_PASTE            (FCIDM_SHVIEWSHELL + 0x001A) //28698
#define FCIDM_MENU_EDIT_UNDO             (FCIDM_SHVIEWSHELL + 0x001B) //28699
#define FCIDM_MENU_EDIT_PASTESHORTCUT    (FCIDM_SHVIEWSHELL + 0x001C) //28700

// View Report styles
#define FCIDM_MENU_VIEW_SELECTALL        (FCIDM_SHVIEWSHELL + 0x0021) //28705
#define FCIDM_MENU_VIEW_INVERTSELECTION  (FCIDM_SHVIEWSHELL + 0x0022) //28706

#define FCIDM_MENU_VIEW_LARGEICONS       (FCIDM_SHVIEWSHELL + 0x0029) //28713
#define FCIDM_MENU_VIEW_SMALLICONS       (FCIDM_SHVIEWSHELL + 0x002A) //28714
#define FCIDM_MENU_VIEW_LIST             (FCIDM_SHVIEWSHELL + 0x002B) //28715
#define FCIDM_MENU_VIEW_DETAILS          (FCIDM_SHVIEWSHELL + 0x002C) //28716

#define FCIDM_MENU_VIEW_AUTOARRANGE      (FCIDM_SHVIEWSHELL + 0x0031) //28721
#define FCIDM_MENU_VIEW_LINEUPICONS      (FCIDM_SHVIEWSHELL + 0x0032) //28722

// Help menu
#define FCIDM_MENU_HELP_HELPTOPICS       (FCIDM_SHVIEWSHELL + 0x0041) //28737

//typedef LPBYTE LPVIEWSETTINGS;

// Values for uWindow parameter of GetWindow/GetWindowRect member function.
#define FCW_STATUS              0x0001
#define FCW_TOOLBAR             0x0002

// SetToolbarItems flags
#define FCT_MERGE               0x0001
#define FCT_CONFIGABLE		0x0002
#define FCT_ADDTOEND		0x0004

// 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 SFVID_FIRST (FCIDM_SHVIEWFIRST + 0x2000)
#define SFVID_LAST  (FCIDM_SHVIEWFIRST + 0x3000)

#define SFVID_MEN U_ARRANGE (SFVID_FIRST + 0x000)


//Column Info for IShellDetails & ShellView CallBack
typedef struct
{
	DWORD   fJustify;
	INT	nWidth;
	STRRET	text;
} SHColInfo, *PSHCOLINFO;

/////////////////////////////////////////////////////////////////////////////
// ShellFolderViewCallback

typedef HRESULT(CALLBACK *SHELLVIEWPROC)(
  DWORD dwUserParam,
  LPSHELLFOLDER psf,
  HWND hwnd,
  UINT uMsg,
  WPARAM wParam,
  LPARAM lParam);


typedef struct tag_SFVCB_COLUMNINFOSTRUCT
{
  LPCITEMIDLIST pidl;  // NULL if column header requested, else
                       // a simple pidl to the item whose details are needed.
  SHColInfo	sci;   // return filled in with the details.
} SFVCB_COLUMNINFOSTRUCT, *LPSFVCB_COLUMNINFOSTRUCT;

typedef const SFVCB_COLUMNINFOSTRUCT *LPCSFVCB_COLUMNINFOSTRUCT;

typedef struct tag_SFVCB_TOOLBARINFO
{
	DWORD dwNumItems;
	UINT uFlags;
} SFVCB_TOOLBARINFO;

/*typedef struct tag_SFVCB_TOOLBARBUTTONINFO
{
	DWORD dwBitmap; //bitmap index
	DWORD dwCommand; // command id
	DWORD dwFlags; // 4 for normal button, 104 for separator
	DWORD reserved1; // 0
	DWORD reserved2; // -1
} SFVCB_TOOLBARBUTTONINFO;*/

typedef struct tag_SFVCB_SELECTINFO
{
	UINT uOldState; // 0
	UINT uNewState; //LVIS_SELECTED, LVIS_FOCUSED,...
	LPITEMIDLIST pidl;
} SFVCB_SELECTINFO;



// This is the menuinfo from psdk
// The last member seems to be interpreted differently
#ifdef OLD_PLATFORM_SDK
#define QCMINFO_PLACE_BEFORE    0
#define QCMINFO_PLACE_AFTER     1
typedef struct _QCMINFO_IDMAP_PLACEMENT
{
    UINT id;
    UINT fFlags;
} QCMINFO_IDMAP_PLACEMENT;

typedef struct _QCMINFO_IDMAP
{
    UINT                    nMaxIds;
    QCMINFO_IDMAP_PLACEMENT pIdList[1];
} QCMINFO_IDMAP;

typedef struct _QCMINFO
{
    HMENU       hmenu;          // in
    UINT        indexMenu;      // in
    UINT        idCmdFirst;     // in/out
    UINT        idCmdLast;      // in
    QCMINFO_IDMAP const*  pIdMap; // in / unused
} QCMINFO;
typedef QCMINFO * LPQCMINFO;
#endif

// This is my old version
typedef struct tagSFVCB_ADDTOMENUINFO
{
	HMENU hmenu;
	UINT indexMenu;
	UINT idCmdFirst;
	UINT idCmdLast;
	UINT uFlags;
} SFVCB_ADDTOMENUINFO;


#ifdef OLD_PLATFORM_SDK
// TBINFO flags
#define TBIF_APPEND     0
#define TBIF_PREPEND    1
#define TBIF_REPLACE    2
#define TBIF_DEFAULT      0x00000000
#define TBIF_INTERNETBAR  0x00010000
#define TBIF_STANDARDTOOLBAR   0x00020000
#define TBIF_NOTOOLBAR  0x00030000

typedef struct _TBINFO
{
    UINT        cbuttons;       // out
    UINT        uFlags;         // out (one of TBIF_ flags)
} TBINFO;


typedef struct _DETAILSINFO
{
    LPCITEMIDLIST pidl;
    int fmt;
    int cxChar;
    STRRET str;
    int iImage;
} DETAILSINFO;

typedef struct _SFVM_PROPPAGE_DATA
{
    DWORD                dwReserved;
    LPFNADDPROPSHEETPAGE pfn;
    LPARAM               lParam;
} SFVM_PROPPAGE_DATA;

typedef struct _SFVM_HELPTOPIC_DATA
{
    WCHAR wszHelpFile[MAX_PATH];
    WCHAR wszHelpTopic[MAX_PATH];
} SFVM_HELPTOPIC_DATA;

#endif // OLD_PLATFORM_SDK


// Interfaces used by the Windows XP def view callback messages
// (for folder tasks and related places)
#undef  INTERFACE
#define INTERFACE   IEnumShellItems

DECLARE_INTERFACE_(IEnumShellItems, IUnknown)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

    // *** IEnumIDList methods ***
    STDMETHOD(Next)  (THIS_ ULONG celt,
                      IShellItem **rgelt,
                      ULONG *pceltFetched) PURE;
    STDMETHOD(Skip)  (THIS_ ULONG celt) PURE;
    STDMETHOD(Reset) (THIS) PURE;
    STDMETHOD(Clone) (THIS_ IEnumShellItems **ppenum) PURE;
};

typedef IEnumShellItems FAR* LPENUMSHELLITEMS;


#undef  INTERFACE
#define INTERFACE   IShellItemArray

DECLARE_INTERFACE_(IShellItemArray, IUnknown)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

	// IShellItemArray methods
	STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID rbhid, REFIID riid, void **ppvOut)PURE;
	STDMETHOD(GetAttrributes)(int nEnum, DWORD dwRequested, DWORD *pdwResult) PURE;
	STDMETHOD(GetCount)(UINT *pCount) PURE;
	STDMETHOD(GetItemAt)(UINT nIndex, IShellItem **ppItem) PURE;
	STDMETHOD(EnumItems)(IEnumShellItems **) PURE;
};

typedef IShellItemArray FAR* LPSHELLITEMARRAY;



#undef  INTERFACE
#define INTERFACE   IUIElement

DECLARE_INTERFACE_(IUIElement, IUnknown)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

	// IUIElement methods
	STDMETHOD(get_Name)(THIS_ IShellItemArray *pItemArray, BSTR *bstrName) PURE;
	STDMETHOD(get_Icon)(THIS_ IShellItemArray *pItemArray, BSTR *bstrName) PURE;
	STDMETHOD(get_Tooltip)(THIS_ IShellItemArray *pItemArray, BSTR *bstrName) PURE;
};

typedef IUIElement FAR* LPUIELEMENT;

enum UISTATE
{
	FLAG1
};

#undef  INTERFACE
#define INTERFACE   IUICommand

DECLARE_INTERFACE_(IUICommand, IUIElement)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

	// IUIElement methods
	STDMETHOD(get_Name)(THIS_ IShellItemArray *pItemArray, BSTR *bstrName) PURE;
	STDMETHOD(get_Icon)(THIS_ IShellItemArray *pItemArray, BSTR *bstrName) PURE;
	STDMETHOD(get_Tooltip)(THIS_ IShellItemArray *pItemArray, BSTR *bstrName) PURE;

	// IUICommand methods
	STDMETHOD(get_CanonicalName)(THIS_ GUID *pGuid) PURE;
	STDMETHOD(get_State)(THIS_ IShellItemArray *pItemArray, int nRequested, enum UISTATE *pState) PURE;
	STDMETHOD(Invoke)(THIS_ IShellItemArray *pItemArray, IBindCtx *pCtx) PURE;
};

typedef IUICommand FAR* LPUICOMMAND;

#undef  INTERFACE
#define INTERFACE   IEnumUICommand

DECLARE_INTERFACE_(IEnumUICommand, IUnknown)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

    // *** IEnumUICommand methods ***
    STDMETHOD(Next)  (THIS_ ULONG celt,
                      LPUICOMMAND *rgelt,
                      ULONG *pceltFetched) PURE;
    STDMETHOD(Skip)  (THIS_ ULONG celt) PURE;
    STDMETHOD(Reset) (THIS) PURE;
    STDMETHOD(Clone) (THIS_ IEnumUICommand **ppenum) PURE;
};




//                                 uMsg    wParam             lParam
// psdk
#define SFVM_MERGEMENU             1    // -                  LPQCMINFO
//#define SFVCB_ADDTOMENU           0x0001
// wParam is 0
// lParam points to a SFVCB_ADDMENUINFO struct
// Explorer implementations check if wParam is 0 and
// only do the merge in that case
// return NOERROR.

// psdk
#define SFVM_INVOKECOMMAND         2    // idCmd              -
//#define SFVCB_INVOKECOMMAND       0x0002
// When a toolbar button is clicked
// wParam : the command ID
// lParam : 0
//#define SFVCB_SELCHANGE     0x08

// psdk
#define SFVM_GETHELPTEXT           3    // idCmd,cchMax       pszText
//#define SFVCB_GETMENUHELP         0x0003

// psdk
#define SFVM_GETTOOLTIPTEXT        4    // idCmd,cchMax       pszText
//#define SFVCB_GETTOOLBARTIP       0x0004

// psdk
#define SFVM_GETBUTTONINFO         5    // -                  LPTBINFO
//#define SFVCB_GETTOOLBARINFO      0x0005
// Called when merging the toolbar
// wParam : 0
// lParam : pointer to struct SFVCB_TOOLBARINFO

// psdk
#define SFVM_GETBUTTONS            6    // idCmdFirst,cbtnMax LPTBBUTTON
//#define SFVCB_ADDTOOLBARITEMS     0x0006
// wParam : LOWORD is the first ID (add your own ID's to this)
// lParam : pointer to array of SFVCB_TOOLBARBUTTONINFO structs

// psdk
#define SFVM_INITMENUPOPUP         7    // idCmdFirst,nIndex  hmenu
//#define SFVCB_INITMENUPOPUP       0x0007

// undoc
#define SFVM_SELECTIONCHANGED    8
//#define SFVCB_SELECTIONCHANGED    0x0008
// When the selection state of an item is changed (i.e. an item is selcted or deselected)
// wParam : ???
// lParam : pointer to a SFVCB_SELECTINFO struct

// undoc
#define SFVM_DRAWMENUITEM        9
//#define SFVCB_DRAWMENUITEM        0x0009

// undoc
#define SFVM_MEASUREMENUITEM     10
//#define SFVCB_MEASUREMENUITEM     0x000A

// undoc
#define SFVM_EXITMENULOOP        11
//#define SFVCB_EXITMENULOOP        0x000B
// wParam and lParam are 0
// called when context menu exits, not main menu

// undoc
#define SFVM_VIEWRELEASE         12
//#define SFVCB_VIEWRELEASE         0x000C
// SFVM_VIEWRELEASE message indicates that the IShellView object is being
// released.
// wParam and lParam are 0.

// undoc
#define SFVM_GETNAMELENGTH       13
//#define SFVCB_GETNAMELENGTH       0x000D
// Called at start of label edit

// undoc
#define SFVM_CHANGENOTIFY        14
//#define SFVCB_CHANGENOTIFY        0x000E


// psdk
#define SFVM_WINDOWCREATED        15    // hwnd               -
//#define SFVCB_WINDOWCREATED       0x000F
// Called to indicate the view window has been created.
// wParam is the views HWND
// lParam is ???

// undoc
#define SFVM_WINDOWCLOSING       16
//#define SFVCB_WINDOWCLOSING       0x0010
// Called to indicate that the view window is being destroyed.
// wParam is the view's hWnd.
// lParam is 0.

// undoc
#define SFVM_LISTREFRESHED       17
//#define SFVCB_LISTREFRESHED       0x0011
// wParam and lParam are 0

// undoc
#define SFVM_WINDOWFOCUSED       18
//#define SFVCB_WINDOWFOCUSED       0x0012
// wParam and lParam are 0

// undoc
#define SFVM_REGISTERCOPYHOOK    19
//#define SFVCB_REGISTERCOPYHOOK    0x0014
// wParam and lParam are 0

// undoc
#define SFVM_COPYHOOKCALLBACK    21
//#define SFVCB_COPYHOOKCALLBACK    0x0015

// psdk
#define SFVM_GETDETAILSOF         23    // iColumn            DETAILSINFO*
//#define SFVCB_GETDETAILSOF        0x0017
// wParam is the index of the column
// lParam is LPSFVCB_COLUMNINFOSTRUCT
// return NOERROR if the column is valid. Else return OLE error.

// psdk
#define SFVM_COLUMNCLICK          24    // iColumn            -
//#define SFVCB_COLUMNCLICK   0x18
#define SFVM_COLUMNCLICK2   0x32
// wParam is NULL
// lParam is the column index.
// return NOERROR
// 2 is sent if IShellDetails is implemented

// psdk
#define SFVM_QUERYFSNOTIFY        25    // -                  SHChangeNotifyEntry *
//#define SFVCB_GETCHANGENOTIFYPIDL 0x0019

// psdk
#define SFVM_DEFITEMCOUNT         26    // -                  UINT*
//#define SFVCB_GETESTIMATEDCOUNT   0x001A

// psdk
#define SFVM_DEFVIEWMODE          27    // -                  FOLDERVIEWMODE*
//#define SFVCB_ADJUSTVIEWMODE      0x001B

// psdk
#define SFVM_UNMERGEMENU          28    // -                  hmenu
//#define SFVCB_REMOVEFROMMENU      0x001C

// undoc
#define SFVM_ADDINGOBJECT        29
//#define SFVCB_ADDINGOBJECT        0x001D

// undoc
#define SFVM_REMOVINGOBJECT      30
//#define SFVCB_REMOVINGOBJECT      0x001E

// psdk
#define SFVM_UPDATESTATUSBAR      31    // fInitialize        -
//#define SFVCB_UPDATESTATUSBAR     0x001F

// psdk
#define SFVM_BACKGROUNDENUM       32    // -                  -
//#define SFVCB_ISSLOWREFRESH       0x0020

// undoc
#define SFVM_GETCOMMANDDIR       33
//#define SFVCB_GETCOMMANDDIR       0x0021

// undoc
#define SFVM_GETCOLUMNSTREAM     34
//#define SFVCB_GETCOLUMNSTREAM     0x0022
// Get an IStream interface
// wParam is a STGM_READ/STGM_WRITE/STGM_READWRITE constant
// lParam is an LPSTREAM * that receives the IStream interface

// undoc
#define SFVM_CANSELECTALL        35
//#define SFVCB_CANSELECTALL        0x0023

// psdk
#define SFVM_DIDDRAGDROP          36    // dwEffect           IDataObject *
//#define SFVCB_DRAGSUCCEEDED       0x0024
// Called at the end of a drag&drop operation
// lParam is the IDataObject being dragged

// undoc
#define SFVM_ISSTRICTREFRESH     37
//#define SFVCB_ISSTRICTREFRESH     0x0025
// wParam and lParam are 0

// undoc
#define SFVM_ISCHILDOBJECT       38
//#define SFVCB_ISCHILDOBJECT       0x0026

// psdk
#define SFVM_SETISFV              39    // -                  IShellFolderView*
//#define SFVCB_SETSITE             0x0027
// wParam is 0
// lParam is the IUnknown of the site the IShellView)

// undoc
// Guessing:
#define SFVM_GETEXTVIEWS 40
//#define SFVCB_GETEXTVIEWS 0x28

// psdk
#define SFVM_THISIDLIST           41    // -                  LPITMIDLIST*

// zipfldr.dll increases a counter in reaction to this message
// one parameter must be the HWnd of the main view.
#define SFVM_WNDMAIN              46

// psdk
#define SFVM_ADDPROPERTYPAGES     47    // -                  SFVM_PROPPAGE_DATA *

// psdk
#define SFVM_BACKGROUNDENUMDONE   48    // -                  -

// psdk
#define SFVM_GETNOTIFY            49    // LPITEMIDLIST*      LONG*

// psdk
#define SFVM_GETSORTDEFAULTS      53    // iDirection         iParamSort
// Guessing:
//#define SFVCB_GETDEFAULTCOLUMN 0x35


// psdk
#define SFVM_SIZE                 57    // -                  -
//#define SFVCB_ADDSTATUSBARITEMS   0x0039
//#define SFVCB_WNDSIZE 0x39
// both wParam and lParam 0, called when WM_SIZE is received

// psdk
#define SFVM_GETZONE              58    // -                  DWORD*

// psdk
#define SFVM_GETPANE              59    // Pane ID            DWORD*
/*
Message 3b:
typical implementation:
			if (wParam == 1)
			{
				*((DWORD *)lParam) = 2;
			}
			return S_OK;
Everybody seems to implement it like this, but i have no idea what it means !
*/

// psdk
#define SFVM_GETHELPTOPIC         63    // -                  SFVM_HELPTOPIC_DATA *
//#define SFVCB_GETHELPFILE         0x003F

// undoc XP
#define SFVM_GET_CUSTOMVIEWINFO       77

// undoc XP
// something with property bags
#define SFVM_ENUMERATEDITEMS          79

// undoc XP
#define SFVM_GET_VIEW_DATA            80

// undoc XP
#define SFVM_GET_WEBVIEW_LAYOUT       82
// lParam: SFVM_WEVIEW_LAYOUT_DATA*
// first member: flags, 0x10000 and 0x30000 exist
struct SFVM_WEBVIEW_LAYOUT_DATA
{
	UINT flags;
	LPUNKNOWN pUnk; //IPreview3?
};

// undoc XP
#define SFVM_GET_WEBVIEW_CONTENT      83

// undoc XP
// Call CreateIUIElement to get a pointer to a IUIElement
struct SFVM_WEBVIEW_CONTENT_DATA
{
	long l1;
	long l2;
	IUIElement *pUnk; // IUIElement
	IUIElement *pUnk2; // IUIElement
	IEnumIDList *pEnum;
};

// undoc XP
#define SFVM_GET_WEBVIEW_TASKS        84

struct SFVM_WEBVIEW_TASKSECTION_DATA
{
	IEnumUICommand *pEnum; // IEnumUICommand
	IEnumUICommand *pEnum2; // IEnumUICommand
};

// undoc XP
#define SFVM_GET_WEBVIEW_THEME        86

struct SFVM_WEBVIEW_THEME_DATA
{
	WCHAR *pszTheme;
};

// undoc XP
#define SFVM_GETDEFERREDVIEWSETTINGS  92
// lParam: SFVM_DEFERREDVIEWSETTINGS *


// SHCreateShellFolderViewEx struct
// This is the version from psdk.
#ifdef OLD_PLATFORM_SDK
typedef HRESULT (CALLBACK * LPFNVIEWCALLBACK)(IShellView *psvOuter,
                                                IShellFolder *psf,
                                                HWND hwndMain,
                                                UINT uMsg,
                                                WPARAM wParam,
                                                LPARAM lParam);
typedef struct _CSFV
{
    UINT            cbSize;
    IShellFolder *  pshf;
    IShellView *    psvOuter;
    LPCITEMIDLIST   pidl;
    LONG            lEvents;
    LPFNVIEWCALLBACK pfnCallback;       // No callback if NULL
    FOLDERVIEWMODE  fvm;
} CSFV, * LPCSFV;
#endif // OLD_PLATFORM_SDK

// My old version:
// The user data is defined by MS as an IShellView *
// The viewmode is different (see below)
typedef struct _SHELLVIEWDATA	// idl
{
	DWORD           dwSize;
	LPSHELLFOLDER   pShellFolder;
	DWORD           dwUserParam;
	LPCITEMIDLIST   pidl;
	DWORD           dwEventId;
	SHELLVIEWPROC   pCallBack;
	DWORD           viewmode;  // NF_* enum
} SHELLVIEWDATA, * LPSHELLVIEWDATA;
typedef const SHELLVIEWDATA * LPCSHELLVIEWDATA;

// SBCMDID_GETPANE - not necessarily in order
#ifndef PANE_NONE
#define PANE_NONE        -1
#endif
#ifndef PANE_ZONE
#define PANE_ZONE        1
#endif
#ifndef PANE_OFFLINE
#define PANE_OFFLINE     2
#endif
#ifndef PANE_PRINTER
#define PANE_PRINTER     3
#endif
#ifndef PANE_SSL
#define PANE_SSL         4
#endif
#ifndef PANE_NAVIGATION
#define PANE_NAVIGATION  5
#endif
#ifndef PANE_PROGRESS
#define PANE_PROGRESS    6
#endif
#ifndef PANE_PRIVACY
#define PANE_PRIVACY     7
#endif


#ifdef OLD_PLATFORM_SDK
//
// Callback interface for the IShellFolderView
//
#undef  INTERFACE
#define INTERFACE   IShellFolderViewCB

DECLARE_INTERFACE_(IShellFolderViewCB, IUnknown)
{
    // *** IUnknown methods ***
    STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
    STDMETHOD_(ULONG,Release) (THIS) PURE;

    // *** IShellFolderViewCB methods ***
    STDMETHOD(MessageSFVCB)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
};

typedef struct _SFV_CREATE
{
    UINT            cbSize;
    IShellFolder*   pshf;
    IShellView*     psvOuter;
    IShellFolderViewCB* psfvcb; // No callback if NULL
} SFV_CREATE;

SHSTDAPI SHCreateShellFolderView(const SFV_CREATE* pcsfv, IShellView **ppsv);
#endif //OLD_PLATFORM_SDK

// NF valid values for the "viewmode" item of the SHELLTEMPLATE
#define NF_INHERITVIEW	  0x0000
#define NF_LOCALVIEW	    0x0001

// This is the psdk version of it.
// This one is much more likely to be correct.
// The previous version was invented before the views listed below existed.
/*
typedef  
enum __MIDL___MIDL_itf_shobjidl_0198_0002
    {	FVM_FIRST	= 1,
	FVM_ICON	= 1,
	FVM_SMALLICON	= 2,
	FVM_LIST	= 3,
	FVM_DETAILS	= 4,
	FVM_THUMBNAIL	= 5,
	FVM_TILE	= 6,
	FVM_THUMBSTRIP	= 7,
	FVM_LAST	= 7
    } 	FOLDERVIEWMODE;
*/


/*WINSHELLAPI HRESULT WINAPI SHCreateShellFolderViewEx(
  LPSHELLVIEWDATA psvcbi, //[in ] shelltemplate struct
  LPVOID* ppv);           //[out] IShellView pointer*/
//typedef WINSHELLAPI HRESULT (WINAPI *fnSHCreateShellFolderViewEx)(LPSHELLVIEWDATA psvcbi, LPVOID *ppv);
//extern fnSHCreateShellFolderViewEx SHCreateShellFolderViewEx;
SHSTDAPI SHCreateShellFolderViewEx(LPCSFV pcsfv, IShellView ** ppsv);

#ifdef OLD_PLATFORM_SDK
#ifndef __IShellItem_INTERFACE_DEFINED__
#define __IShellItem_INTERFACE_DEFINED__

/* interface IShellItem */
/* [unique][object][uuid][helpstring] */ 

typedef /* [public][public][v1_enum] */ 
enum __MIDL_IShellItem_0001
    {	SIGDN_NORMALDISPLAY	= 0,
	SIGDN_PARENTRELATIVEPARSING	= 0x80018001,
	SIGDN_PARENTRELATIVEFORADDRESSBAR	= 0x8001c001,
	SIGDN_DESKTOPABSOLUTEPARSING	= 0x80028000,
	SIGDN_PARENTRELATIVEEDITING	= 0x80031001,
	SIGDN_DESKTOPABSOLUTEEDITING	= 0x8004c000,
	SIGDN_FILESYSPATH	= 0x80058000,
	SIGDN_URL	= 0x80068000
    } 	SIGDN;

/* [v1_enum] */ 
enum __MIDL_IShellItem_0002
    {	SICHINT_DISPLAY	= 0,
	SICHINT_ALLFIELDS	= 0x80000000,
	SICHINT_CANONICAL	= 0x10000000
    } ;
typedef DWORD SICHINTF;


EXTERN_C const IID IID_IShellItem;

#if defined(__cplusplus) && !defined(CINTERFACE)
    
    MIDL_INTERFACE("43826d1e-e718-42ee-bc55-a1e261c37bfe")
    IShellItem : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE BindToHandler( 
            /* [in] */ IBindCtx *pbc,
            /* [in] */ REFGUID rbhid,
            /* [in] */ REFIID riid,
            /* [iid_is][out] */ void **ppvOut) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE GetParent( 
            /* [out] */ IShellItem **ppsi) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE GetDisplayName( 
            /* [in] */ SIGDN sigdnName,
            /* [string][out] */ LPOLESTR *ppszName) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE GetAttributes( 
            /* [in] */ SFGAOF sfgaoMask,
            /* [out] */ SFGAOF *psfgaoAttribs) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE Compare( 
            /* [in] */ IShellItem *psi,
            /* [in] */ SICHINTF hint,
            /* [out] */ int *piOrder) = 0;
        
    };
    
#else 	/* C style interface */

    typedef struct IShellItemVtbl
    {
        BEGIN_INTERFACE
        
        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
            IShellItem * This,
            /* [in] */ REFIID riid,
            /* [iid_is][out] */ void **ppvObject);
        
        ULONG ( STDMETHODCALLTYPE *AddRef )( 
            IShellItem * This);
        
        ULONG ( STDMETHODCALLTYPE *Release )( 
            IShellItem * This);
        
        HRESULT ( STDMETHODCALLTYPE *BindToHandler )( 
            IShellItem * This,
            /* [in] */ IBindCtx *pbc,
            /* [in] */ REFGUID rbhid,
            /* [in] */ REFIID riid,
            /* [iid_is][out] */ void **ppvOut);
        
        HRESULT ( STDMETHODCALLTYPE *GetParent )( 
            IShellItem * This,
            /* [out] */ IShellItem **ppsi);
        
        HRESULT ( STDMETHODCALLTYPE *GetDisplayName )( 
            IShellItem * This,
            /* [in] */ SIGDN sigdnName,
            /* [string][out] */ LPOLESTR *ppszName);
        
        HRESULT ( STDMETHODCALLTYPE *GetAttributes )( 
            IShellItem * This,
            /* [in] */ SFGAOF sfgaoMask,
            /* [out] */ SFGAOF *psfgaoAttribs);
        
        HRESULT ( STDMETHODCALLTYPE *Compare )( 
            IShellItem * This,
            /* [in] */ IShellItem *psi,
            /* [in] */ SICHINTF hint,
            /* [out] */ int *piOrder);
        
        END_INTERFACE
    } IShellItemVtbl;

    interface IShellItem
    {
        CONST_VTBL struct IShellItemVtbl *lpVtbl;
    };

    

#ifdef COBJMACROS


#define IShellItem_QueryInterface(This,riid,ppvObject)	\
    (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)

#define IShellItem_AddRef(This)	\
    (This)->lpVtbl -> AddRef(This)

#define IShellItem_Release(This)	\
    (This)->lpVtbl -> Release(This)


#define IShellItem_BindToHandler(This,pbc,rbhid,riid,ppvOut)	\
    (This)->lpVtbl -> BindToHandler(This,pbc,rbhid,riid,ppvOut)

#define IShellItem_GetParent(This,ppsi)	\
    (This)->lpVtbl -> GetParent(This,ppsi)

#define IShellItem_GetDisplayName(This,sigdnName,ppszName)	\
    (This)->lpVtbl -> GetDisplayName(This,sigdnName,ppszName)

#define IShellItem_GetAttributes(This,sfgaoMask,psfgaoAttribs)	\
    (This)->lpVtbl -> GetAttributes(This,sfgaoMask,psfgaoAttribs)

#define IShellItem_Compare(This,psi,hint,piOrder)	\
    (This)->lpVtbl -> Compare(This,psi,hint,piOrder)

#endif /* COBJMACROS */


#endif 	/* C style interface */



HRESULT STDMETHODCALLTYPE IShellItem_BindToHandler_Proxy( 
    IShellItem * This,
    /* [in] */ IBindCtx *pbc,
    /* [in] */ REFGUID rbhid,
    /* [in] */ REFIID riid,
    /* [iid_is][out] */ void **ppvOut);


void __RPC_STUB IShellItem_BindToHandler_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


HRESULT STDMETHODCALLTYPE IShellItem_GetParent_Proxy( 
    IShellItem * This,
    /* [out] */ IShellItem **ppsi);


void __RPC_STUB IShellItem_GetParent_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


HRESULT STDMETHODCALLTYPE IShellItem_GetDisplayName_Proxy( 
    IShellItem * This,
    /* [in] */ SIGDN sigdnName,
    /* [string][out] */ LPOLESTR *ppszName);


void __RPC_STUB IShellItem_GetDisplayName_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


HRESULT STDMETHODCALLTYPE IShellItem_GetAttributes_Proxy( 
    IShellItem * This,
    /* [in] */ SFGAOF sfgaoMask,
    /* [out] */ SFGAOF *psfgaoAttribs);


void __RPC_STUB IShellItem_GetAttributes_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);


HRESULT STDMETHODCALLTYPE IShellItem_Compare_Proxy( 
    IShellItem * This,
    /* [in] */ IShellItem *psi,
    /* [in] */ SICHINTF hint,
    /* [out] */ int *piOrder);


void __RPC_STUB IShellItem_Compare_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase);



#endif 	/* __IShellItem_INTERFACE_DEFINED__ */
#endif // OLD_PLATFORM_SDK


/////////////////////////////////////////////////////////////////////////////
// IShellDetails

// The intercface IShellDetails has now been documented.
// The documentation says you should not implement it anymore.
// However you still have to implement it for compatibility with older
// shell versions.
// The documentation also says you have to immplement IShellFolder2.
// Be very careful here!
// Versions of Platform SDK prior to january 2000 contain a
// different definition for IShellFolder2 with different IID.
/*#undef  INTERFACE
#define INTERFACE   IShellDetails

DECLARE_INTERFACE_(IShellDetails, IUnknown)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

	// IShellDetails methods
	STDMETHOD(GetDetailsOf)(THIS_ LPCITEMIDLIST pidl, UINT col, SHColInfo *data) PURE;
	STDMETHOD(ColumnClick)(THIS_ UINT col) PURE;
};

typedef IShellDetails FAR* LPSHELLDETAILS;*/



// The interface IDelegateFolder is used for items in Internet Explorer
// like FTP folders.
// The problem:
// The root of these items ios not displayed.
// For example, you don't have Internet Explorer\FTP\aserver.com
// The FTP folder is not displayed.
// But of course there has to be a root for the 
// FTP folders.
// Internet explorer can not lnow about ftp items and items of other
// protyocols.
// So what they did is they embedded the pidls for items directly
// under the Internet Explorer root in an Internet Explorer pidl.
// The Internet Explorer pidls look like this:
// {total size}{sig}{child pidl}{rest of pidl}
// where {total size) is the size of the pidl, as always.
//       {sig} is a singature of 4 bytes
//       {child} is an ebmedded pidl
//       {rest of pidl} defines the protocol etc. and is used by IE.
// The child is a normal pidl like you are used to. As usual it
// starts with the size.
// Internet Explorer therefore calls SetItemMalloc and gives the child
// an IMalloc it can usxe to allocate pidls.
// These pidls are IE pidls of the above form, but the child pidl
// is not filled in.
// So after SetItemAlloc has been called, when ever you create a pidl
// you should call the IMalloc's Alloc, and put your pidl at offset 6
// of the returned buffer.


#ifndef __IDelegateFolder_INTERFACE_DEFINED__
#define __IDelegateFolder_INTERFACE_DEFINED__
// The October 2002 Platform SDK already defines this
// interface and fortunately has a #define for it.

#undef  INTERFACE
#define INTERFACE   IDelegateFolder

DECLARE_INTERFACE_(IDelegateFolder, IUnknown)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

	// IDelegateFolder methods
	STDMETHOD(SetItemAlloc)(THIS_ IMalloc *pMalloc) PURE;
};

typedef IDelegateFolder FAR* LPDELEGATEFOLDER;

#endif //__IDelegateFolder_INTERFACE_DEFINED__

/////////////////////////////////////////////////////////////////////////////
// Totally miscellaneous stuff

// ??? about IShellFolder ?
/* This is the interface for a browser to "subclass" the main File Cabinet
** window.  Note that only the hwnd, message, wParam, and lParam fields of
** the msg structure are used.  The browser window will get a WM_NOTIFY
** message with NULL ID, FCN_MESSAGE as the code, and a far pointer to
** FCMSG_NOTIFY as the lParam.
*/
typedef struct tagFCMSG_NOTIFY
{
        NMHDR   hdr;
        MSG     msg;
        LRESULT lResult;
} FCMSG_NOTIFY;

#define FCN_MESSAGE     (100)


///////////////////////////////////////////////////////////////////////////////
//
// Homeless things.
//
///////////////////////////////////////////////////////////////////////////////

//---------------------------------------------------------------------------
// messages that can be send to the cabinet by other apps
//
//---------------------------------------------------------------------------

// Change the path of an existing folder.
// wParam:
//	0:		LPARAM is a string, handle the message immediately.
//	CSP_HANDLE:	LPARAM is a handle. handle the message immediatelt
//			and then free the handle.
//	CSP_REPOST:	LPARAM is a string, copy the string and handle the
// 			message later.
// 	CSP_REPOST|CSP_HANDLE:
//			LPARAM is a handle, just handle the message later
//			and free the handle then.
// lParam: LPSTR or HANDLE of path.
//
#define CSP_REPOST				0x0001
#define CSP_HANDLE				0x0002

#define CWM_SETPATH				(WM_USER + 2)

// lpsv points to the Shell View extension that requested idle processing
// uID is an app define identifier for the processor
// returns: TRUE if there is more idle processing necessary, FALSE if all done
// Note that the idle processor should do one "atomic" operation and return
// as soon as possible.
typedef BOOL (CALLBACK *FCIDLEPROC)(void FAR *lpsv, UINT uID);

// Inform the File Cabinet that you want idle messages.
// This should ONLY be used by File Cabinet extensions.
// wParam: app define UINT (passed to FCIDLEPROC).
// lParam: pointer to an FCIDLEPROC.
// return: TRUE if successful; FALSE otherwise
#define CWM_WANTIDLE            (WM_USER + 3)
#define FileCabinet_WantIdle(_hwnd, _user, _lpidlproc) SendMessage(_hwnd, CWM_WANTIDLE, (WPARAM)_user, (LPARAM)_lpidlproc)

// get or set the FOLDERSETTINGS for a view
// wParam: BOOL TRUE -> set to view info buffer, FALSE -> get view info buffer
// lParam: LPFOLDERSETTINGS buffer to get or set view info
#define CWM_GETSETCURRENTINFO	(WM_USER + 4)
#define FileCabinet_GetSetCurrentInfo(_hwnd, _bSet, _lpfs) SendMessage(_hwnd, CWM_GETSETCURRENTINFO, (WPARAM)(_bSet), (LPARAM)(LPFOLDERSETTINGS)_lpfs)

// selects the specified item in the current view
// wParam: BOOL TRUE -> select, FALSE -> deselect
// lParam: LPCSTR of the item ID (not display name), NULL -> all items
#define CWM_SELECTITEM          (WM_USER + 5)
#define FileCabinet_SelectItem(_hwnd, _bSel, _lpidl) SendMessage(_hwnd, CWM_SELECTITEM, (WPARAM)_bSel, (LPARAM)_lpidl)

// tells the window to punt its wait cursor.  used for handoff
// while thread inits
#define CWM_STOPWAITING         (WM_USER + 6)
#define FileCabinet_StopWaiting(_hwnd) SendMessage(_hwnd, CWM_STOPWAITING, 0, 0L)

// Get the IShellBrowser object associated with an hwndMain
#define CWM_GETISHELLBROWSER	(WM_USER + 7)
#define FileCabinet_GetIShellBrowser(_hwnd) (IShellBrowser FAR *)SendMessage(_hwnd, CWM_GETISHELLBROWSER, 0, 0L)


//#define CWM_SELECTITEMSTR     (WM_USER + 6)
#define CWM_TESTPATH          (WM_USER + 9)
#define CWM_STATECHANGE       (WM_USER + 10)
#define CWM_GETPATH           (WM_USER + 12)


//---------------------------------------------------------------------------
// All the "undocumented" shell32 exports.
//
//---------------------------------------------------------------------------

// The Shell's Default Task allocator
//typedef WINSHELLAPI void (WINAPI *fnSHFree)( LPVOID);
//extern fnSHFree SHFree;
SHSTDAPI_(void)   SHFree(void * pv);

//typedef WINSHELLAPI LPVOID (WINAPI *fnSHAlloc)( UINT);
//extern fnSHAlloc SHAlloc;
SHSTDAPI_(void *) SHAlloc(SIZE_T cb);

///////////////////////////////////////////////////////////////////////////////
// Cool helper functions to work with IDLists

// free an idlist using the shell allocater
// (how is this func diffrent from SHFree?
//typedef WINSHELLAPI void (WINAPI *fnILFree)(LPITEMIDLIST pidl);
//extern fnILFree ILFree;
SHSTDAPI_(void)         ILFree(LPITEMIDLIST pidl);

// dupicate an idlist
//typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILClone)(LPCITEMIDLIST pidl);
//extern fnILClone ILClone;
SHSTDAPI_(LPITEMIDLIST) ILClone(LPCITEMIDLIST pidl);

// Adds the single item to the idlist indicated by pidl.
// if bEnd is 0, adds the item to the front of the list,
// otherwise adds the item to the end.
// NOTE: Destroys the passed in idlist!
//typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILAppendID)(LPITEMIDLIST pidl,LPCITEMIDLIST item,BOOL bEnd);
//extern fnILAppendID ILAppendID;
SHSTDAPI_(LPITEMIDLIST) ILAppendID(LPITEMIDLIST pidl, LPCSHITEMID pmkid, BOOL fAppend);

// duplicates the first idlist of a complex pidl
//typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILCloneFirst)(LPCITEMIDLIST pidl);
//extern fnILCloneFirst ILCloneFirst;
SHSTDAPI_(LPITEMIDLIST) ILCloneFirst(LPCITEMIDLIST pidl);

// Concatenates two complex idlists.
// The pidl is the first one, pidlsub the next one
// NOTE: Does not destroy the passed in idlists!
//typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILCombine)(LPCITEMIDLIST pidl, LPCITEMIDLIST pidlsub);
//extern fnILCombine ILCombine;
SHSTDAPI_(LPITEMIDLIST) ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);

//WINSHELLAPI int WINAPI ILCreateFromPath(int);
SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathA(LPCSTR pszPath);
SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathW(LPCWSTR pszPath);
#ifndef IlCreateFromPath
#ifdef UNICODE
#define ILCreateFromPath ILCreateFromPathW
#else
#define ILCreateFromPath ILCreateFromPathA
#endif
#endif

//WINSHELLAPI int WINAPI ILFindChild(int,int);
SHSTDAPI_(LPITEMIDLIST) ILFindChild(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild);

//typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILFindLastID)(LPCITEMIDLIST);
//extern fnILFindLastID ILFindLastID;
SHSTDAPI_(LPITEMIDLIST) ILFindLastID(LPCITEMIDLIST pidl);

WINSHELLAPI int WINAPI ILGetDisplayName(int,int);

// returns the next pidl in a complex idlist
//typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILGetNext)(LPCITEMIDLIST);
//extern fnILGetNext ILGetNext;
SHSTDAPI_(LPITEMIDLIST) ILGetNext(LPCITEMIDLIST pidl);

// Gets the byte size of an idlist including zero terminator.
//typedef WINSHELLAPI UINT (WINAPI *fnILGetSize)(LPCITEMIDLIST pidl);
//extern fnILGetSize ILGetSize;
SHSTDAPI_(UINT)         ILGetSize(LPCITEMIDLIST pidl);

// Used to implement explorer parameters?
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILGlobalClone)(LPITEMIDLIST);
typedef WINSHELLAPI LPITEMIDLIST (WINAPI *fnILGlobalFree)(LPITEMIDLIST);
extern fnILGlobalClone ILGlobalClone;
extern fnILGlobalFree ILGlobalFree;


//typedef WINSHELLAPI BOOL (WINAPI *fnILIsEqual)(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
//extern fnILIsEqual ILIsEqual;
SHSTDAPI_(BOOL)         ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);

SHSTDAPI_(BOOL)         ILIsParent(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, BOOL fImmediate);
//WINSHELLAPI int WINAPI ILLoadFromStream(int,int);
SHSTDAPI                ILLoadFromStream(IStream *pstm, LPITEMIDLIST *pidl);

// Creates a new list with the last tiem removed.
//typedef WINSHELLAPI BOOL (WINAPI *fnILRemoveLastID)(LPCITEMIDLIST);
//extern fnILRemoveLastID ILRemoveLastID;
SHSTDAPI_(BOOL)         ILRemoveLastID(LPITEMIDLIST pidl);

//WINSHELLAPI int WINAPI ILSaveToStream(int,int);
SHSTDAPI                ILSaveToStream(IStream *pstm, LPCITEMIDLIST pidl);

///////////////////////////////////////////////////////////////////////////////
WINSHELLAPI int WINAPI AddCommasW(int,int);
WINSHELLAPI int WINAPI ArrangeWindows(int,int,int,int,int);
WINSHELLAPI int WINAPI CIDLData_CreateFromIDArray(int,int,int,int);
//DECLARE_HANDLE(FARPROC16);
//SHSTDAPI_(LRESULT) CallCPLEntry16(HINSTANCE hinst, FARPROC16 lpfnEntry, HWND hwndCPL, UINT msg, LPARAM lParam1, LPARAM lParam2);

#ifdef OLD_PLATFORM_SDK
SHSTDAPI_(BOOL) SHOpenPropSheetW(LPCWSTR pszCaption, HKEY ahkeys[], UINT cikeys,
                                 const CLSID * pclsidDefault, IDataObject *pdtobj,
                                 IShellBrowser *psb, LPCWSTR pStartPage);
#endif

WINSHELLAPI int WINAPI CheckEscapesA(int,int);
WINSHELLAPI int WINAPI CheckEscapesW(int,int);
//CommandLineToArgvW(int,int);
WINSHELLAPI int WINAPI Control_FillCache_RunDLL(int,int,int,int);
WINSHELLAPI int WINAPI Control_FillCache_RunDLLA(int,int,int,int);
WINSHELLAPI int WINAPI Control_FillCache_RunDLLW(int,int,int,int);
WINSHELLAPI int WINAPI Control_RunDLL(int,int,int,int);
WINSHELLAPI int WINAPI Control_RunDLLA(int,int,int,int);
WINSHELLAPI int WINAPI Control_RunDLLW(int,int,int,int);
//WINSHELLAPI int WINAPI DAD_AutoScroll(int,int,int);

#ifdef OLD_PLATFORM_SDK
#define NUM_POINTS      3
typedef struct {        // asd
    int iNextSample;
    DWORD dwLastScroll;
    BOOL bFull;
    POINT pts[NUM_POINTS];
    DWORD dwTimes[NUM_POINTS];
} AUTO_SCROLL_DATA;
#endif

SHSTDAPI_(BOOL) DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *pad, const POINT *pptNow);

typedef WINSHELLAPI int (WINAPI *fnDAD_DragEnter)(HWND hWnd);
extern fnDAD_DragEnter DAD_DragEnter;
//typedef WINSHELLAPI DROPEFFECT (WINAPI *fnDAD_DragEnterEx)(HWND hWnd, LPDATAOBJECT pDataoBJECT, DWORD grfKeyState);
//extern fnDAD_DragEnterEx DAD_DragEnterEx;

SHSTDAPI_(BOOL) DAD_DragEnterEx(HWND hwndTarget, const POINT ptStart);
WINSHELLAPI int WINAPI DAD_DragLeave(void);
SHSTDAPI_(BOOL) DAD_DragMove(POINT pt);
SHSTDAPI_(BOOL) DAD_SetDragImage(HIMAGELIST him, POINT * pptOffset);
WINSHELLAPI int WINAPI DAD_SetDragImageFromListView(int,int,int);
WINSHELLAPI int WINAPI DAD_ShowDragImage(int);
WINSHELLAPI int WINAPI Desktop_UpdateBriefcaseOnEvent(int,int);
//WINSHELLAPI int WINAPI DoEnvironmentSubstA(int,int);
//WINSHELLAPI int WINAPI DoEnvironmentSubstW(int,int);
//DragAcceptFiles(int,int);
//DragFinish(int);
//DragQueryFileA(int,int,int,int);
WINSHELLAPI int WINAPI DragQueryFileAorW(int,int,int,int,int,int);
//DragQueryFileW(int,int,int,int);
WINSHELLAPI int WINAPI DragQueryInfo(int,int);
//DragQueryPoint(int,int);
WINSHELLAPI int WINAPI DriveType(int);
//WINSHELLAPI int WINAPI DuplicateIcon(int,int);
WINSHELLAPI int WINAPI ExitWindowsDialog(int);
//ExtractAssociatedIconA(int,int,int);

SHSTDAPI_(HICON) ExtractAssociatedIconExA(HINSTANCE hInst,LPSTR lpIconPath,LPWORD lpiIconIndex, LPWORD lpiIconId);
SHSTDAPI_(HICON) ExtractAssociatedIconExW(HINSTANCE hInst,LPWSTR lpIconPath,LPWORD lpiIconIndex, LPWORD lpiIconId);
#ifndef ExtractAssociatedIconEx
#ifdef UNICODE
#define ExtractAssociatedIconEx  ExtractAssociatedIconExW
#else
#define ExtractAssociatedIconEx  ExtractAssociatedIconExA
#endif // !UNICODE
#endif // ExtractAssociatedIconEx

//ExtractAssociatedIconW(int,int,int);
//ExtractIconA(int,int,int);
//ExtractIconEx(int,int,int,int,int);
//ExtractIconExA(int,int,int,int,int);
//ExtractIconExW(int,int,int,int,int);
WINSHELLAPI int WINAPI ExtractIconResInfoA(int,int,int,int,int);
WINSHELLAPI int WINAPI ExtractIconResInfoW(int,int,int,int,int);
//ExtractIconW(int,int,int);
WINSHELLAPI int WINAPI ExtractVersionResource16W(int,int);
WINSHELLAPI int WINAPI FOOBAR1217(int,int,int);
WINSHELLAPI int WINAPI FileIconInit(int);
WINSHELLAPI int WINAPI FileMenu_AbortInitMenu(void);
WINSHELLAPI int WINAPI FileMenu_AddFilesForPidl(int,int,int,int,int,int,int);
WINSHELLAPI int WINAPI FileMenu_AppendFilesForPidl(int,int,int);
WINSHELLAPI int WINAPI FileMenu_AppendItem(int,int,int,int,int,int);
WINSHELLAPI int WINAPI FileMenu_Create(int,int,int,int,int);
WINSHELLAPI int WINAPI FileMenu_DeleteAllItems(int);
WINSHELLAPI int WINAPI FileMenu_DeleteItemByCmd(int,int);
WINSHELLAPI int WINAPI FileMenu_DeleteItemByIndex(int,int);
WINSHELLAPI int WINAPI FileMenu_DeleteMenuItemByFirstID(int,int);
WINSHELLAPI int WINAPI FileMenu_DeleteSeparator(int);
WINSHELLAPI int WINAPI FileMenu_Destroy(int);
WINSHELLAPI int WINAPI FileMenu_DrawItem(int,int);
WINSHELLAPI int WINAPI FileMenu_EnableItemByCmd(int,int,int);
WINSHELLAPI int WINAPI FileMenu_FindSubMenuByPidl(int,int);
WINSHELLAPI int WINAPI FileMenu_GetItemExtent(int,int);
WINSHELLAPI int WINAPI FileMenu_GetLastSelectedItemPidls(int,int,int);
WINSHELLAPI int WINAPI FileMenu_HandleMenuChar(int,int);
WINSHELLAPI int WINAPI FileMenu_InitMenuPopup(int);
WINSHELLAPI int WINAPI FileMenu_InsertUsingPidl(int,int,int,int,int,int);
WINSHELLAPI int WINAPI FileMenu_Invalidate(int);
WINSHELLAPI int WINAPI FileMenu_MeasureItem(int,int);
WINSHELLAPI int WINAPI FileMenu_ReplaceUsingPidl(int,int,int,int,int);
WINSHELLAPI int WINAPI FileMenu_TrackPopupMenuEx(int,int,int,int,int,int);
WINSHELLAPI int WINAPI FindExeDlgProc(int,int,int,int);
//FindExecutableA(int,int,int);
//FindExecutableW(int,int,int);
WINSHELLAPI int WINAPI FreeIconList(int,int);
SHSTDAPI_(BOOL) GetFileNameFromBrowse(HWND hwnd, LPWSTR pszFilePath, UINT cbFilePath,
                                      LPCWSTR pszWorkingDir, LPCWSTR pszDefExt, LPCWSTR pszFilters, LPCWSTR pszTitle);
WINSHELLAPI int WINAPI Int64ToString(int,int,int,int,int,int);
WINSHELLAPI int WINAPI InternalExtractIconListA(int,int,int);
WINSHELLAPI int WINAPI InternalExtractIconListW(int,int,int);
WINSHELLAPI int WINAPI InvalidateDriveType(int);

SHSTDAPI_(BOOL) IsLFNDriveA(LPCSTR pszPath);
SHSTDAPI_(BOOL) IsLFNDriveW(LPCWSTR pszPath);
#ifndef IsLFNDrive
#ifdef UNICODE
#define IsLFNDrive  IsLFNDriveW
#else
#define IsLFNDrive  IsLFNDriveA
#endif // !UNICODE
#endif // IsLFNDrive

WINSHELLAPI int WINAPI IsNetDrive(int);
WINSHELLAPI int WINAPI IsUserAnAdmin(void);
WINSHELLAPI int WINAPI LargeIntegerToString(int,int,int,int,int);
WINSHELLAPI int WINAPI Link_AddExtraDataSection(int,int);
WINSHELLAPI int WINAPI Link_ReadExtraDataSection(int,int);
WINSHELLAPI int WINAPI Link_RemoveExtraDataSection(int,int);
WINSHELLAPI int WINAPI NTSHChangeNotifyDeregister(int);
WINSHELLAPI int WINAPI NTSHChangeNotifyRegister(int,int,int,int,int,int);
WINSHELLAPI int WINAPI OleStrToStrN(int,int,int,int);
WINSHELLAPI int WINAPI OpenAs_RunDLL(int,int,int,int);
WINSHELLAPI int WINAPI OpenAs_RunDLLA(int,int,int,int);
WINSHELLAPI int WINAPI OpenAs_RunDLLW(int,int,int,int);
SHSTDAPI_(IStream *) OpenRegStream(HKEY hkey, LPCWSTR pszSubkey, LPCWSTR pszValue, DWORD grfMode);
WINSHELLAPI int WINAPI ParseField(int,int,int,int);

#ifndef PathAddBackslash
LWSTDAPI_(LPSTR)  PathAddBackslashA(LPSTR pszPath);
LWSTDAPI_(LPWSTR)  PathAddBackslashW(LPWSTR pszPath);
#ifdef UNICODE
#define PathAddBackslash  PathAddBackslashW
#else
#define PathAddBackslash  PathAddBackslashA
#endif // !UNICODE

#endif
#ifndef PathAppend
LWSTDAPI_(BOOL)     PathAppendA(LPSTR pszPath, LPCSTR pMore);
LWSTDAPI_(BOOL)     PathAppendW(LPWSTR pszPath, LPCWSTR pMore);
#ifdef UNICODE
#define PathAppend PathAppendW
#else
#define PathAppend PathAppendA
#endif // !UNICODE
#endif

#ifndef PathBuildRoot
LWSTDAPI_(LPSTR)  PathBuildRootA(LPSTR pszRoot, int iDrive);
LWSTDAPI_(LPWSTR)  PathBuildRootW(LPWSTR pszRoot, int iDrive);
#ifdef UNICODE
#define PathBuildRoot  PathBuildRootW
#else
#define PathBuildRoot  PathBuildRootA
#endif // !UNICODE
#endif

//
//  Return codes from PathCleanupSpec.  Negative return values are
//  unrecoverable errors
//
#ifndef PCS_FATAL
#define PCS_FATAL           0x80000000
#define PCS_REPLACEDCHAR    0x00000001
#define PCS_REMOVEDCHAR     0x00000002
#define PCS_TRUNCATED       0x00000004
#define PCS_PATHTOOLONG     0x00000008  // Always combined with FATAL
#endif

SHSTDAPI_(int) PathCleanupSpec(LPCWSTR pszDir, LPWSTR pszSpec);

#ifndef PathCombine
LWSTDAPI_(LPSTR)  PathCombineA(LPSTR pszDest, LPCSTR pszDir, LPCSTR pszFile);
LWSTDAPI_(LPWSTR)  PathCombineW(LPWSTR pszDest, LPCWSTR pszDir, LPCWSTR pszFile);
#ifdef UNICODE
#define PathCombine  PathCombineW
#else
#define PathCombine  PathCombineA
#endif // !UNICODE
#endif

#ifndef PathFileExists
LWSTDAPI_(BOOL)     PathFileExistsA(LPCSTR pszPath);
LWSTDAPI_(BOOL)     PathFileExistsW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathFileExists  PathFileExistsW
#else
#define PathFileExists  PathFileExistsA
#endif // !UNICODE
#endif

#ifndef PathFindFileName
LWSTDAPI_(LPSTR)  PathFindExtensionA(LPCSTR pszPath);
LWSTDAPI_(LPWSTR)  PathFindExtensionW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathFindExtension  PathFindExtensionW
#else
#define PathFindExtension  PathFindExtensionA
#endif // !UNICODE
#endif

#ifndef PathFindFileName
LWSTDAPI_(LPSTR)  PathFindFileNameA(LPCSTR pszPath);
LWSTDAPI_(LPWSTR)  PathFindFileNameW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathFindFileName  PathFindFileNameW
#else
#define PathFindFileName  PathFindFileNameA
#endif // !UNICODE
#endif

#ifndef PathFindOnPath
LWSTDAPI_(BOOL)     PathFindOnPathA(LPSTR pszPath, LPCSTR * ppszOtherDirs);
LWSTDAPI_(BOOL)     PathFindOnPathW(LPWSTR pszPath, LPCWSTR * ppszOtherDirs);
#ifdef UNICODE
#define PathFindOnPath PathFindOnPathW
#else
#define PathFindOnPath PathFindOnPathA
#endif // !UNICODE
#endif

#ifndef PathGetArgs
LWSTDAPI_(LPSTR)  PathGetArgsA(LPCSTR pszPath);
LWSTDAPI_(LPWSTR)  PathGetArgsW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathGetArgs  PathGetArgsW
#else
#define PathGetArgs  PathGetArgsA
#endif // !UNICODE
#endif

#ifndef PathGetDriveNumber
LWSTDAPI_(int)      PathGetDriveNumberA(LPCSTR pszPath);
LWSTDAPI_(int)      PathGetDriveNumberW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathGetDriveNumber  PathGetDriveNumberW
#else
#define PathGetDriveNumber  PathGetDriveNumberA
#endif // !UNICODE
#endif

WINSHELLAPI int WINAPI PathGetExtension(int,int,int);

SHSTDAPI_(void) PathGetShortPath(LPWSTR pszLongPath);

#ifndef PathIsDirectory
LWSTDAPI_(BOOL)     PathIsDirectoryA(LPCSTR pszPath);
LWSTDAPI_(BOOL)     PathIsDirectoryW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathIsDirectory  PathIsDirectoryW
#else
#define PathIsDirectory  PathIsDirectoryA
#endif // !UNICODE
#endif

SHSTDAPI_(BOOL) PathIsExe(LPCWSTR pszPath);

#ifndef PathIsRelative
LWSTDAPI_(BOOL)     PathIsRelativeA(LPCSTR pszPath);
LWSTDAPI_(BOOL)     PathIsRelativeW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathIsRelative  PathIsRelativeW
#else
#define PathIsRelative  PathIsRelativeA
#endif // !UNICODE

#endif

#ifndef PathIsRoot
LWSTDAPI_(BOOL)     PathIsRootA(LPCSTR pszPath);
LWSTDAPI_(BOOL)     PathIsRootW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathIsRoot  PathIsRootW
#else
#define PathIsRoot  PathIsRootA
#endif // !UNICODE
#endif

#ifndef PathIsSameRoot
LWSTDAPI_(BOOL)     PathIsSameRootA(LPCSTR pszPath1, LPCSTR pszPath2);
LWSTDAPI_(BOOL)     PathIsSameRootW(LPCWSTR pszPath1, LPCWSTR pszPath2);
#ifdef UNICODE
#define PathIsSameRoot  PathIsSameRootW
#else
#define PathIsSameRoot  PathIsSameRootA
#endif // !UNICODE
#endif

#ifndef PathIsUNC
LWSTDAPI_(BOOL)     PathIsUNCA(LPCSTR pszPath);
LWSTDAPI_(BOOL)     PathIsUNCW(LPCWSTR pszPath);
#ifdef UNICODE
#define PathIsUNC  PathIsUNCW
#else
#define PathIsUNC  PathIsUNCA
#endif // !UNICODE
#endif

SHSTDAPI_(BOOL) PathMakeUniqueName(LPWSTR pszUniqueName, UINT cchMax, LPCWSTR pszTemplate, LPCWSTR pszLongPlate, LPCWSTR pszDir);

#ifndef PathMatchSpec
LWSTDAPI_(BOOL)     PathMatchSpecA(LPCSTR pszFile, LPCSTR pszSpec);
LWSTDAPI_(BOOL)     PathMatchSpecW(LPCWSTR pszFile, LPCWSTR pszSpec);
#ifdef UNICODE
#define PathMatchSpec PathMatchSpecW
#else
#define PathMatchSpec PathMatchSpecA
#endif // !UNICODE
#endif

SHSTDAPI_(void) PathQualify(LPWSTR psz);

#ifndef PathQuoteSpaces
LWSTDAPI_(void)     PathQuoteSpacesA(LPSTR lpsz);
LWSTDAPI_(void)     PathQuoteSpacesW(LPWSTR lpsz);
#ifdef UNICODE
#define PathQuoteSpaces PathQuoteSpacesW
#else
#define PathQuoteSpaces PathQuoteSpacesA
#endif // !UNICODE
#endif

#ifndef PathRemoveBlanks
LWSTDAPI_(void)     PathRemoveBlanksA(LPSTR pszPath);
LWSTDAPI_(void)     PathRemoveBlanksW(LPWSTR pszPath);
#ifdef UNICODE
#define PathRemoveBlanks PathRemoveBlanksW
#else
#define PathRemoveBlanks PathRemoveBlanksA
#endif // !UNICODE
#endif

#ifndef PathRemoveFileSpec
LWSTDAPI_(BOOL)     PathRemoveFileSpecA(LPSTR pszPath);
LWSTDAPI_(BOOL)     PathRemoveFileSpecW(LPWSTR pszPath);
#ifdef UNICODE
#define PathRemoveFileSpec PathRemoveFileSpecW
#else
#define PathRemoveFileSpec PathRemoveFileSpecA
#endif // !UNICODE
#endif

//===========================================================================

// PathResolve flags
#ifndef PRF_VERIFYEXISTS
#define PRF_VERIFYEXISTS            0x0001
#define PRF_TRYPROGRAMEXTENSIONS    (0x0002 | PRF_VERIFYEXISTS)
#define PRF_FIRSTDIRDEF             0x0004
#define PRF_DONTFINDLNK             0x0008      // if PRF_TRYPROGRAMEXTENSIONS is specified
#endif
SHSTDAPI_(int) PathResolve(LPWSTR pszPath, LPCWSTR dirs[], UINT fFlags);

#ifndef PathSetDlgItemPath
LWSTDAPI_(void)     PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath);
LWSTDAPI_(void)     PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath);
#ifdef UNICODE
#define PathSetDlgItemPath PathSetDlgItemPathW
#else
#define PathSetDlgItemPath PathSetDlgItemPathA
#endif // !UNICODE
#endif

#ifndef PathStripPath
LWSTDAPI_(void)     PathStripPathA(LPSTR pszPath);
LWSTDAPI_(void)     PathStripPathW(LPWSTR pszPath);
#ifdef UNICODE
#define PathStripPath  PathStripPathW
#else
#define PathStripPath  PathStripPathA
#endif // !UNICODE
#endif

#ifndef PathStripToRoot
LWSTDAPI_(BOOL)     PathStripToRootA(LPSTR pszPath);
LWSTDAPI_(BOOL)     PathStripToRootW(LPWSTR pszPath);
#ifdef UNICODE
#define PathStripToRoot  PathStripToRootW
#else
#define PathStripToRoot  PathStripToRootA
#endif // !UNICODE
#endif

#ifndef PathUnquoteSpaces
LWSTDAPI_(void)     PathUnquoteSpacesA(LPSTR lpsz);
LWSTDAPI_(void)     PathUnquoteSpacesW(LPWSTR lpsz);
#ifdef UNICODE
#define PathUnquoteSpaces PathUnquoteSpacesW
#else
#define PathUnquoteSpaces PathUnquoteSpacesA
#endif // !UNICODE
#endif

SHSTDAPI_(BOOL) PathYetAnotherMakeUniqueName(LPWSTR  pszUniqueName, LPCWSTR pszPath, LPCWSTR pszShort, LPCWSTR pszFileSpec);
WINSHELLAPI int   WINAPI PickIconDlg(HWND hwnd, LPWSTR pszIconPath, UINT cbIconPath, int *piIconIndex);
SHSTDAPI_(HANDLE) PifMgr_OpenProperties(LPCWSTR pszApp, LPCWSTR pszPIF, UINT hInf, UINT flOpt);
SHSTDAPI_(int)    PifMgr_GetProperties(HANDLE hProps, LPCSTR pszGroup, void *lpProps, int cbProps, UINT flOpt);
SHSTDAPI_(int)    PifMgr_SetProperties(HANDLE hProps, LPCSTR pszGroup, const VOID *lpProps, int cbProps, UINT flOpt);
SHSTDAPI_(HANDLE) PifMgr_CloseProperties(HANDLE hProps, UINT flOpt);
WINSHELLAPI int WINAPI Printer_AddPrinterPropPages(int,int);
WINSHELLAPI int WINAPI Printer_LoadIconsW(int,int,int);
WINSHELLAPI int WINAPI PrintersGetCommand_RunDLL(int,int,int,int);
WINSHELLAPI int WINAPI PrintersGetCommand_RunDLLA(int,int,int,int);
WINSHELLAPI int WINAPI PrintersGetCommand_RunDLLW(int,int,int,int);
WINSHELLAPI int WINAPI Printers_GetPidl(int,int);
WINSHELLAPI int WINAPI Printers_RegisterWindowW(int,int,int,int);
WINSHELLAPI int WINAPI Printers_UnregisterWindow(int);
WINSHELLAPI int WINAPI RLBuildListOfPaths(void);

#ifdef OLD_PLATFORM_SDK
typedef struct {
    WORD cLength;
    WORD nVersion;

    BOOL fFullPathTitle            : 1;
    BOOL fSaveLocalView            : 1;
    BOOL fNotShell                 : 1;
    BOOL fSimpleDefault            : 1;
    BOOL fDontShowDescBar          : 1;
    BOOL fNewWindowMode            : 1;
    BOOL fShowCompColor            : 1;  // NT: Show compressed volumes in a different colour
    BOOL fDontPrettyNames          : 1;  // NT: Do 8.3 name conversion, or not!
    BOOL fAdminsCreateCommonGroups : 1;  // NT: Administrators create comon groups
    UINT fUnusedFlags : 7;

    UINT fMenuEnumFilter;

} CABINETSTATE, * LPCABINETSTATE;

#define CABINETSTATE_VERSION 2
#endif

SHSTDAPI_(BOOL) ReadCabinetState( LPCABINETSTATE lpState, int iSize );
SHSTDAPI_(BOOL) WriteCabinetState( LPCABINETSTATE lpState );
WINSHELLAPI int WINAPI RealDriveType(int,int);
WINSHELLAPI int WINAPI RealDriveTypeFlags(int,int);
WINSHELLAPI int WINAPI RealShellExecuteA(int,int,int,int,int,int,int,int,int,int);
WINSHELLAPI int WINAPI RealShellExecuteExA(int,int,int,int,int,int,int,int,int,int,int);
WINSHELLAPI int WINAPI RealShellExecuteExW(int,int,int,int,int,int,int,int,int,int,int);
WINSHELLAPI int WINAPI RealShellExecuteW(int,int,int,int,int,int,int,int,int,int);
WINSHELLAPI int WINAPI ReceiveAddToRecentDocs(int,int);
WINSHELLAPI int WINAPI RegenerateUserEnvironment(int,int);
WINSHELLAPI int WINAPI RegisterShellHook(int,int);
SHSTDAPI_(int) RestartDialog(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn);
SHSTDAPI_(int) RestartDialogEx(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn, DWORD dwReasonCode);
WINSHELLAPI int WINAPI RunDll_CallEntry16(int,int,int,int,int);
WINSHELLAPI int WINAPI RunFileDlg(int,int,int,int,int,int);
WINSHELLAPI int WINAPI SHAbortInvokeCommand(void);

#ifndef HPSXA_DEFINED
#define HPSXA_DEFINED
DECLARE_HANDLE( HPSXA );
#endif

WINSHELLAPI HPSXA SHCreatePropSheetExtArray( HKEY hKey, LPCWSTR pszSubKey, UINT max_iface );
WINSHELLAPI void SHDestroyPropSheetExtArray( HPSXA hpsxa );
WINSHELLAPI UINT SHAddFromPropSheetExtArray( HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
WINSHELLAPI UINT SHReplaceFromPropSheetExtArray( HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam );
//SHAddToRecentDocs(int,int);
//WINSHELLAPI int WINAPI SHAlloc(int);
WINSHELLAPI int WINAPI SHAllocShared(int,int,int);
//SHAppBarMessage(int,int);
//SHBrowseForFolder(int);
//SHBrowseForFolderA(int);
//SHBrowseForFolderW(int);

EXTERN_C WINSHELLAPI HRESULT STDAPICALLTYPE SHCLSIDFromString(LPCWSTR lpsz, LPCLSID lpclsid);

#ifdef OLD_PLATFORM_SDK
typedef struct _SHChangeNotifyEntry
{
    LPCITEMIDLIST pidl;
    BOOL   fRecursive;
} SHChangeNotifyEntry;
#endif

SHSTDAPI_(ULONG) SHChangeNotifyRegister(HWND hwnd, int fSources, LONG fEvents, UINT wMsg, int cEntries, SHChangeNotifyEntry *pshcne);
SHSTDAPI_(BOOL) SHChangeNotifyDeregister(unsigned long ulID);
SHSTDAPI_(HANDLE) SHChangeNotification_Lock(HANDLE hChangeNotification, DWORD dwProcessId, LPITEMIDLIST **pppidl, LONG *plEvent);
SHSTDAPI_(BOOL) SHChangeNotification_Unlock(HANDLE hLock);
//SHChangeNotify(int,int,int,int);
WINSHELLAPI int WINAPI SHChangeNotifyReceive(int,int,int,int);
WINSHELLAPI int WINAPI SHChangeNotifyUpdateEntryList(int,int,int,int);
WINSHELLAPI int WINAPI SHChangeRegistrationReceive(int,int);

SHSTDAPI_(LPITEMIDLIST) SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);  

SHSTDAPI SHCoCreateInstance(LPCWSTR pszCLSID, const CLSID *pclsid, IUnknown *pUnkOuter, REFIID riid, void **ppv);
WINSHELLAPI int WINAPI SHCreateDefClassObject(int,int,int,int,int);
SHSTDAPI_(int) SHCreateDirectory(HWND hwnd, LPCWSTR pszPath);
WINSHELLAPI int WINAPI SHCreateLinks(int,int,int,int,int);
//WINSHELLAPI int WINAPI SHCreateShellFolderViewEx(int,int);
SHSTDAPI SHCreateStdEnumFmtEtc(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppenumFormatEtc);
WINSHELLAPI int WINAPI SHDllGetClassObject(int,int,int);
SHSTDAPI SHDoDragDrop(HWND hwnd, IDataObject *pdata, IDropSource *pdsrc, DWORD dwEffect, DWORD *pdwEffect);
//SHFileOperation(int);
//SHFileOperationA(int);
//SHFileOperationW(int);
WINSHELLAPI int WINAPI SHFindComputer(int,int);
SHSTDAPI_(BOOL) SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
SHSTDAPI_(IContextMenu *) SHFind_InitMenuPopup(HMENU hmenu, HWND hwndOwner, UINT idCmdFirst, UINT idCmdLast);
STDAPI SHFlushClipboard(void);


/*
 * The SHFormatDrive API provides access to the Shell
 *   format dialog. This allows apps which want to format disks
 *   to bring up the same dialog that the Shell does to do it.
 *
 *   This dialog is not sub-classable. You cannot put custom
 *   controls in it. If you want this ability, you will have
 *   to write your own front end for the DMaint_FormatDrive
 *   engine.
 *
 *   NOTE that the user can format as many diskettes in the specified
 *   drive, or as many times, as he/she wishes to. There is no way to
 *   force any specififc number of disks to format. If you want this
 *   ability, you will have to write your own front end for the
 *   DMaint_FormatDrive engine.
 *
 *   NOTE also that the format will not start till the user pushes the
 *   start button in the dialog. There is no way to do auto start. If
 *   you want this ability, you will have to write your own front end
 *   for the DMaint_FormatDrive engine.
 *
 *   PARAMETERS
 *
 *     hwnd    = The window handle of the window which will own the dialog
 *               NOTE that unlike SHCheckDrive, hwnd == NULL does not cause
 *               this dialog to come up as a "top level application" window.
 *               This parameter should always be non-null, this dialog is
 *               only designed to be the child of another window, not a
 *               stand-alone application.
 *     drive   = The 0 based (A: == 0) drive number of the drive to format
 *     fmtID   = The ID of the physical format to format the disk with
 *               NOTE: The special value SHFMT_ID_DEFAULT means "use the
 *                     default format specified by the DMaint_FormatDrive
 *                     engine". If you want to FORCE a particular format
 *                     ID "up front" you will have to call
 *                     DMaint_GetFormatOptions yourself before calling
 *                     this to obtain the valid list of phys format IDs
 *                     (contents of the PhysFmtIDList array in the
 *                     FMTINFOSTRUCT).
 *     options = There is currently only two option bits defined
 *
 *                SHFMT_OPT_FULL
 *                SHFMT_OPT_SYSONLY
 *
 *               The normal defualt in the Shell format dialog is
 *               "Quick Format", setting this option bit indicates that
 *               the caller wants to start with FULL format selected
 *               (this is useful for folks detecting "unformatted" disks
 *               and wanting to bring up the format dialog).
 *
 *               The SHFMT_OPT_SYSONLY initializes the dialog to
 *               default to just sys the disk.
 *
 *               All other bits are reserved for future expansion and
 *               must be 0.
 *
 *               Please note that this is a bit field and not a value
 *               and treat it accordingly.
 *
 *   RETURN
 *      The return is either one of the SHFMT_* values, or if the
 *      returned DWORD value is not == to one of these values, then
 *      the return is the physical format ID of the last succesful
 *      format. The LOWORD of this value can be passed on subsequent
 *      calls as the fmtID parameter to "format the same type you did
 *      last time".
 *
 */
// This is literally from Platform SDK
SHSTDAPI_(DWORD) SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options);
//
// Special value of fmtID which means "use the default format"
//
#ifndef SHFMT_ID_DEFAULT
#define SHFMT_ID_DEFAULT    0xFFFF

//
// Option bits for options parameter
//
#define SHFMT_OPT_FULL     0x0001
#define SHFMT_OPT_SYSONLY  0x0002

//
// Special return values. PLEASE NOTE that these are DWORD values.
//
#define SHFMT_ERROR     0xFFFFFFFFL     // Error on last format, drive may be formatable
#define SHFMT_CANCEL    0xFFFFFFFEL     // Last format was canceled
#define SHFMT_NOFORMAT  0xFFFFFFFDL     // Drive is not formatable
#endif



//WINSHELLAPI int WINAPI SHFree(int);
//SHFreeNameMappings(int);
WINSHELLAPI int WINAPI SHFreeShared(int,int);
WINSHELLAPI int WINAPI SHFreeUnusedLibraries(void);
//SHGetDataFromIDListA(int,int,int,int,int);
//SHGetDesktopFolder(int);
WINSHELLAPI int WINAPI SHGetFileIcon(int,int,int,int);
//SHGetFileInfo(int,int,int,int,int);
//SHGetFileInfoA(int,int,int,int,int);
//SHGetFileInfoW(int,int,int,int,int);
//SHGetInstanceExplorer(int);
//SHGetMalloc(int);
WINSHELLAPI int WINAPI SHGetNetResource(int,int,int,int);
//WINSHELLAPI int WINAPI SHGetNewLinkInfo(int,int,int,int,int);
//WINSHELLAPI int WINAPI SHGetNewLinkInfoA(int,int,int,int,int);
//WINSHELLAPI int WINAPI SHGetNewLinkInfoW(int,int,int,int,int);
//SHGetPathFromIDList(int,int);
//SHGetPathFromIDListA(int,int);
//SHGetPathFromIDListW(int,int);

#if (_WIN32_IE >= 0x0400)
// from Platform SDK
// The pidls that are given to the view via the ChangeNotifyEvents are simple Pidls,
// SHGetRealIDL() will convert them to true PIDLs.
SHSTDAPI SHGetRealIDL(IShellFolder *psf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST * ppidlReal);
#endif // _WIN32_IE >= 0x0400

#ifdef OLD_PLATFORM_SDK
////////////////////////////////////////////////////////////////////
//
// The shell keeps track of some per-user state to handle display
// options that is of major interest to ISVs.
// The key one requested right now is "DoubleClickInWebView".

typedef struct {
    BOOL fShowAllObjects : 1;
    BOOL fShowExtensions : 1;
    BOOL fNoConfirmRecycle : 1;

    BOOL fShowSysFiles : 1;
    BOOL fShowCompColor : 1;
    BOOL fDoubleClickInWebView : 1;
    BOOL fDesktopHTML : 1;
    BOOL fWin95Classic : 1;
    BOOL fDontPrettyPath : 1;
    BOOL fShowAttribCol : 1; // No longer used, dead bit
    BOOL fMapNetDrvBtn : 1;
    BOOL fShowInfoTip : 1;
    BOOL fHideIcons : 1;
    BOOL fWebView : 1;
    BOOL fFilter : 1;
    BOOL fShowSuperHidden : 1;
    BOOL fNoNetCrawling : 1;

    DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
    UINT  uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts

    // Note: Not a typo!  This is a persisted structure so we cannot use LPARAM
    LONG   lParamSort;
    int    iSortDirection;

    UINT   version;

    // new for win2k. need notUsed var to calc the right size of ie4 struct
    // FIELD_OFFSET does not work on bit fields
    UINT uNotUsed; // feel free to rename and use
    BOOL fSepProcess: 1;

    // new for Whistler.
    BOOL fStartPanelOn: 1;       //Indicates if the Whistler StartPanel mode is ON or OFF.

    BOOL fShowStartPage: 1;      //Indicates if the Whistler StartPage on desktop is ON or OFF.

    UINT fSpareFlags : 13;

} SHELLSTATEA, *LPSHELLSTATEA;

typedef struct {
    BOOL fShowAllObjects : 1;
    BOOL fShowExtensions : 1;
    BOOL fNoConfirmRecycle : 1;
    BOOL fShowSysFiles : 1;
    BOOL fShowCompColor : 1;
    BOOL fDoubleClickInWebView : 1;
    BOOL fDesktopHTML : 1;
    BOOL fWin95Classic : 1;
    BOOL fDontPrettyPath : 1;
    BOOL fShowAttribCol : 1;
    BOOL fMapNetDrvBtn : 1;
    BOOL fShowInfoTip : 1;
    BOOL fHideIcons : 1;
    BOOL fWebView : 1;
    BOOL fFilter : 1;
    BOOL fShowSuperHidden : 1;
    BOOL fNoNetCrawling : 1;

    DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
    UINT  uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts

    // Note: Not a typo!  This is a persisted structure so we cannot use LPARAM
    LONG   lParamSort;
    int    iSortDirection;
    UINT   version;

    // new for win2k. need notUsed var to calc the right size of ie4 struct
    // FIELD_OFFSET does not work on bit fields
    UINT uNotUsed; // feel free to rename and use
    BOOL fSepProcess: 1;

    // new for Whistler.
    BOOL fStartPanelOn: 1;       //Indicates if the Whistler StartPage mode is ON or OFF.

    BOOL fShowStartPage: 1;      //Indicates if the Whistler StartPage on desktop is ON or OFF.

    // If you need a new flag, steal a bit from from fSpareFlags.
    UINT fSpareFlags : 13;


} SHELLSTATEW, *LPSHELLSTATEW;

#define SHELLSTATEVERSION_IE4   9
#define SHELLSTATEVERSION_WIN2K 10

#ifdef UNICODE
#define SHELLSTATE   SHELLSTATEW
#define LPSHELLSTATE LPSHELLSTATEW
#else
#define SHELLSTATE   SHELLSTATEA
#define LPSHELLSTATE LPSHELLSTATEA
#endif

#define SHELLSTATE_SIZE_WIN95 FIELD_OFFSET(SHELLSTATE,lParamSort)
#define SHELLSTATE_SIZE_NT4   FIELD_OFFSET(SHELLSTATE,version)
#define SHELLSTATE_SIZE_IE4   FIELD_OFFSET(SHELLSTATE,uNotUsed)
#define SHELLSTATE_SIZE_WIN2K sizeof(SHELLSTATE)
#endif

SHSTDAPI_(void) SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet);
// parameters sinmilar to SHGetSettings

//SHGetSpecialFolderLocation(int,int,int);
//WINSHELLAPI int WINAPI SHGetSpecialFolderPath(int,int,int,int);
WINSHELLAPI int WINAPI SHGlobalDefect(int);
WINSHELLAPI int WINAPI SHHandleDiskFull(int,int);
WINSHELLAPI int WINAPI SHHelpShortcuts_RunDLL(int,int,int,int);
WINSHELLAPI int WINAPI SHHelpShortcuts_RunDLLA(int,int,int,int);
WINSHELLAPI int WINAPI SHHelpShortcuts_RunDLLW(int,int,int,int);
SHSTDAPI SHILCreateFromPath(LPCWSTR szPath, LPITEMIDLIST *ppidl, DWORD *rgfInOut);
WINSHELLAPI int WINAPI SHIsBadInterfacePtr(int,int);
//SHLoadInProc(int);
SHSTDAPI SHLoadOLE(LPARAM lParam);
WINSHELLAPI int WINAPI SHLocalAlloc(int,int);
WINSHELLAPI int WINAPI SHLocalFree(int);
WINSHELLAPI int WINAPI SHLocalReAlloc(int,int,int);
WINSHELLAPI int WINAPI SHLockShared(int,int);
WINSHELLAPI int WINAPI SHLogILFromFSIL(int);

// A usefull function in Defview for mapping idlist into index into system
// image list.  Optionally it can also look up the index of the selected
// icon.
SHSTDAPI_(int) SHMapPIDLToSystemImageListIndex(IShellFolder *pshf, LPCITEMIDLIST pidl, int *piIndexSel);

WINSHELLAPI int WINAPI SHNetConnectionDialog(int,int,int);


/*
 * The SHObjectProperties API provides an easy way to invoke
 *   the Properties context menu command on shell objects.
 *
 *   PARAMETERS
 *
 *     hwnd    The window handle of the window which will own the dialog
 *     dwType       A SHOP_ value as defined below
 *     lpObject     Name of the object, see SHOP_ values below
 *     lpPage       The name of the property sheet page to open to or NULL.
 *
 *   RETURN
 *
 *     TRUE if the Properties command was invoked
 */
SHSTDAPI_(BOOL) SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR lpObject, LPCWSTR lpPage);

#ifndef SHOP_PRINTERNAME
#define SHOP_PRINTERNAME 0x00000001  // lpObject points to a printer friendly name
#define SHOP_FILEPATH    0x00000002  // lpObject points to a fully qualified path+file name
#define SHOP_VOLUMEGUID  0x00000004  // lpObject points to a Volume GUID
#endif


WINSHELLAPI int WINAPI SHOutOfMemoryMessageBox(int,int,int);
WINSHELLAPI int WINAPI SHRegCloseKey(int);
WINSHELLAPI int WINAPI SHRegDeleteKeyW(int,int);
WINSHELLAPI int WINAPI SHRegOpenKeyA(int,int,int);
WINSHELLAPI int WINAPI SHRegOpenKeyW(int,int,int);
WINSHELLAPI int WINAPI SHRegQueryValueA(int,int,int,int);
WINSHELLAPI int WINAPI SHRegQueryValueExA(int,int,int,int,int,int);
WINSHELLAPI int WINAPI SHRegQueryValueExW(int,int,int,int,int,int);
WINSHELLAPI int WINAPI SHRegQueryValueW(int,int,int,int);

typedef WINSHELLAPI int (WINAPI *fnSHRegisterDragDrop)(HWND hWnd, LPDROPTARGET pDropTarget);
extern fnSHRegisterDragDrop SHRegisterDragDrop;

#ifdef OLD_PLATFORM_SDK
typedef enum RESTRICTIONS
{
    REST_NONE                       = 0x00000000,
    REST_NORUN                      = 0x00000001,
    REST_NOCLOSE                    = 0x00000002,
    REST_NOSAVESET                  = 0x00000004,
    REST_NOFILEMENU                 = 0x00000008,
    REST_NOSETFOLDERS               = 0x00000010,
    REST_NOSETTASKBAR               = 0x00000020,
    REST_NODESKTOP                  = 0x00000040,
    REST_NOFIND                     = 0x00000080,
    REST_NODRIVES                   = 0x00000100,
    REST_NODRIVEAUTORUN             = 0x00000200,
    REST_NODRIVETYPEAUTORUN         = 0x00000400,
    REST_NONETHOOD                  = 0x00000800,
    REST_STARTBANNER                = 0x00001000,
    REST_RESTRICTRUN                = 0x00002000,
    REST_NOPRINTERTABS              = 0x00004000,
    REST_NOPRINTERDELETE            = 0x00008000,
    REST_NOPRINTERADD               = 0x00010000,
    REST_NOSTARTMENUSUBFOLDERS      = 0x00020000,
    REST_MYDOCSONNET                = 0x00040000,
    REST_NOEXITTODOS                = 0x00080000,
    REST_ENFORCESHELLEXTSECURITY    = 0x00100000,
    REST_LINKRESOLVEIGNORELINKINFO  = 0x00200000,
    REST_NOCOMMONGROUPS             = 0x00400000,
    REST_SEPARATEDESKTOPPROCESS     = 0x00800000,
    REST_NOWEB                      = 0x01000000,
    REST_NOTRAYCONTEXTMENU          = 0x02000000,
    REST_NOVIEWCONTEXTMENU          = 0x04000000,
    REST_NONETCONNECTDISCONNECT     = 0x08000000,
    REST_STARTMENULOGOFF            = 0x10000000,
    REST_NOSETTINGSASSIST           = 0x20000000,
    REST_NOINTERNETICON             = 0x40000001,
    REST_NORECENTDOCSHISTORY        = 0x40000002,
    REST_NORECENTDOCSMENU           = 0x40000003,
    REST_NOACTIVEDESKTOP            = 0x40000004,
    REST_NOACTIVEDESKTOPCHANGES     = 0x40000005,
    REST_NOFAVORITESMENU            = 0x40000006,
    REST_CLEARRECENTDOCSONEXIT      = 0x40000007,
    REST_CLASSICSHELL               = 0x40000008,
    REST_NOCUSTOMIZEWEBVIEW         = 0x40000009,
    REST_NOHTMLWALLPAPER            = 0x40000010,
    REST_NOCHANGINGWALLPAPER        = 0x40000011,
    REST_NODESKCOMP                 = 0x40000012,
    REST_NOADDDESKCOMP              = 0x40000013,
    REST_NODELDESKCOMP              = 0x40000014,
    REST_NOCLOSEDESKCOMP            = 0x40000015,
    REST_NOCLOSE_DRAGDROPBAND       = 0x40000016,   // Disable Close and Drag & Drop on ALL Bands
    REST_NOMOVINGBAND               = 0x40000017,   // Disable Moving ALL Bands
    REST_NOEDITDESKCOMP             = 0x40000018,
    REST_NORESOLVESEARCH            = 0x40000019,
    REST_NORESOLVETRACK             = 0x4000001A,
    REST_FORCECOPYACLWITHFILE       = 0X4000001B,
    REST_NOLOGO3CHANNELNOTIFY       = 0x4000001C,
    REST_NOFORGETSOFTWAREUPDATE     = 0x4000001D,
    REST_NOSETACTIVEDESKTOP         = 0x4000001E,   // No Active desktop on Settings Menu
    REST_NOUPDATEWINDOWS            = 0x4000001F,   // No Windows Update on Settings Menu
    REST_NOCHANGESTARMENU           = 0x40000020,   // No Context menu or Drag and Drop on Start menu
    REST_NOFOLDEROPTIONS            = 0x40000021,   // No Folder Options on Settings Menu
    REST_HASFINDCOMPUTERS           = 0x40000022,   // Show Start/Search/Computers
    REST_INTELLIMENUS               = 0x40000023,
    REST_RUNDLGMEMCHECKBOX          = 0x40000024,
    REST_ARP_ShowPostSetup          = 0x40000025,   // ARP: Show Post-Setup page
    REST_NOCSC                      = 0x40000026,   // Disable the ClientSide caching on SM
    REST_NOCONTROLPANEL             = 0x40000027,   // Remove the Control Panel only from SM|Settings
    REST_ENUMWORKGROUP              = 0x40000028,   // Enumerate workgroup in root of nethood
    REST_ARP_NOARP                  = 0x40000029,   // ARP: Don't Allow ARP to come up at all
    REST_ARP_NOREMOVEPAGE           = 0x4000002A,   // ARP: Don't allow Remove page
    REST_ARP_NOADDPAGE              = 0x4000002B,   // ARP: Don't allow Add page
    REST_ARP_NOWINSETUPPAGE         = 0x4000002C,   // ARP: Don't allow opt components page
    REST_GREYMSIADS                 = 0x4000002D,    // SM: Allow the greying of Darwin Ads in SM
    REST_NOCHANGEMAPPEDDRIVELABEL   = 0x4000002E,   // Don't enable the UI which allows users to rename mapped drive labels
    REST_NOCHANGEMAPPEDDRIVECOMMENT = 0x4000002F,   // Don't enable the UI which allows users to change mapped drive comments
    REST_MaxRecentDocs              = 0x40000030,
    REST_NONETWORKCONNECTIONS       = 0x40000031,   // No Start Menu | Settings |Network Connections
    REST_FORCESTARTMENULOGOFF       = 0x40000032,   // Force logoff on the Start Menu
    REST_NOWEBVIEW                  = 0x40000033,   // Disable Web View
    REST_NOCUSTOMIZETHISFOLDER      = 0x40000034,   // Disable Customize This Folder
    REST_NOENCRYPTION               = 0x40000035,   // Don't allow file encryption
//  Do NOT use me                     0x40000036,
    REST_DONTSHOWSUPERHIDDEN        = 0x40000037,   // don't show super hidden files
    REST_NOSHELLSEARCHBUTTON        = 0x40000038,
    REST_NOHARDWARETAB              = 0x40000039,   // No Hardware tab on Drives or in control panel
    REST_NORUNASINSTALLPROMPT       = 0x4000003A,   // Don't bring up "Run As" prompt for install programs
    REST_PROMPTRUNASINSTALLNETPATH  = 0x4000003B,   // Force the  "Run As" prompt for install programs on unc/network shares
    REST_NOMANAGEMYCOMPUTERVERB     = 0x4000003C,   // No Manage verb on My Computer
    REST_NORECENTDOCSNETHOOD        = 0x4000003D,   // dont add the recent docs shares to nethood
    REST_DISALLOWRUN                = 0x4000003E,   // don't allow certain apps to be run
    REST_NOWELCOMESCREEN            = 0x4000003F,   // don't allow the welcome screen to be displayed.
    REST_RESTRICTCPL                = 0x40000040,   // only allow certain cpls to be run
    REST_DISALLOWCPL                = 0x40000041,   // don't allow certain cpls to be run
    REST_NOSMBALLOONTIP             = 0x40000042,   // No Start Menu Balloon Tip
    REST_NOSMHELP                   = 0x40000043,   // No Help on the Start Menu
    REST_NOWINKEYS                  = 0x40000044,   // No Windows-X Hot keys
    REST_NOENCRYPTONMOVE            = 0x40000045,   // Don't automatically try to encrypt files that are moved to encryped directories
    REST_NOLOCALMACHINERUN          = 0x40000046,   // ignore HKLM\sw\ms\win\cv\Run and all of it's sub keys
    REST_NOCURRENTUSERRUN           = 0x40000047,   // ignore HKCU\sw\ms\win\cv\Run and all of it's sub keys
    REST_NOLOCALMACHINERUNONCE      = 0x40000048,   // ignore HKLM\sw\ms\win\cv\RunOnce and all of it's sub keys
    REST_NOCURRENTUSERRUNONCE       = 0x40000049,   // ignore HKCU\sw\ms\win\cv\RunOnce and all of it's sub keys
    REST_FORCEACTIVEDESKTOPON       = 0x4000004A,   // Force ActiveDesktop to be turned ON all the time.
    REST_NOCOMPUTERSNEARME          = 0x4000004B,   // removes the "Computers near me" link
    REST_NOVIEWONDRIVE              = 0x4000004C,   // disallows CreateViewObject() on specified drives (CFSFolder only)
    REST_NONETCRAWL                 = 0x4000004D,   // disables the crawling of the WNet namespace.
    REST_NOSHAREDDOCUMENTS          = 0x4000004E,   // don't auto share the Shared Documents/create link
    REST_NOSMMYDOCS                 = 0x4000004F,   // Don't show the My Documents item on the Start Menu.
    REST_NOSMMYPICS                 = 0x40000050,   // Don't show the My Pictures item on the Start Menu
    REST_ALLOWBITBUCKDRIVES         = 0x40000051,   // Bit mask indicating which which drives have bit bucket support
    REST_NONLEGACYSHELLMODE         = 0x40000052,   // new consumer shell modes
    REST_NOCONTROLPANELBARRICADE    = 0x40000053,   // The webview barricade in Control Panel
    REST_NOSTARTPAGE                = 0x40000054,   // Whistler Start Page on desktop.
    REST_NOAUTOTRAYNOTIFY           = 0x40000055,   // Whistler auto-tray notify feature
    REST_NOTASKGROUPING             = 0x40000056,   // Whistler taskbar button grouping feature
    REST_NOCDBURNING                = 0x40000057,   // whistler cd burning feature
    REST_MYCOMPNOPROP               = 0x40000058,   // disables Properties on My Computer's context menu
    REST_MYDOCSNOPROP               = 0x40000059,   // disables Properties on My Documents' context menu
    REST_NOSTARTPANEL               = 0x4000005A,   // Windows start panel (New start menu) for Whistler.
    REST_NODISPLAYAPPEARANCEPAGE    = 0x4000005B,   // disable Themes and Appearance tabs in the Display Control Panel.
    REST_NOTHEMESTAB                = 0x4000005C,   // disable the Themes tab in the Display Control Panel.
    REST_NOVISUALSTYLECHOICE        = 0x4000005D,   // disable the visual style drop down in the Appearance tab of the Display Control Panel.
    REST_NOSIZECHOICE               = 0x4000005E,   // disable the size drop down in the Appearance tab of the Display Control Panel.
    REST_NOCOLORCHOICE              = 0x4000005F,   // disable the color drop down in the Appearance tab of the Display Control Panel.
    REST_SETVISUALSTYLE             = 0x40000060,   // Load the specified file as the visual style.
    REST_STARTRUNNOHOMEPATH         = 0x40000061,   // dont use the %HOMEPATH% env var for the Start-Run dialog
    REST_NOUSERNAMEINSTARTPANEL     = 0x40000062,   // don't show the username is the startpanel.
    REST_NOMYCOMPUTERICON           = 0x40000063,   // don't show my computer anywhere, hide its contents
    REST_NOSMNETWORKPLACES          = 0x40000064,   // don't show network places in startpanel.
    REST_NOSMPINNEDLIST             = 0x40000065,   // don't show the pinned list in startpanel.
    REST_NOSMMYMUSIC                = 0x40000066,   // don't show MyMusic folder in startpanel
    REST_NOSMEJECTPC                = 0x40000067,   // don't show "Undoc PC" command in startmenu
    REST_NOSMMOREPROGRAMS           = 0x40000068,   // don't show "More Programs" button in StartPanel.
    REST_NOSMMFUPROGRAMS            = 0x40000069,   // don't show the MFU programs list in StartPanel.
    REST_NOTRAYITEMSDISPLAY         = 0x4000006A,   // disables the display of the system tray
    REST_NOTOOLBARSONTASKBAR        = 0x4000006B,   // disables toolbar display on the taskbar
    REST_NOSMCONFIGUREPROGRAMS      = 0x4000006F,   // No Configure Programs on Settings Menu
    REST_HIDECLOCK                  = 0x40000070,   // don't show the clock
    REST_NOLOWDISKSPACECHECKS       = 0x40000071,   // disable the low disk space checking
    REST_NOENTIRENETWORK            = 0x40000072,   // removes the "Entire Network" link (i.e. from "My Network Places")
    REST_NODESKTOPCLEANUP           = 0x40000073,   // disable the desktop cleanup wizard
    REST_BITBUCKNUKEONDELETE        = 0x40000074,   // disables recycling of files
    REST_BITBUCKCONFIRMDELETE       = 0x40000075,   // always show the delete confirmation dialog when deleting files
    REST_BITBUCKNOPROP              = 0x40000076,   // disables Properties on Recycle Bin's context menu
    REST_NODISPBACKGROUND           = 0x40000077,   // disables the Desktop tab in the Display CPL
    REST_NODISPSCREENSAVEPG         = 0x40000078,   // disables the Screen Saver tab in the Display CPL
    REST_NODISPSETTINGSPG           = 0x40000079,   // disables the Settings tab in the Display CPL
    REST_NODISPSCREENSAVEPREVIEW    = 0x4000007A,   // disables the screen saver on the Screen Saver tab in the Display CPL
    REST_NODISPLAYCPL               = 0x4000007B,   // disables the Display CPL
    REST_HIDERUNASVERB              = 0x4000007C,   // hides the "Run As..." context menu item
    REST_NOTHUMBNAILCACHE           = 0x4000007D,   // disables use of the thumbnail cache
    REST_NOSTRCMPLOGICAL            = 0x4000007E,   // dont use StrCmpLogical() instead use default CompareString()

    REST_ALLOWUNHASHEDWEBVIEW       = 0x40000082,   // allow the user to be promted to accept web view templates that don't already have an md5 hash in the registry
    REST_ALLOWLEGACYWEBVIEW         = 0x40000083,   // allow legacy webview template to be shown.
    REST_REVERTWEBVIEWSECURITY      = 0x40000084,   // disable added webview security measures (revert to w2k functionality).

    REST_INHERITCONSOLEHANDLES      = 0x40000086,   // ShellExec() will check for the current process and target process being console processes to inherit handles

    REST_NODISCONNECT               = 0x41000001,   // No Disconnect option in Start menu
    REST_NOSECURITY                 = 0x41000002,   // No Security option in start menu
    REST_NOFILEASSOCIATE            = 0x41000003,   // Do not allow user to change file association

} RESTRICTIONS;
#endif


SHSTDAPI_(DWORD) SHRestricted(RESTRICTIONS rest);
WINSHELLAPI int WINAPI SHRevokeDragDrop(int);
WINSHELLAPI BOOL    WINAPI SHRunControlPanel(LPCWSTR lpcszCmdLine, HWND hwndMsgParent);
SHSTDAPI_(void) SHSetInstanceExplorer(IUnknown *punk);

// int SHShellFolderView_Message(HWND hwndCabinet,UINT uMsg, int nCol);
//
// hwndCabinet
//		This hwnd defines the explorer cabinet window that contains the 
//		shellview you need to communicate with.
// uMsg
//		A parameter identifying the SFVM enum to perform.
//	lParam
//		Message dependent parameter
//
//  Return: Unknown
//
//  Messages that can be sent:
// 
//  SFVM_REARRANGE
//    This message gets sent when a column gets clicked to instruct the
//    shell view to re-sort the item list. lParam identifies the column
//    that was clicked.


// Tell the FolderView to rearrange.  The lParam will be passed to
// IShellFolder::CompareIDs
#define SFVM_REARRANGE          0x00000001
#define ShellFolderView_ReArrange(_hwnd, _lparam) \
        (BOOL)SHShellFolderView_Message(_hwnd, SFVM_REARRANGE, _lparam)


// undoc
#define SFVM_GETARRANGECOLUMN   0x00000002


// Add an OBJECT into the view
#define SFVM_ADDOBJECT         0x00000003
#define ShellFolderView_AddObject(_hwnd, _pidl) \
        (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_ADDOBJECT, (LPARAM)_pidl)


// undoc
#define SFVM_GETITEMCOUNT       0x00000004


// undoc
#define SFVM_GETITEMPIDL        0x00000005


// Remove an OBJECT into the view
#define SFVM_REMOVEOBJECT         0x00000006
#define ShellFolderView_RemoveObject(_hwnd, _pidl) \
        (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REMOVEOBJECT, (LPARAM)_pidl)

// updates an object by passing in pointer to two PIDLS, the first
// is the old pidl, the second one is the one with update information.
//
// _ppidl[1] must be a *copy* of a pidl, as control over the lifetime
// of the pidl belongs to the view after successful completion of
// this call.  (Unsuccessful completion (a -1 return) implies failure
// and the caller must free the memory.)  Win95 waits a while before
// freeing the pidl, IE4 frees the pidl immediately.
// IShellFolderView::UpdateObject does not suffer from this problem.
//
#define SFVM_UPDATEOBJECT         0x00000007
#define ShellFolderView_UpdateObject(_hwnd, _ppidl) \
        (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_UPDATEOBJECT, (LPARAM)_ppidl)


// undoc
#define SFVM_SETREDRAW          0x00000008



// Returns an array of the selected IDS to the caller.
//     lparam is a pointer to receive the idlists into
//     return value is the count of items in the array.
#define SFVM_GETSELECTEDOBJECTS 0x00000009
#define ShellFolderView_GetSelectedObjects(_hwnd, ppidl) \
        (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDOBJECTS, (LPARAM)ppidl)
/*typedef struct _SFV_SETITEMPOS
{
        LPCITEMIDLIST pidl;
        POINT pt;
} SFV_SETITEMPOS, *LPSFV_SETITEMPOS;*/


// undoc
#define SFVM_ISDROPONSOURCE     0x000A
#define SFVM_MOVEICONS          0x000B
#define SFVM_GETDRAGPOINT       0x000C
#define SFVM_GETDROPPOINT       0x000D


// Sets the position of an item in the viewer
//     lparam is a pointer to a SVF_SETITEMPOS
//     return value is unused
#define SFVM_SETITEMPOS         0x0000000e
//#define SFVM_SETOBJECTPOS       0x000E
#define ShellFolderView_SetItemPos(_hwnd, _pidl, _x, _y) \
{       SFV_SETITEMPOS _sip = {_pidl, {_x, _y}}; \
        SHShellFolderView_Message(_hwnd, SFVM_SETITEMPOS, (LPARAM)(LPSFV_SETITEMPOS)&_sip);}


// undoc
#define SFVM_ISDROPONBACKGROUND 0x000F



//  Notifies a ShellView when one of its objects get put on the clipboard
//  as a result of a menu command.
//
//
//     lparam is the dwEffect (DROPEFFECT_MOVE, DROPEFFECT_COPY)
//     return value is void.
#define SFVM_SETCLIPBOARD       0x00000010
//#define SFVM_CUTOBJECTS         0x0010
#define ShellFolderView_SetClipboard(_hwnd, _dwEffect) \
        (void)SHShellFolderView_Message(_hwnd, SFVM_SETCLIPBOARD, (LPARAM)(DWORD)(_dwEffect))


// undoc
#define SFVM_TOGGLEAUTOARRANGE  0x0011
#define SFVM_LINEUPICONS        0x0012
#define SFVM_GETAUTOARRANGE     0x0013
#define SFVM_GETSELECTEDCOUNT   0x0014
#define SFVM_GETITEMSPACING     0x0015
#define SFVM_REFRESHOBJECT      0x0016



#define SFVM_SETPOINTS           0x00000017
//#define SFVM_SETCLIPBOARDPOINTS 0x0017
#define ShellFolderView_SetPoints(_hwnd, _pdtobj) \
        (void)SHShellFolderView_Message(_hwnd, SFVM_SETPOINTS, (LPARAM)_pdtobj)


//typedef WINSHELLAPI int (WINAPI *fnSHShellFolderView_Message)(HWND hwndCabinet,UINT uMsg, LPARAM lParam);
//extern fnSHShellFolderView_Message SHShellFolderView_Message;
SHSTDAPI_(LRESULT) SHShellFolderView_Message(HWND hwndMain, UINT uMsg, LPARAM lParam);

//

SHSTDAPI_(LPITEMIDLIST) SHSimpleIDListFromPath(LPCWSTR pszPath);

SHSTDAPI SHStartNetConnectionDialogA(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType);
SHSTDAPI SHStartNetConnectionDialogW(HWND hwnd, LPCWSTR pszRemoteName, DWORD dwType);
#ifndef SHStartNetConnectionDialog
#ifdef UNICODE
#define SHStartNetConnectionDialog  SHStartNetConnectionDialogW
#else
#define SHStartNetConnectionDialog  SHStartNetConnectionDialogA
#endif // !UNICODE
#endif

WINSHELLAPI int WINAPI SHUnlockShared(int);

#ifndef VALIDATEUNC_NOUI
#define VALIDATEUNC_NOUI        0x0002          // don't bring up UI
#define VALIDATEUNC_CONNECT     0x0001          // connect a drive letter
#define VALIDATEUNC_PRINT       0x0004          // validate as print share instead of disk share
#define VALIDATEUNC_VALID       0x0007          // valid flags
#endif


SHSTDAPI_(BOOL) SHValidateUNC(HWND hwndOwner, LPWSTR pszFile, UINT fConnect);


WINSHELLAPI int WINAPI SHWaitForFileToOpen(int,int,int);
WINSHELLAPI int WINAPI SHWaitOp_Operate(int,int);
WINSHELLAPI int WINAPI SHWinHelp(int,int,int,int);
WINSHELLAPI int WINAPI SetAppStartingCursor(int,int);
WINSHELLAPI int WINAPI SheChangeDirA(int);
WINSHELLAPI int WINAPI SheChangeDirExA(int);
WINSHELLAPI int WINAPI SheChangeDirExW(int);
WINSHELLAPI int WINAPI SheChangeDirW(int);
WINSHELLAPI int WINAPI SheConvertPathW(int,int,int);
WINSHELLAPI int WINAPI SheFullPathA(int,int,int);
WINSHELLAPI int WINAPI SheFullPathW(int,int,int);
WINSHELLAPI int WINAPI SheGetCurDrive(void);
WINSHELLAPI int WINAPI SheGetDirA(int,int);
WINSHELLAPI int WINAPI SheGetDirExW(int,int,int);
WINSHELLAPI int WINAPI SheGetDirW(int,int);
WINSHELLAPI int WINAPI SheGetPathOffsetW(int);
WINSHELLAPI int WINAPI SheRemoveQuotesA(int);
WINSHELLAPI int WINAPI SheRemoveQuotesW(int);
WINSHELLAPI int WINAPI SheSetCurDrive(int);
WINSHELLAPI int WINAPI SheShortenPathA(int,int);
WINSHELLAPI int WINAPI SheShortenPathW(int,int);
//ShellAboutA(int,int,int,int);
//ShellAboutW(int,int,int,int);
//ShellExecuteA(int,int,int,int,int,int);
//ShellExecuteEx(int);
//ShellExecuteExA(int);
//ShellExecuteExW(int);
//ShellExecuteW(int,int,int,int,int,int);
WINSHELLAPI int WINAPI ShellHookProc(int,int,int);
//ShellMessageBox
SHSTDAPI_(int)  Shell_GetCachedImageIndex(LPCWSTR pszIconPath, int iIconIndex, UINT uIconFlags);
SHSTDAPI_(BOOL) Shell_GetImageLists(HIMAGELIST *phiml, HIMAGELIST *phimlSmall);

//typedef WINSHELLAPI int (WINAPI *fnShell_MergeMenus)(HMENU hMenuParent, HMENU hMenuNew, int, DWORD dwIdCmdFirst, DWORD dwIdCmdLast,int);
//extern fnShell_MergeMenus Shell_MergeMenus;
// Flags for Shell_MergeMenus
#ifndef MM_ADDSEPARATOR
#define MM_ADDSEPARATOR         0x00000001L
#define MM_SUBMENUSHAVEIDS      0x00000002L
#define MM_DONTREMOVESEPS       0x00000004L
#endif

SHSTDAPI_(UINT) Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);


//Shell_NotifyIcon(int,int);
//Shell_NotifyIconA(int,int);
//Shell_NotifyIconW(int,int);
WINSHELLAPI int WINAPI ShortSizeFormatW(int,int);
SHSTDAPI_(BOOL) SignalFileOpen(LPCITEMIDLIST pidl);

// String functions as per SHWAPI.DLL
// WTF are they doing in shell32.lib ???
// (maybe they arn't anymore!)

#ifndef StrChr
LWSTDAPI_(LPSTR)    StrChrA(LPCSTR lpStart, WORD wMatch);
LWSTDAPI_(LPWSTR)   StrChrW(LPCWSTR lpStart, WCHAR wMatch);
#ifdef UNICODE
#define StrChr StrChrW
#else
#define StrChr StrChrA
#endif // !UNICODE
#endif

#ifndef StrChrI
LWSTDAPI_(LPSTR)    StrChrIA(LPCSTR lpStart, WORD wMatch);
LWSTDAPI_(LPWSTR)   StrChrIW(LPCWSTR lpStart, WCHAR wMatch);
#ifdef UNICODE
#define StrChrI StrChrIW
#else
#define StrChrI StrChrIA
#endif // !UNICODE
#endif

#ifndef StrCmpN
LWSTDAPI_(int)      StrCmpNA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
LWSTDAPI_(int)      StrCmpNW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
#ifdef UNICODE
#define StrCmpN StrCmpNW
#else
#define StrCmpN StrCmpNA
#endif // !UNICODE
#endif

#ifndef StrCmpNI
LWSTDAPI_(int)      StrCmpNIA(LPCSTR lpStr1, LPCSTR lpStr2, int nChar);
LWSTDAPI_(int)      StrCmpNIW(LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar);
#ifdef UNICODE
#define StrCmpNI StrCmpNIW
#else
#define StrCmpNI StrCmpNIA
#endif // !UNICODE
#endif

#ifndef StrCpyN
#define StrCpyNA                lstrcpynA
LWSTDAPI_(LPWSTR)   StrCpyNW(LPWSTR psz1, LPCWSTR psz2, int cchMax);
#ifdef UNICODE
#define StrCpyN StrCpyNW
#else
#define StrCpyN StrCpyNA
#endif // !UNICODE
#endif

WINSHELLAPI int WINAPI StrNCmpA(int,int,int);
WINSHELLAPI int WINAPI StrNCmpIA(int,int,int);
WINSHELLAPI int WINAPI StrNCmpIW(int,int,int);
WINSHELLAPI int WINAPI StrNCmpW(int,int,int);
WINSHELLAPI int WINAPI StrNCpyA(int,int,int);
WINSHELLAPI int WINAPI StrNCpyW(int,int,int);

#ifndef StrRChr
LWSTDAPI_(LPSTR)    StrRChrA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
LWSTDAPI_(LPWSTR)   StrRChrW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
#ifdef UNICODE
#define StrRChr StrRChrW
#else
#define StrRChr StrRChrA
#endif // !UNICODE
#endif

#ifndef StrRChrI
LWSTDAPI_(LPSTR)    StrRChrIA(LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch);
LWSTDAPI_(LPWSTR)   StrRChrIW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch);
#ifdef UNICODE
#define StrRChrI StrRChrIW
#else
#define StrRChrI StrRChrIA
#endif // !UNICODE
#endif

WINSHELLAPI int WINAPI StrRStrA(int,int,int);

#ifndef StrRStrI
LWSTDAPI_(LPSTR)    StrRStrIA(LPCSTR lpSource, LPCSTR lpLast, LPCSTR lpSrch);
LWSTDAPI_(LPWSTR)   StrRStrIW(LPCWSTR lpSource, LPCWSTR lpLast, LPCWSTR lpSrch);
#ifdef UNICODE
#define StrRStrI StrRStrIW
#else
#define StrRStrI StrRStrIA
#endif // !UNICODE
#endif

WINSHELLAPI int WINAPI StrRStrW(int,int,int);
WINSHELLAPI int WINAPI StrRetToStrN(int,int,int,int);

#ifndef StrStr
LWSTDAPI_(LPSTR)    StrStrA(LPCSTR lpFirst, LPCSTR lpSrch);
LWSTDAPI_(LPWSTR)   StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch);
#ifdef UNICODE
#define StrStr StrStrW
#else
#define StrStr StrStrA
#endif // !UNICODE
#endif

#ifndef StrStrI
LWSTDAPI_(LPSTR)    StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch);
LWSTDAPI_(LPWSTR)   StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch);
#ifdef UNICODE
#define StrStrI StrStrIW
#else
#define StrStrI StrStrIA
#endif // !UNICODE
#endif

WINSHELLAPI int WINAPI StrToOleStr(int,int);
WINSHELLAPI int WINAPI StrToOleStrN(int,int,int,int);
WINSHELLAPI int WINAPI WOWShellExecute(int,int,int,int,int,int,int);
WINSHELLAPI int WINAPI Win32CreateDirectory(int,int);
SHSTDAPI_(BOOL) Win32DeleteFile(LPCWSTR pszPath);
WINSHELLAPI int WINAPI Win32RemoveDirectory(int);





DEFINE_GUID(IID_IBrowserFrameOptions,          0x10df43c8L, 0x1dbe, 0x11d3, 0x8b, 0x34, 0x00, 0x60, 0x97, 0xdf, 0x5b, 0xd4);

///////////////////////////////////////////////////////////////////////
// typeDefine the undocumented interfaces
//
/////////////////////////////////////////////////////////////////////////////

// The options and comments are copied from the October 2002 Platform SDK.
// I left the old definition for the interface itself.
#ifndef __IBrowserFrameOptions_INTERFACE_DEFINED__
#define __IBrowserFrameOptions_INTERFACE_DEFINED__

/* interface IBrowserFrameOptions */
/* [local][object][uuid] */ 


enum __MIDL_IBrowserFrameOptions_0001
    {	BFO_NONE	= 0,
	BFO_BROWSER_PERSIST_SETTINGS	= 0x1,
	BFO_RENAME_FOLDER_OPTIONS_TOINTERNET	= 0x2,
	BFO_BOTH_OPTIONS	= 0x4,
	BIF_PREFER_INTERNET_SHORTCUT	= 0x8,
	BFO_BROWSE_NO_IN_NEW_PROCESS	= 0x10,
	BFO_ENABLE_HYPERLINK_TRACKING	= 0x20,
	BFO_USE_IE_OFFLINE_SUPPORT	= 0x40,
	BFO_SUBSTITUE_INTERNET_START_PAGE	= 0x80,
	BFO_USE_IE_LOGOBANDING	= 0x100,
	BFO_ADD_IE_TOCAPTIONBAR	= 0x200,
	BFO_USE_DIALUP_REF	= 0x400,
	BFO_USE_IE_TOOLBAR	= 0x800,
	BFO_NO_PARENT_FOLDER_SUPPORT	= 0x1000,
	BFO_NO_REOPEN_NEXT_RESTART	= 0x2000,
	BFO_GO_HOME_PAGE	= 0x4000,
	BFO_PREFER_IEPROCESS	= 0x8000,
	BFO_SHOW_NAVIGATION_CANCELLED	= 0x10000,
	BFO_QUERY_ALL	= 0xffffffff
    } ;
typedef DWORD BROWSERFRAMEOPTIONS;

// IBrowserFrameOptions

#undef  INTERFACE
#define INTERFACE   IBrowserFrameOptions

DECLARE_INTERFACE_(IBrowserFrameOptions, IUnknown)
{
	// IUnknown methods
	STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;

	// IBrowserFrameOptions methods
	STDMETHOD(GetFrameOptions)(THIS_ DWORD dwRequested, DWORD *pdwResult) PURE;
};

typedef IBrowserFrameOptions FAR* LPBROWSERFRAMEOPTIONS;

#endif


// Definitions for CDefFolderMenu_Create2
// This function implements a default context menu with default commands.
// The callback can be used to react on certain events.
// Definitions taken from platform sdk.
#ifdef OLD_PLATFORM_SDK
#define DFM_MERGECONTEXTMENU         1      // uFlags       LPQCMINFO
#define DFM_INVOKECOMMAND            2      // idCmd        pszArgs
#define DFM_GETDEFSTATICID           14     // idCmd *      0
// Commands from DFM_INVOKECOMMAND when strings are passed in
#define DFM_CMD_PROPERTIES      ((UINT)-5)
typedef TBINFO * LPTBINFO;

typedef DETAILSINFO *PDETAILSINFO;

typedef HRESULT (CALLBACK * LPFNDFMCALLBACK)(IShellFolder *psf, HWND hwnd,
                                             IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam);

SHSTDAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd,
                                UINT cidl, LPCITEMIDLIST *apidl,
                                IShellFolder *psf, LPFNDFMCALLBACK lpfn,
                                UINT nKeys, const HKEY *ahkeyClsKeys,
                                IContextMenu **ppcm);

#endif

// Extra undocumented callback messages
// (discovered by Maksym Schipka)
#define DFM_GETVERBW 15
#define DFM_GETHELPTEXTW 11
#define DFM_GETHELPTEXTA 5
// (and discovered by Henk Devos)
#define DFM_CREATE 3
#define DFM_MEASUREITEM 6
#define DFM_DRAWITEM 7
#define DFM_GETVERBA 16
// Extra command IDs
// (from Axel Sommerfeldt)
#define DFM_CMD_DELETE          ((UINT)-1)
#define DFM_CMD_CUT             ((UINT)-2)
#define DFM_CMD_COPY            ((UINT)-3)
#define DFM_CMD_PASTE           ((UINT)-7)
// (and from Henk Devos)
#define DFM_CMD_CREATESHORTCUT  ((UINT)-4)






// Here are the ordinals for all Shell32 functions.
// It's safer to link them dynamically.
// They may not exist in all versions.
// The gaps are ordinals that don't have associated functions.
// This list corresponds to the Windows 2000 SP2 version of shell32.dll

// 2: SHChangeNotifyRegister
// 3: SHDefExtractIconA
// 4: SHChangeNotifyDeregister
// 5: CFileSearchBand::ResizeBorderDW
// 6: SHDefExtractIconW
// 7: SHLookupIconIndexA
// 8: SHLookupIconIndexW
// 9: PifMgr_OpenProperties
// 10: PifMgr_GetProperties
// 11: PifMgr_SetProperties
// 12: SHStartNetConnectionDialogA
// 13: PifMgr_CloseProperties
// 14: SHStartNetConnectionDialogW
// 15: ILGetDisplayName
// 16: ILFindLastID
// 17: ILRemoveLastID
// 18: ILClone
// 19: ILCloneFirst
// 20: ILGlobalClone
// 21: ILIsEqual
// 22: DAD_DragEnterEx2
// 23: ILIsParent
// 24: ILFindChild
// 25: ILCombine
// 26: ILLoadFromStream
// 27: ILSaveToStream
// 28: SHILCreateFromPath
// 29: PathIsRoot
// 30: PathBuildRootW
// 31: PathFindExtension
// 32: PathAddBackslash
// 33: PathRemoveBlanks
// 34: PathFindFileName
// 35: PathRemoveFileSpec
// 36: PathAppend
// 37: PathCombineW
// 38: PathStripPath
// 39: PathIsUNCW
// 40: PathIsRelativeW
// 41: IsLFNDriveA
// 42: IsLFNDriveW
// 43: PathIsExe
// 44: CheckEscapesA
// 45: PathFileExists
// 46: PathMatchSpec
// 47: PathMakeUniqueName
// 48: PathSetDlgItemPath
// 49: PathQualify
// 50: PathStripToRoot
// 51: PathResolve
// 52: PathGetArgs
// 53: IsSuspendAllowed
// 54: LogoffWindowsDialog
// 55: PathQuoteSpaces
// 56: PathUnquoteSpaces
// 57: PathGetDriveNumber
// 58: ParseField
// 59: RestartDialog
// 60: ExitWindowsDialog
// 61: RunFileDlg
// 62: PickIconDlg
// 63: GetFileNameFromBrowse
// 64: DriveType
// 65: InvalidateDriveType
// 66: IsNetDrive
// 67: Shell_MergeMenus
// 68: SGGetSetSettings
// 69: SHGetNetResource
// 70: SHCreateDefClassObject
// 71: Shell_GetImageLists
// 72: Shell_GetCachedImageIndex
// 73: SHShellFolderView_Message
// 74: SHCreateStdEnumFmtEtc
// 75: PathYetAnotherMakeUniqueName
// 76: DragQueryInfo
// 77: SHMapPIDLToSystemImageListIndex
// 78: OleStrToStrN
// 79: StrToOleStrN
// 80: SHOpenPropSheetW
// 81: CheckEscapesW
// 82: DDECreatePostNotify
// 83: CIDLData_CreateFromIDArray
// 84: SHIsBadInterfacePtr
// 85: OpenRegStream
// 86: SHRegisterDragDrop
// 87: SHRevokeDragDrop
// 88: SHDoDragDrop
// 89: SHCloneSpecialIDList
// 90: SHFindFiles
// 91: SHFindComputer
// 92: PathGetShortPath
// 93: Win32CreateDirectory
// 94: Win32RemoveDirectory
// 95: SHLogILFromFSIL
// 96: StrRetToStrN
// 97: ILGlobalClone
// 98: SHGetRealIDL
// 99: SetAppStartingCursor
// 100: SHRestricted
// 101: FileMenu_HandleNotify
// 102: SHCoCreateInstance
// 103: SignalFileOpen
// 104: FileMenu_DeleteAllItems
// 105: FileMenu_DrawItem
// 106: FileMenu_FindSubMenuByPidl
// 107: FileMenu_GetLastSelectedItemPidls
// 108: FileMenu_HandleMenuChar
// 109: FileMenu_InitMenuPopup
// 110: FileMenu_ComposeA
// 111: FileMenu_Invalidate
// 112: FileMenu_MeasureItem
// 113: FileMenu_ComposeW
// 114: FileMenu_Create
// 115: FileMenu_AppendItem
// 116: FileMenu_TrackPopupMenuEx
// 117: FileMenu_DeleteItemByCmd
// 118: FileMenu_Destroy
// 119: IsLFNDriveW
// 120: FileMenu_AbortInitMenu
// 121: OleFlushClipboard
// 122: RunDll_CallEntry16
// 123: CoFreeUnusedLibraries
// 124: FileMenu_AppendFilesForPidl
// 125: CommandLineToArgvW
// 126: SHOutOfMemoryMessageBox
// 127: SHWinHelp
// 128: DllGetClassObject
// 129: DAD_AutoScroll
// 130: DAD_DragEnter
// 131: DAD_DragEnterEx
// 132: DAD_DragLeave
// 133: Control_FillCache_RunDLL
// 134: DAD_DragMove
// 135: Control_FillCache_RunDLLA
// 136: DAD_SetDragImage
// 137: DAD_ShowDragImage
// 138: Control_FillCache_RunDLLW
// 139: Desktop_UpdateBriefcaseOnEvent
// 140: FileMenu_DeleteItemByIndex
// 141: FileMenu_DeleteMenuItemByFirstID
// 142: FileMenu_DeleteSeparator
// 143: FileMenu_EnableItemByCmd
// 144: FileMenu_GetItemExtent
// 145: PathFindOnPath
// 146: RLBuildListOfPaths
// 147: SHCLSIDFromString
// 148: Control_RunDLL
// 149: SHFind_InitMenuPopup
// 150: Control_RunDLLA
// 151: CFTDlg::OnCancel
// 152: ILGetSize
// 153: ILGetNext
// 154: ILAppendID
// 155: ILFree
// 156: ILGlobalFree
// 157: ILCreateFromPathW
// 158: PathGetExtension
// 159: PathIsDirectory
// 160: SHNetConnectionDialog
// 161: SHRunControlPanel
// 162: SHSimpleIDListFromPath
// 163: StrToOleStr
// 164: Win32DeleteFile
// 165: SHCreateDirectory
// 166: CallCPLEntry16
// 167: SHAddFromPropSheetExtArray
// 168: SHCreatePropSheetExtArray
// 169: SHDestroyPropSheetExtArray
// 170: SHReplaceFromPropSheetExtArray
// 171: PathCleanupSpec
// 172: SHCreateLinks
// 173: SHValidateUNC
// 174: SHCreateShellFolderViewEx
// 175: SHGetSpecialFolderPathW
// 176: SHSetInstanceExplorer
// 177: DAD_SetDragImageFromListView
// 178: SHObjectProperties
// 179: SHGetNewLinkInfoA
// 180: SHGetNewLinkInfoW
// 181: RegisterShellHook
// 182: ShellMessageBoxWrapW
// 183: ShellMessageBoxA
// 184: ArrangeWindows
// 185: SHHandleDiskFull
// 186: ILGetDisplayNameEx
// 187: ILGetPseudoNameW
// 188: ShellDDEInit
// 189: ILCreateFromPathA
// 190: ILCreateFromPathW
// 191: SHUpdateImageA
// 192: SHUpdateImageW
// 193: SHHandleUpdateImage
// 194: SHCreatePropSheetExtArrayEx
// 195: SHFree
// 196: SHAlloc
// 197: CSFVFrame::OnSave
// 198: SHAbortInvokeCommand
// 199: Control_RunDLLAsUserW
// 200: SHCreateDesktop
// 201: SHDesktopMessageLoop
// 202: DDEHandleViewFolderNotify
// 203: AddCommasW
// 204: ShortSizeFormatW
// 205: Printer_LoadIconsW
// 206: Link_AddExtraDataSection
// 207: Link_ReadExtraDataSection
// 208: Link_RemoveExtraDataSection
// 209: Int64ToString
// 210: LargeIntegerToString
// 211: Printers_GetPidl\
// 212: Printer_AddPrinterPropPages
// 213: Printers_RegisterWindowW
// 214: Printers_UnregisterWindow
// 215: SHStartNetConnectionDialogW
// 216: FileMenu_IsFileMenu
// 217: FileMenu_ProcessCommand
// 218: FileMenu_InsertItem
// 219: FileMenu_InsertSeparator
// 220: FileMenu_GetPidl
// 221: FileMenu_EditMode
// 222: FileMenu_HandleMenuSelect
// 223: FileMenu_IsUnexpanded
// 224: FileMenu_DelayedInvalidate
// 225: FileMenu_IsDelayedInvalid
// 226: Control_RunDLLW
// 227: FileMenu_CreateFromMenu
// 228: DllCanUnloadNow
// 229: DllGetClassObject
// 230: FirstUserLogon
// 231: SHSetFolderPathA
// 232: SHSetFolderPathW
// 233: DllGetVersion
// 234: DllInstall
// 235: DllRegisterServer
// 236: DllUnregisterServer
// 237: DoEnvironmentSubstA
// 238: DoEnvironmentSubstW
// 239: PathIsSlowW
// 240: PathIsSlowA
// 241: DragAcceptFiles
// 242: CDocFindLVRange::RemoveItem
// 243: SHSetShellWindowEx
// 244: SHSettingsChanged
// 245: DragFinish
// 246: DragQueryFile
// 247: DragQueryFileA
// 248: DragQueryFileAorW
// 249: PathParseIconLocation
// 250: PathRemoveExtension
// 251: PathRemoveArgs
// 252: PathIsURL
// 253: DragQueryFileW
// 254: DragQueryPoint
// 255: DuplicateIcon
// 256: SHCreateShellFolderView
// 257: SHGetShellFolderViewCB
// 258: LinkWindow_RegisterClass
// 259: LinkWindow_UnregisterClass
// 260: ExtractAssociatedIconA
// 261: ExtractAssociatedIconExA
// 262: ExtractAssociatedIconExW
// 263: ExtractAssociatedIconW
// 264: ExtractIconA
// 265: ExtractIconEx
// 266: ExtractIconExA
// 267: ExtractIconExW
// 268: ExtractIconResInfoA
// 269: ExtractIconResInfoW
// 270: ExtractIconW
// 271: ExtractVersionResource16W
// 272: FindExeDlgProc
// 273: FindExecutableA
// 274: FindExecutableW
// 275: FreeIconList
// 276: InternalExtractIconListA
// 277: InternalExtractIconListW
// 278: OpenAs_RunDLL
// 279: OpenAs_RunDLLA
// 280: OpenAs_RunDLLW
// 281: PrintersGetCommand_RunDLL
// 282: PrintersGetCommand_RunDLLA
// 283: PrintersGetCommand_RunDLLW
// 284: RealShellExecuteA
// 285: RealShellExecuteExA
// 286: RealShellExecuteExW
// 287: RealShellExecuteW
// 288: RegenerateUserEnvironment
// 289: SHAddToRecentDocs
// 290: SHAppBarMessage
// 291: SHBindToParent
// 292: SHBrowseForFolder
// 293: SHBrowseForFolderA
// 294: SHBrowseForFolderW
// 295: SHChangeNotify
// 296: SHChangeNotifySuspendResume
// 297: SHCreateDirectoryExA
// 298: SHCreateDirectoryExW
// 299: SHCreateProcessAsUserW
// 300: SHEmptyRecycleBinA
// 301: SHEmptyRecycleBinW
// 302: SHExtractIconsW
// 303: SHFileOperation
// 304: SHFileOperationA
// 305: SHFileOperationW
// 306: SHFormatDrive
// 307: SHFreeNameMappings
// 308: SHGetDataFromIDListA
// 309: SHGetDataFromIDListW
// 310: SHGetDesktopFolder
// 311: SHGetDiskFreeSpaceA
// 312: SHGetDiskFreeSpaceExA
// 313: SHGetDiskFreeSpaceExW
// 314: SHGetFileInfo
// 315: SHGetFileInfoA
// 316: SHGetFileInfoW
// 317: SHGetFolderLocation
// 318: SHGetFolderPathA
// 319: SHGetFolderPathW
// 320: SHGetIconOverlayIndexA
// 321: SHGetIconOverlayIndexW
// 322: SHGetInstanceExplorer
// 323: SHGetMalloc
// 324: SHGetNewLinkInfo
// 325: SHGetPathFromIDList
// 326: SHGetPathFromIDListA
// 327: SHGetPathFromIDListW
// 328: SHGetSettings
// 329: SHGetSpecialFolderLocation
// 330: SHGetSpecialFolderPathA
// 331: SHGetSpecialFolderPathW
// 332: SHHelpShortcuts_RunDLL
// 333: SHHelpShortcuts_RunDLLA
// 334: SHHelpShortcuts_RunDLLW
// 335: SHInvokePrinterCommandA
// 336: SHInvokePrinterCommandW
// 337: SHIsFileAvailableOffline
// 338: SHLoadInProc
// 339: SHLoadNonloadedIconOverlayIdentifiers
// 340: SHPathPrepareForWriteA
// 341: SHPathPrepareForWriteW
// 342: SHQueryRecycleBinA
// 343: SHQueryRecycleBinW
// 344: SHUpdateRecycleBinIcon
// 345: SheChangeDirA
// 346: SheChangeDirExA
// 347: SheChangeDirExW
// 348: SheChangeDirW
// 349: SheConvertPathW
// 350: SheFullPathA
// 351: SheFullPathW
// 352: SheGetCurDrive
// 353: SheGetDirA
// 354: SheGetDirExW
// 355: SheGetDirW
// 356: SheGetPathOffsetW
// 357: SheRemoveQuotesA
// 358: SheRemoveQuotesW
// 359: SheSetCurDrive
// 360: SheShortenPathA
// 361: SheShortenPathW
// 362: ShellAboutA
// 363: ShellAboutW
// 364: ShellExec_RunDLL
// 365: ShellExec_RunDLLA
// 366: ShellExec_RunDLLW
// 367: ShellExecuteA
// 368: ShellExecuteEx
// 369: ShellExecuteExA
// 370: ShellExecuteExW
// 371: ShellExecuteW
// 372: ShellHookProc
// 373: Shell_NotifyIcon
// 374: Shell_NotifyIconA
// 375: Shell_NotifyIconW
// 376: StrChrA
// 377: StrChrIA
// 378: StrChrIW
// 379: StrChrW
// 380: StrCmpNA
// 381: StrCmpNIA
// 382: StrCmpNIW
// 383: StrCmpNW
// 384: StrCpyNA
// 385: StrCpyNW
// 386: StrNCmpA
// 387: StrNCmpIA
// 388: StrNCmpIW
// 389: StrNCmpW
// 390: StrNCpyA
// 391: StrNCpyW
// 392: StrRChrA
// 393: StrRChrIA
// 394: StrRChrIW
// 395: StrRChrW
// 396: StrRStrA
// 397: StrRStrIA
// 398: StrRStrIW
// 399: StrRStrW
// 400: StrStrA
// 401: StrStrIA
// 402: StrStrIW
// 403: StrStrW
// 404: WOWShellExecute

// 520: _SHAllocShared
// 521: _SHLockShared
// 522:  _SHUnlockShared
// 523: _SHFreeShared
// 524: RealDriveType
// 525: RealDriveTypeFlags
// 526: SHFlushSFCache

// 640: NTSHChangeNotifyRegister
// 641: NTSHChangeNotifyDeregister

// 643: SHChangeNotifyReceive
// 644: SHChangeNotification_Lock
// 645: SHChangeNotification_Unlock
// 646: SHChangeRegistrationReceive
// 647: Desktop_UpdateBriefcaseOnEvent
// 648: SHWaitOp_Operate

// 650: PathIsSameRoot
// 651: OldReadCabinetState
// 652: WriteCabinetState
// 653: PathProcessCommand
// 654: ReadCabinetState

// 660: FileIconInit

// 680: IsUserAnAdmin
// 681: SHGetAppCompatFlags

// 683: SHStgOpenStorageW
// 684: SHStgOpenStorageA
// 685: SHPropStgCreate

// 688: SHPropStgReadMultiple
// 689: SHPropStgWriteMultiple
// 690: SHIsLegacyAnsiProperty

// 700: CDefFolderMenu_Create
// 701: CDefFolderMenu_Create2
// 702: CDefFolderMenu_MergeMenu
// 703: GUIDFromStringA
// 704: GUIDFromStringW

// 707: SHOpenPropSheetA
// 708: SHGetSetFolderCustomSettingsA
// 709: SHGetSetFolderCustomSettingsW

// 711: CheckWinIniForAssocs
// 712: SHCopyMonikerToTemp
// 713: PathIsTemporaryA
// 714: PathIsTemporaryW
// 715: SHCreatePropertyBag






#ifdef __cplusplus
} //extern "C" {
#endif

#endif //_SHLEXT_H_

download shlext.h