OWLNext 7.0
Borland's Object Windows Library for the modern age
|
An item in the shell's name space. More...
#include <owl/shellitm.h>
Classes | |
struct | TCreateStruct |
TCreateStruct contains information to construct a TShellItem Typically a TCreateStruct is returned (for example by GetParentFolder) and this TCreateStruct is used to construct a TshellItem Passed in as arguments to: More... | |
Public Types | |
enum | TDisplayNameKind { Normal = SHGDN_NORMAL , InFolder = SHGDN_INFOLDER , ForParsing = SHGDN_FORPARSING } |
Used by TShelItem::GetDisplayName() and TShellItem::Rename() See MS doc for SHGNO for more information, Programmer's Guide to MS Windows 95, MS Press, p. More... | |
enum | TIconSize { Large = SHGFI_LARGEICON , Small = SHGFI_SMALLICON , Shell = SHGFI_SHELLICONSIZE } |
Used by TShellItem::GetIcon See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp. More... | |
enum | TIconKind { Link = SHGFI_LINKOVERLAY , Open = SHGFI_OPENICON , Selected = SHGFI_SELECTED } |
Used by TShellItem::GetIcon See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp. More... | |
enum | TSpecialFolderKind { RecycleBin = CSIDL_BITBUCKET , ControlPanel = CSIDL_CONTROLS , Desktop = CSIDL_DESKTOP , DesktopFileDir = CSIDL_DESKTOPDIRECTORY , MyComputer = CSIDL_DRIVES , Fonts = CSIDL_FONTS , NetworkNeighborhoodFileDir = CSIDL_NETHOOD , NetworkNeighborhood = CSIDL_NETWORK , CommonDocuments = CSIDL_PERSONAL , Printers = CSIDL_PRINTERS , Programs = CSIDL_PROGRAMS , RecentDocuments = CSIDL_RECENT , SendTo = CSIDL_SENDTO , StartMenu = CSIDL_STARTMENU , Startup = CSIDL_STARTUP , CommonTemplates = CSIDL_TEMPLATES , Favorites = CSIDL_FAVORITES } |
Used by TShellItem::TShellItem(const TSpecialFolderKind kind, HWND windowOwner = 0) See MS doc for SHGetSpecialFolderLocation for more information, Programmer's Guide to MS Windows 95, MS Press, pp. More... | |
enum | TAttribute { atCapabilityMask = SFGAO_CAPABILITYMASK , atCanBeCopied = SFGAO_CANCOPY , atCanBeDeleted = SFGAO_CANDELETE , atCanCreateShortcut = SFGAO_CANLINK , atCanBeMoved = SFGAO_CANMOVE , atCanBeRenamed = SFGAO_CANRENAME , atIsADropTarget = SFGAO_DROPTARGET , atHasAPropertySheet = SFGAO_HASPROPSHEET , atDisplayAttributeMask = SFGAO_DISPLAYATTRMASK , atDisplayGhosted = SFGAO_GHOSTED , atIsShortcut = SFGAO_LINK , atIsReadOnly = SFGAO_READONLY , atIsShared = SFGAO_SHARE , atContentsMask = SFGAO_CONTENTSMASK , atContainsSubFolder = SFGAO_HASSUBFOLDER , atContainsFileSystemFolder = SFGAO_FILESYSANCESTOR , atIsPartOfFileSystem = SFGAO_FILESYSTEM , atIsFolder = SFGAO_FOLDER , atCanBeRemoved = SFGAO_REMOVABLE } |
Used by TShellItem::GetAttributes See MS doc for IShellFolder::GetAttributesOf for more information, Programmer's Guide to MS Windows 95, MS Press, pp. More... | |
enum | TFileOpFlags { AllowUndo = FOF_ALLOWUNDO , NoConfirmation = FOF_NOCONFIRMATION , NoConfirmMkDir = FOF_NOCONFIRMMKDIR , RenameOnCollision = FOF_RENAMEONCOLLISION , Silent = FOF_SILENT , SimpleProgress = FOF_SIMPLEPROGRESS } |
Used by TShellItem::Rename,Copy,Move,Delete See MS doc for SHFILEOPSTRUCT for more information, Programmer's Guide to MS Windows 95, MS Press, pp. More... | |
enum | TBrowseFlags { OnlyComputers , OnlyPrinters , NoNetorkFoldersBelowDomain , OnlyFSAncestors , OnlyFSDirs } |
Used by TShellItem::BrowseForFolder See MS doc for BROWSEINFO for more information, Programmer's Guide to MS Windows 95, MS Press, pp. More... | |
enum | TExeKind { NonExecutable , WindowsNE , WindowsPE , MSDOS , Win32Console } |
Returned by TShellItem::GetExeType See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp. More... | |
Public Member Functions | |
TShellItem (const tchar *path, bool throwOnInvalidPath=true, HWND windowOwner=0) | |
TShellItem constructor to make a TShellItem for a file or directory in the file system. | |
TShellItem (const TSpecialFolderKind kind, HWND windowOwner=0) | |
TShellItem constructor to make a TShellItem for a special folder. | |
TShellItem (const TCreateStruct &cs) | |
TShellItem constructor to make a TShellItem from a TCreateStruct. | |
TShellItem (const TPidl &Pidl, const TComRef< IShellFolder > &parentFolder) | |
TShellItem constructor to make a TShellItem from a TPidl and a TComRef<IShellFolder> (parent folder) | |
TShellItem (LPITEMIDLIST pidl=nullptr, const TComRef< IShellFolder > &parentFolder=TComRef< IShellFolder >(nullptr)) | |
TShellIterm constructor to make a TShellItem from a ITEMIDLIST(pidl) and a TComRef<IShellFolder> (parent folder) | |
TShellItem (const TShellItem &source) | |
TShellItem copy constructor. | |
TShellItem & | operator= (const TShellItem &source) |
TShellItem assignment (from another TShellItem) | |
TShellItem & | operator= (const TCreateStruct &cs) |
TShellItem assignment (from a TCreateStruct) | |
bool | Valid () const |
Determine if TShellItem reprsents a valid item. | |
operator LPCITEMIDLIST () const | |
Allow TShellItems to be used in place of pidls. | |
TExtractIcon | GetExtractIcon (HWND windowOwner=0) |
GetExtractIcon returns an interface pointer to this TShellItem's IExtractIcon OLE interface. | |
TContextMenu | GetContextMenu (HWND windowOwner=0) |
GetContextMenu returns an interface pointer to this TShellItem's IContextMenu OLE interface. | |
TDataObject | GetDataObject (HWND windowOwner=0) |
GetDataObject returns an interface pointer to this TShellItem's IDataObject OLE interface. | |
TDropTarget | GetDropTarget (HWND windowOwner=0) |
GetDropTarget returns an interface pointer to this TShellItem's IDropTarget OLE interface. | |
HICON | GetIcon (TIconSize size=Shell, uint kind=0) |
GetIcon returns a handle to an icon representing this TShellItem. | |
ulong | GetAttributes (const ulong reqAttrib, const bool validateCachedInfo=false) const |
Get Attributes of a TShellItem GetAttributes - Get Capabilities, Display, Contents, & Misc. | |
bool | CanBeCopied (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that can be copied. | |
bool | CanBeDeleted (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that can be deleted. | |
bool | CanCreateShortcut (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item for which a shortcut can be created. | |
bool | CanBeMoved (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that can be moved. | |
bool | CanBeRenamed (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that can be renamed. | |
bool | IsADropTarget (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item is a drop target. | |
bool | HasAPropertySheet (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that has a property sheet. | |
bool | DisplayGhosted (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that should be displayed as ghosted. | |
bool | IsShortcut (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that is a shortcut. | |
bool | IsReadOnly (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that is read only. | |
bool | IsShared (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that is shared. | |
bool | ContainsSubFolder (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that contains a subfolder. | |
bool | ContainsFileSystemFolder (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that contains a file system folder. | |
bool | IsPartOfFileSystem (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that is part of the file system. | |
bool | IsFolder (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that is a folder. | |
bool | CanBeRemoved (const bool validateCachedInfo=false) const |
Return true if the TShellItem represents an item that can be removed. | |
bool | IsDesktop () const |
IsDesktop returns true if the TShellItem respresents the shell's desktop. | |
TPidl | GetPidl () const |
Get TPidl (relative to parent) | |
TPidl | GetFullyQualifiedPidl () const |
Get fully qualified TPidl. | |
TCreateStruct | GetParentFolder () const |
Get Parent Folder. | |
TExeKind | GetExeType (uint *major=0, uint *minor=0) const |
Get type of executable file (may return NonExecutable) | |
TString | GetTypeName () const |
Get type of file (e.g., "Borland C++ Header File", "Notepad File") | |
TString | GetDisplayName (const TDisplayNameKind kind=Normal) const |
Get Displayname (for a TShellItem that's part of the filesystem, this is the filename) | |
TString | GetPath () const |
Get path (only call if the TShellItem is part of the file system (IsPartOfFileSystem == true) | |
void | Rename (const tchar *newName, HWND windowOwner=0, const TDisplayNameKind kind=Normal) |
Rename renames this TShellItem to newName. | |
bool | Copy (const tchar *dest, const bool destIsFolder=true, const USHORT flags=0, const tchar *title=0, HWND windowOwner=0) const |
Copy copies this TShellItem to destination path. | |
bool | Copy (const TShellItem &dest, const USHORT flags=0, const tchar *title=0, HWND windowOwner=0) const |
Copy copies this TShellItem to destination TShellItem. | |
bool | Move (const tchar *destFolder, const USHORT flags=0, const tchar *title=0, HWND windowOwner=0) |
Move moves this TShellItem to destination path (which must be a folder) | |
bool | Move (const TShellItem &destFolder, const USHORT flags=0, const tchar *title=0, HWND windowOwner=0) |
Move moves this TShellItem to destination TShellItem (which must be a folder) | |
bool | Delete (const USHORT flags=0, const tchar *title=0, HWND windowOwner=0) |
Delete deletes this TShellItem. | |
void | AddToRecentDocs () const |
Add to recent docs (Win95 taskbar:Start:Documents) | |
TShellItem | ResolveShortcut (HWND windowOwner=0) |
Get the TShellItem that a shortcut points to. | |
TShellItem | CreateShortCut (TCHAR *pathLink, TCHAR *description) |
Creates a shortcut to this object. | |
bool | operator== (const TShellItem &rhs) const |
Compare sort order of this TShellItem equals another TShellItem. | |
bool | operator!= (const TShellItem &rhs) const |
Compare sort order of this TShellItem is not equal to another TShellItem. | |
bool | operator< (const TShellItem &rhs) const |
Compare sort order of this TShellItem is less than another TShellItem. | |
bool | operator<= (const TShellItem &rhs) const |
Compare sort order of this TShellItem <= another TShellItem. | |
bool | operator> (const TShellItem &rhs) const |
Compare sort order of this TShellItem is greater than another TShellItem. | |
bool | operator>= (const TShellItem &rhs) const |
Compare sort order of this TShellItem >= another TShellItem. | |
void | EnumObjects (IEnumIDList **iface, HWND windowOwner=0, const int kind=-1) const |
EnumObjects is a protected function that returns an IEnumIDList enumerator on a folder. | |
bool | BrowseForFolder (TCreateStruct &cs, HWND windowOwner=0, const tchar *title=0, const UINT flags=0, int *image=0, const bool includeStatus=false, BFFCALLBACK func=0, const LPARAM param=0) const |
Select a Foler under this TShellItem. | |
HRESULT | ParseDisplayName (TCreateStruct &cs, const tchar *displayName, ulong *eaten=nullptr, HWND windowOwner=nullptr, ulong *attrib=nullptr) const |
Parse a display name into a TShellItem (actually, into a TCreateStruct) | |
Public Member Functions inherited from owl::TComRef< IShellFolder > | |
TComRef () | |
TComRef (IShellFolder *iface) | |
TComRef (const TComRef< IShellFolder > &i) | |
TComRef< IShellFolder > & | operator= (IShellFolder *iface) |
TComRef< IShellFolder > & | operator= (const TComRef< IShellFolder > &i) |
IShellFolder * | operator-> () |
IShellFolder * | operator-> () const |
Public Member Functions inherited from owl::TComRefBase< T > | |
operator T* () | |
operator T** () | |
int | operator! () const |
void | operator delete (void *p) |
Static Public Member Functions | |
static HRESULT | CreateShortCut (LPCTSTR objPath, TCHAR *pathLink, TCHAR *description) |
Create a shortcut to a file object. | |
static HRESULT | CreateShortCut (LPCITEMIDLIST pidl, TCHAR *pathLink, TCHAR *description) |
Create a shortcut to a non-file object. | |
Protected Member Functions | |
short | CompareIDs (const TShellItem &rhs) const |
CompareIDs is a protected function that compares a TShellItem's pidl with another TShellItem's pidl. | |
void | EnforceValidity () const |
EnforceValidity is a protected function that checks that a TShellItem is valid before proceeding with an operation that requires the TShellItem to be valid. | |
void | RetrieveIShellFolder () const |
RetrieveIShellFolder is a protected function that checks to see if a TShellItem's IShellFolder interface is already assigned a value. | |
bool | HaveSameParent (const TShellItem &other) const |
HaveSameParent returns true if this TShellItem and other TShellItem have the same immediate parent folder. | |
bool | GetAttribute (const TAttribute at, const bool validateCachedInfo) const |
GetAttribute is a protected function used by all the attribute functions except IsDesktop. | |
Protected Member Functions inherited from owl::TComRefBase< T > | |
TComRefBase (const TComRefBase< T > &i) | |
TComRefBase (T *i) | |
TComRefBase () | |
~TComRefBase () | |
void | Clear () |
Additional Inherited Members | |
Protected Attributes inherited from owl::TComRefBase< T > | |
T * | I |
An item in the shell's name space.
All items in the shell's namespace can be identified by a fully qualified pidl. Another way to uniquely identify an item is via it's parent and an item id (i.e., a single item rather than a list). A TShellItem contains a parent (TComRef<IShellFolder> ParentFolder) and the item id (TPidl pidl)
Definition at line 238 of file shellitm.h.
Used by TShellItem::GetAttributes See MS doc for IShellFolder::GetAttributesOf for more information, Programmer's Guide to MS Windows 95, MS Press, pp.
194-196.
Definition at line 297 of file shellitm.h.
Used by TShellItem::BrowseForFolder See MS doc for BROWSEINFO for more information, Programmer's Guide to MS Windows 95, MS Press, pp.
211-212.
Definition at line 347 of file shellitm.h.
Used by TShelItem::GetDisplayName() and TShellItem::Rename() See MS doc for SHGNO for more information, Programmer's Guide to MS Windows 95, MS Press, p.
Enumerator | |
---|---|
Normal | File object displayed by itself. |
InFolder | File object displayed within a folder. |
ForParsing | File object suitable for parsing. |
Definition at line 244 of file shellitm.h.
Returned by TShellItem::GetExeType See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp.
205-207.
Definition at line 359 of file shellitm.h.
Used by TShellItem::Rename,Copy,Move,Delete See MS doc for SHFILEOPSTRUCT for more information, Programmer's Guide to MS Windows 95, MS Press, pp.
214-215.
Definition at line 334 of file shellitm.h.
Used by TShellItem::GetIcon See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp.
205-207.
Enumerator | |
---|---|
Link | Adds the link overlay to the shell item's icon. |
Open | Retrieves the shell item's open icon. |
Selected | Blends the shell item's icon with the system highlight color. |
Definition at line 262 of file shellitm.h.
Used by TShellItem::GetIcon See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp.
205-207.
Definition at line 252 of file shellitm.h.
Used by TShellItem::TShellItem(const TSpecialFolderKind kind, HWND windowOwner = 0) See MS doc for SHGetSpecialFolderLocation for more information, Programmer's Guide to MS Windows 95, MS Press, pp.
209-210.
Definition at line 273 of file shellitm.h.
owl::TShellItem::TShellItem | ( | const tchar * | path, |
bool | throwOnInvalidPath = true, | ||
HWND | windowOwner = 0 ) |
TShellItem constructor to make a TShellItem for a file or directory in the file system.
If the throwOnInvalidPath argument is true, an exception will be raised if the path is not valid or if the file or directory does not exist. If this argument is false, no exception will be raised and the Valid() function should be called to make sure it returns true. If Valid() returns false, the TShellItem does not represent a object in the shell namespace.
Definition at line 405 of file shellitm.cpp.
References _T, owl::TXShell::Check(), Desktop, owl::TXShell::Raise(), REINTERPRET_CAST, STATIC_CAST, and WARNX.
owl::TShellItem::TShellItem | ( | const TSpecialFolderKind | kind, |
HWND | windowOwner = 0 ) |
TShellItem constructor to make a TShellItem for a special folder.
Special folders can be any specified in the TSpecialFolderKind enum.
(see MS doc for SHGetSpecialFolderLocation for more information, Programmer's Guide to MS Windows 95, MS Press, p. 209)
Definition at line 446 of file shellitm.cpp.
References _T, owl::TXShell::Check(), Desktop, owl::TComRefBase< T >::I, REINTERPRET_CAST, owl::TShell::SHGetDesktopFolder(), owl::TShell::SHGetSpecialFolderLocation(), STATIC_CAST, and WARNX.
owl::TShellItem::TShellItem | ( | const TCreateStruct & | cs | ) |
TShellItem constructor to make a TShellItem from a TCreateStruct.
TCreateStruct contains a TPidl and a TComRef<IShellFolder>ParentFolder which represents the parent folder
TCreateStructs are returned by TShellItem::GetParentFolder() and by the following TShellItemIterator functions: operator ++(pre- &post-fix), operator – (pre- & post-fix), operator [](), and Current()
TCreateStructs are also returned as out parameters of the following TShellItem functions: BrowseForFolder(), ParseDisplayName()
Definition at line 490 of file shellitm.cpp.
owl::TShellItem::TShellItem | ( | const TPidl & | Pidl, |
const TComRef< IShellFolder > & | parentFolder ) |
TShellItem constructor to make a TShellItem from a TPidl and a TComRef<IShellFolder> (parent folder)
Definition at line 510 of file shellitm.cpp.
owl::TShellItem::TShellItem | ( | LPITEMIDLIST | pidl = nullptr, |
const TComRef< IShellFolder > & | parentFolder = TComRef<IShellFolder>(nullptr) ) |
TShellIterm constructor to make a TShellItem from a ITEMIDLIST(pidl) and a TComRef<IShellFolder> (parent folder)
Definition at line 501 of file shellitm.cpp.
owl::TShellItem::TShellItem | ( | const TShellItem & | source | ) |
TShellItem copy constructor.
Definition at line 518 of file shellitm.cpp.
void owl::TShellItem::AddToRecentDocs | ( | ) | const |
Add to recent docs (Win95 taskbar:Start:Documents)
Adds the TShellItem to the taskbar's recent document list (see MS doc for more info on SHAddToRecentDocs, Programmer's Guide to MS Windows 95, MS Press, p.
202)
Definition at line 1380 of file shellitm.cpp.
References EnforceValidity(), GetFullyQualifiedPidl(), owl::TShell::SHAddToRecentDocs(), and STATIC_CAST.
bool owl::TShellItem::BrowseForFolder | ( | TCreateStruct & | cs, |
HWND | windowOwner = 0, | ||
const tchar * | title = 0, | ||
const UINT | flags = 0, | ||
int * | image = 0, | ||
const bool | includeStatus = false, | ||
BFFCALLBACK | func = 0, | ||
const LPARAM | param = 0 ) const |
Select a Foler under this TShellItem.
BrowseForFolder presents a dialog box to the user in which he can select a subfolder.
The root of the dialog box is this TShellItem folder.
Additional Documentation: See MS doc on SHBrowseForFolder for more info, more info, Programmer's Guide to MS Windows 95, MS Press, pp. 202-203.
Definition at line 1489 of file shellitm.cpp.
References _MAX_PATH, _T, owl::TXShell::Check(), Desktop, EnforceValidity(), GetFullyQualifiedPidl(), REINTERPRET_CAST, RetrieveIShellFolder(), owl::TShell::SHBrowseForFolder(), STATIC_CAST, and WARNX.
Return true if the TShellItem represents an item that can be copied.
Definition at line 958 of file shellitm.h.
References atCanBeCopied, and GetAttribute().
Return true if the TShellItem represents an item that can be deleted.
Definition at line 965 of file shellitm.h.
References atCanBeDeleted, and GetAttribute().
Return true if the TShellItem represents an item that can be moved.
Definition at line 980 of file shellitm.h.
References atCanBeMoved, and GetAttribute().
Return true if the TShellItem represents an item that can be removed.
Definition at line 1071 of file shellitm.h.
References atCanBeRemoved, and GetAttribute().
Return true if the TShellItem represents an item that can be renamed.
Definition at line 987 of file shellitm.h.
References atCanBeRenamed, and GetAttribute().
Return true if the TShellItem represents an item for which a shortcut can be created.
Definition at line 973 of file shellitm.h.
References atCanCreateShortcut, and GetAttribute().
|
protected |
CompareIDs is a protected function that compares a TShellItem's pidl with another TShellItem's pidl.
(see MS doc for more info CompareIDs, Programmer's Guide to MS Windows 95, MS Press, p. 194)
Definition at line 1394 of file shellitm.cpp.
References _T, owl::TXShell::Check(), Desktop, EnforceValidity(), GetFullyQualifiedPidl(), HaveSameParent(), STATIC_CAST, and WARNX.
|
inline |
Return true if the TShellItem represents an item that contains a file system folder.
Definition at line 1050 of file shellitm.h.
References atContainsFileSystemFolder, and GetAttribute().
Return true if the TShellItem represents an item that contains a subfolder.
Definition at line 1041 of file shellitm.h.
References atContainsSubFolder, and GetAttribute().
bool owl::TShellItem::Copy | ( | const tchar * | dest, |
const bool | destIsFolder = true, | ||
const USHORT | flags = 0, | ||
const tchar * | title = 0, | ||
HWND | windowOwner = 0 ) const |
Copy copies this TShellItem to destination path.
destIsFolder must tell whether or not dest is a folder
flags are any combination of TFileOpFlags (see MS doc for SHFILEOPSTRUCT for meanings of these flags, Programmer's Guide to MS Windows 95, MS Press, p. 215)
Title is the title displayed in the progress dialog box
windowOwner should be set to the owner of the progress dialog box
See MS doc for SHFileOperation for more information, Programmer's Guide to MS Windows 95, MS Press, p. 204.
Definition at line 845 of file shellitm.cpp.
References _MAX_PATH, _tcscpy, CanBeCopied(), EnforceValidity(), ForParsing, GetDisplayName(), IsFolder(), owl::TXShell::Raise(), owl::TShell::SHChangeNotify(), owl::TShell::SHFileOperation(), and STATIC_CAST.
bool owl::TShellItem::Copy | ( | const TShellItem & | dest, |
const USHORT | flags = 0, | ||
const tchar * | title = 0, | ||
HWND | windowOwner = 0 ) const |
Copy copies this TShellItem to destination TShellItem.
flags are any combination of TFileOpFlags (see MS doc for SHFILEOPSTRUCT for meanings of these flags, Programmer's Guide to MS Windows 95, MS Press, p. 215)
Title is the title displayed in the progress dialog box
windowOwner should be set to the owner of the progress dialog box
See MS doc for SHFileOperation for more information, Programmer's Guide to MS Windows 95, MS Press, p. 204.
Definition at line 900 of file shellitm.cpp.
References Copy(), and ForParsing.
|
static |
Create a shortcut to a non-file object.
Definition at line 1321 of file shellitm.cpp.
References owl::TXShell::Check(), owl::TOle::CoCreateInstance(), REINTERPRET_CAST, and STATIC_CAST.
|
static |
Create a shortcut to a file object.
Definition at line 1284 of file shellitm.cpp.
References owl::TXShell::Check(), owl::TOle::CoCreateInstance(), REINTERPRET_CAST, and STATIC_CAST.
TShellItem owl::TShellItem::CreateShortCut | ( | TCHAR * | linkPath, |
TCHAR * | description ) |
Creates a shortcut to this object.
Definition at line 1356 of file shellitm.cpp.
References TShellItem(), CreateShortCut(), EnforceValidity(), GetFullyQualifiedPidl(), GetPath(), and IsPartOfFileSystem().
bool owl::TShellItem::Delete | ( | const USHORT | flags = 0, |
const tchar * | title = 0, | ||
HWND | windowOwner = 0 ) |
Delete deletes this TShellItem.
flags are any combination of TFileOpFlags (see MS doc for SHFILEOPSTRUCT for meanings of these flags, Programmer's Guide to MS Windows 95, MS Press, p. 215)
Title is the title displayed in the progress dialog box
windowOwner should be set to the owner of the progress dialog box
See MS doc for SHFileOperation for more information, Programmer's Guide to MS Windows 95, MS Press, p. 204.
Definition at line 1010 of file shellitm.cpp.
References TShellItem(), _MAX_PATH, _tcscpy, CanBeDeleted(), EnforceValidity(), ForParsing, GetDisplayName(), IsFolder(), owl::TComRef< T >::operator=(), owl::TXShell::Raise(), owl::TShell::SHChangeNotify(), and owl::TShell::SHFileOperation().
Return true if the TShellItem represents an item that should be displayed as ghosted.
Definition at line 1011 of file shellitm.h.
References atDisplayGhosted, and GetAttribute().
|
protected |
EnforceValidity is a protected function that checks that a TShellItem is valid before proceeding with an operation that requires the TShellItem to be valid.
Definition at line 1424 of file shellitm.cpp.
References _T, owl::TXShell::Raise(), Valid(), and WARNX.
void owl::TShellItem::EnumObjects | ( | IEnumIDList ** | iface, |
HWND | windowOwner = 0, | ||
const int | kind = -1 ) const |
EnumObjects is a protected function that returns an IEnumIDList enumerator on a folder.
Note: This function is only meaningful for folders; consequently, if this function is called on a TShellItem that is not a folder, an exception will be thrown.
Definition at line 1465 of file shellitm.cpp.
References _T, owl::TXShell::Check(), EnforceValidity(), owl::TShellItemIterator::Folders, owl::TComRefBase< T >::I, owl::TShellItemIterator::NonFolders, RetrieveIShellFolder(), and WARNX.
|
protected |
GetAttribute is a protected function used by all the attribute functions except IsDesktop.
Definition at line 579 of file shellitm.cpp.
References EnforceValidity(), and GetAttributes().
ulong owl::TShellItem::GetAttributes | ( | const ulong | reqAttrib, |
const bool | validateCachedInfo = false ) const |
Get Attributes of a TShellItem GetAttributes - Get Capabilities, Display, Contents, & Misc.
GetAttributes gets Capabilities, Display, Contents, & Misc.
Attributes with one call
Attributes with a single call
'validateCachedInfo' defaults to false. If true, the shell will not rely on cached information.
See MS doc for IShellFolder::GetAttributesOf for more information, Programmer's Guide to MS Windows 95, MS Press, pp. 194-195.
Definition at line 559 of file shellitm.cpp.
References _T, owl::TXShell::Check(), CONST_CAST, EnforceValidity(), STATIC_CAST, and WARNX.
TContextMenu owl::TShellItem::GetContextMenu | ( | HWND | windowOwner = 0 | ) |
GetContextMenu returns an interface pointer to this TShellItem's IContextMenu OLE interface.
(see MS doc for information on IContextMenu, Programmer's Guide to MS Windows 95, MS Press, pp. 237-240)
Definition at line 1088 of file shellitm.cpp.
References _T, owl::TXShell::Check(), EnforceValidity(), REINTERPRET_CAST, STATIC_CAST, and WARNX.
TDataObject owl::TShellItem::GetDataObject | ( | HWND | windowOwner = 0 | ) |
GetDataObject returns an interface pointer to this TShellItem's IDataObject OLE interface.
(see MS doc for a very brief description of IDataObject, Programmer's Guide to MS Windows 95, MS Press, p. 113)
Definition at line 1116 of file shellitm.cpp.
References _T, owl::TXShell::Check(), EnforceValidity(), REINTERPRET_CAST, STATIC_CAST, and WARNX.
TString owl::TShellItem::GetDisplayName | ( | const TDisplayNameKind | kind = Normal | ) | const |
Get Displayname (for a TShellItem that's part of the filesystem, this is the filename)
GetDisplayName returns a name for this TShellItem that is suitable to display to the user.
The three options are:
Normal -
Suitable for displaying by itselfInFolder -
Suitable for displaying within its parent folderForParsing -
Suitable to pass to the ParseDiplayName member function
See MS doc for IShellFolder::GetDisplayNameOf for more information, Programmer's Guide to MS Windows 95, MS Press, pp. 197-198.
Definition at line 739 of file shellitm.cpp.
References _T, owl::TXShell::Check(), EnforceValidity(), and WARNX.
TDropTarget owl::TShellItem::GetDropTarget | ( | HWND | windowOwner = 0 | ) |
GetDropTarget returns an interface pointer to this TShellItem's IDropTarget OLE interface.
Definition at line 1142 of file shellitm.cpp.
References _T, owl::TXShell::Check(), EnforceValidity(), REINTERPRET_CAST, STATIC_CAST, and WARNX.
TShellItem::TExeKind owl::TShellItem::GetExeType | ( | uint * | major = 0, |
uint * | minor = 0 ) const |
Get type of executable file (may return NonExecutable)
GetExeType returns the type of executable that is contained in the TShellItem Also, the optional major and minor args return version numbers e.g., return = WindowsPE, major = 4, minor = 0.
See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp. 205-207.
Definition at line 660 of file shellitm.cpp.
References ContainsSubFolder(), EnforceValidity(), GetPath(), IsFolder(), IsPartOfFileSystem(), MSDOS, NonExecutable, owl::TXShell::Raise(), REINTERPRET_CAST, owl::TShell::SHGetFileInfo(), WARNX, Win32Console, WindowsNE, and WindowsPE.
TExtractIcon owl::TShellItem::GetExtractIcon | ( | HWND | windowOwner = 0 | ) |
GetExtractIcon returns an interface pointer to this TShellItem's IExtractIcon OLE interface.
(see MS doc for information on IExtractIcon, Programmer's Guide to MS Windows 95, MS Press, pp. 242-244)
Definition at line 1060 of file shellitm.cpp.
References _T, owl::TXShell::Check(), EnforceValidity(), REINTERPRET_CAST, STATIC_CAST, and WARNX.
TPidl owl::TShellItem::GetFullyQualifiedPidl | ( | ) | const |
Get fully qualified TPidl.
GetFullyQualifiedPidl returns a TPidl that is fully qualified (from the desktop).
Definition at line 641 of file shellitm.cpp.
References Desktop, EnforceValidity(), ForParsing, and GetDisplayName().
GetIcon returns a handle to an icon representing this TShellItem.
size can be Large, Small, or Shell kind can be Link, Open, or Selected (see MS doc on SHGetFileInfo for meanings, Programmer's Guide to MS Windows 95, MS Press, pp. 206-207)
Definition at line 1171 of file shellitm.cpp.
References _MAX_PATH, _T, owl::TXShell::Check(), COUNTOF, EnforceValidity(), GetExtractIcon(), IsPartOfFileSystem(), Open, owl::TXShell::Raise(), Shell, owl::TShell::SHGetFileInfo(), Small, and WARNX.
TShellItem::TCreateStruct owl::TShellItem::GetParentFolder | ( | ) | const |
Get Parent Folder.
GetParentFolder returns a TCreateStruct representing the folder which contains the TShellItem.
Definition at line 605 of file shellitm.cpp.
References _T, owl::TXShell::Check(), Desktop, EnforceValidity(), GetFullyQualifiedPidl(), IsDesktop(), REINTERPRET_CAST, STATIC_CAST, owl::TPidl::StripLastItem(), and WARNX.
TString owl::TShellItem::GetPath | ( | ) | const |
Get path (only call if the TShellItem is part of the file system (IsPartOfFileSystem == true)
GetPath returns the fully qualified path representing this TShellItem.
Definition at line 773 of file shellitm.cpp.
References _MAX_PATH, GetFullyQualifiedPidl(), owl::TXShell::Raise(), owl::TShell::SHGetPathFromIDList(), and WARNX.
|
inline |
Get TPidl (relative to parent)
Get a TShellItem's TPidl.
Definition at line 1110 of file shellitm.h.
TString owl::TShellItem::GetTypeName | ( | ) | const |
Get type of file (e.g., "Borland C++ Header File", "Notepad File")
GetTypeName returns the type of item that is represented by this TShellItem examples: application, notepad file, ...
See MS doc for SHGetFileInfo for more information, Programmer's Guide to MS Windows 95, MS Press, pp. 205-207.
Definition at line 708 of file shellitm.cpp.
References _T, EnforceValidity(), GetDisplayName(), GetPidl(), owl::TXShell::Raise(), and WARNX.
Return true if the TShellItem represents an item that has a property sheet.
Definition at line 1001 of file shellitm.h.
References atHasAPropertySheet, and GetAttribute().
|
inlineprotected |
HaveSameParent returns true if this TShellItem and other TShellItem have the same immediate parent folder.
Definition at line 1160 of file shellitm.h.
References CONST_CAST, and STATIC_CAST.
Return true if the TShellItem represents an item is a drop target.
Definition at line 994 of file shellitm.h.
References atIsADropTarget, and GetAttribute().
bool owl::TShellItem::IsDesktop | ( | ) | const |
IsDesktop returns true if the TShellItem respresents the shell's desktop.
Definition at line 593 of file shellitm.cpp.
References Desktop, EnforceValidity(), and owl::TComRefBase< T >::I.
Return true if the TShellItem represents an item that is a folder.
Definition at line 1064 of file shellitm.h.
References atIsFolder, and GetAttribute().
Return true if the TShellItem represents an item that is part of the file system.
Definition at line 1057 of file shellitm.h.
References atIsPartOfFileSystem, and GetAttribute().
Return true if the TShellItem represents an item that is read only.
Definition at line 1025 of file shellitm.h.
References atIsReadOnly, and GetAttribute().
Return true if the TShellItem represents an item that is shared.
Definition at line 1032 of file shellitm.h.
References atIsShared, and GetAttribute().
Return true if the TShellItem represents an item that is a shortcut.
Definition at line 1018 of file shellitm.h.
References atIsShortcut, and GetAttribute().
bool owl::TShellItem::Move | ( | const tchar * | destFolder, |
const USHORT | flags = 0, | ||
const tchar * | title = 0, | ||
HWND | windowOwner = 0 ) |
Move moves this TShellItem to destination path (which must be a folder)
flags are any combination of TFileOpFlags (see MS doc for SHFILEOPSTRUCT for meanings of these flags, Programmer's Guide to MS Windows 95, MS Press, p. 215)
Title is the title displayed in the progress dialog box
windowOwner should be set to the owner of the progress dialog box
See MS doc for SHFileOperation for more information, Programmer's Guide to MS Windows 95, MS Press, p. 204.
Definition at line 921 of file shellitm.cpp.
References TShellItem(), _MAX_PATH, _T, _tcscat, _tcscpy, _tcslen, AnsiPrev, CanBeMoved(), EnforceValidity(), ForParsing, GetDisplayName(), IsFolder(), owl::TXShell::Raise(), owl::TShell::SHChangeNotify(), owl::TShell::SHFileOperation(), and STATIC_CAST.
bool owl::TShellItem::Move | ( | const TShellItem & | destFolder, |
const USHORT | flags = 0, | ||
const tchar * | title = 0, | ||
HWND | windowOwner = 0 ) |
Move moves this TShellItem to destination TShellItem (which must be a folder)
flags are any combination of TFileOpFlags (see MS doc for SHFILEOPSTRUCT for meanings of these flags, Programmer's Guide to MS Windows 95, MS Press, p. 215)
Title is the title displayed in the progress dialog box
windowOwner should be set to the owner of the progress dialog box
See MS doc for SHFileOperation for more information, Programmer's Guide to MS Windows 95, MS Press, p. 204.
Definition at line 989 of file shellitm.cpp.
References ForParsing, and Move().
|
inline |
Allow TShellItems to be used in place of pidls.
use TShellItem in place of an LPITEMIDLIST (pidl)
Definition at line 1103 of file shellitm.h.
|
inline |
Compare sort order of this TShellItem is not equal to another TShellItem.
Definition at line 1138 of file shellitm.h.
References operator==().
|
inline |
Compare sort order of this TShellItem is less than another TShellItem.
Definition at line 1124 of file shellitm.h.
References CompareIDs().
|
inline |
Compare sort order of this TShellItem <= another TShellItem.
Definition at line 1145 of file shellitm.h.
References operator>().
TShellItem & owl::TShellItem::operator= | ( | const TCreateStruct & | cs | ) |
TShellItem assignment (from a TCreateStruct)
Definition at line 540 of file shellitm.cpp.
References owl::TComRefBase< T >::Clear().
TShellItem & owl::TShellItem::operator= | ( | const TShellItem & | source | ) |
TShellItem assignment (from another TShellItem)
Definition at line 527 of file shellitm.cpp.
References owl::TComRef< T >::operator=().
|
inline |
Compare sort order of this TShellItem equals another TShellItem.
Definition at line 1117 of file shellitm.h.
References CompareIDs().
|
inline |
Compare sort order of this TShellItem is greater than another TShellItem.
Definition at line 1131 of file shellitm.h.
References CompareIDs().
|
inline |
Compare sort order of this TShellItem >= another TShellItem.
Definition at line 1152 of file shellitm.h.
References operator<().
HRESULT owl::TShellItem::ParseDisplayName | ( | TCreateStruct & | cs, |
const tchar * | displayName, | ||
ulong * | eaten = nullptr, | ||
HWND | windowOwner = nullptr, | ||
ulong * | attrib = nullptr ) const |
Parse a display name into a TShellItem (actually, into a TCreateStruct)
ParseDisplayName parses a "for parsing" display name into a TCreateStruct (which can be used to create a TShellItem).
In general, it is not necessary to call this function when using OWL's shell classes.
Additional Documentation: See MS doc on IShellFolder::ParseDisplayName for more info, Programmer's Guide to MS Windows 95, MS Press, pp. 191-192.
Definition at line 1549 of file shellitm.cpp.
References EnforceValidity(), owl::TComRefBase< T >::I, and RetrieveIShellFolder().
void owl::TShellItem::Rename | ( | const tchar * | newName, |
HWND | windowOwner = 0, | ||
const TDisplayNameKind | kind = Normal ) |
Rename renames this TShellItem to newName.
kind indicates the kind of name being passed (Normal, InFolder, or ForParsing) (see GetDisplayName for description of these)
See MS doc for IShellFolder::SetNameOf for more information, Programmer's Guide to MS Windows 95, MS Press, pp. 198-199.
Definition at line 798 of file shellitm.cpp.
References _MAX_PATH, _T, _tcscat, _tcscpy, CanBeRenamed(), owl::TXShell::Check(), ForParsing, GetDisplayName(), GetParentFolder(), IsFolder(), owl::TXShell::Raise(), owl::TShell::SHChangeNotify(), STATIC_CAST, and WARNX.
TShellItem owl::TShellItem::ResolveShortcut | ( | HWND | windowOwner = 0 | ) |
Get the TShellItem that a shortcut points to.
ResolveShortcut resolves this TShellItem (if it's a shortcut) and returns the underlying TShellItem.
If this TShellItem is not a shortcut, it just returns itself.
Definition at line 1223 of file shellitm.cpp.
References TShellItem(), owl::TXShell::Check(), owl::TOle::CoCreateInstance(), Desktop, EnforceValidity(), GetPath(), IsShortcut(), REINTERPRET_CAST, and STATIC_CAST.
|
protected |
RetrieveIShellFolder is a protected function that checks to see if a TShellItem's IShellFolder interface is already assigned a value.
If not, it will BindToObject in order to assign the interface a value. Note: Only TShellItem's that are folders have an IShellFolder interface; consequently, if this function is called on a TShellItem that is not a folder, an exception will be thrown.
Definition at line 1442 of file shellitm.cpp.
References _T, owl::TXShell::Check(), CONST_CAST, EnforceValidity(), owl::TComRefBase< T >::I, REINTERPRET_CAST, STATIC_CAST, and WARNX.
|
inline |
Determine if TShellItem reprsents a valid item.
Return true if the TShellItem represents an item in the namespace.
Definition at line 949 of file shellitm.h.