The target then uses the returned interface pointer or global memory handle to extract the data. When the target calls IDataObject::GetData to extract the data, it specifies a particular file by setting the lindex member of the FORMATETC structure to the zero-based index of the file's FILEDESCRIPTOR structure in the accompanying CFSTR_FILEDESCRIPTOR format. The target treats the data associated with a CFSTR_FILECONTENTS format as if it were a file. The associated CFSTR_FILEDESCRIPTOR format contains a FILEDESCRIPTOR structure for each file that specifies the file's name and attributes. The file can also be a storage or global memory object (TYMED_ISTORAGE or TYMED_HGLOBAL). In that case, the tymed member of the STGMEDIUM structure is set to TYMED_ISTREAM, and the file is represented by an IStream interface. The file is normally represented as a stream object, which avoids having to place the contents of the file in memory. The data consists of an STGMEDIUM structure that represents the contents of one file. This format identifier is used with the CFSTR_FILEDESCRIPTOR format to transfer data as if it were a file, regardless of how it is actually stored. This is important if your application is the source of a drag-and-drop operation on a Windows 3.1 system. If this format is present in a data object, an OLE drag loop simulates WM_DROPFILES functionality with non-OLE drop targets. You can use DragQueryPoint to extract the cursor coordinates. If the object was copied to the clipboard as part of a drag-and-drop operation, the pt member of the DROPFILES structure contains the coordinates of the point where the object was dropped. In this example, '\0' is used to represent the null character, not the literal characters that should be included. For example, if the files c:\temp1.txt and c:\temp2.txt are being transferred, the character array looks like this: c:\temp1.txt'\0'c:\temp2.txt'\0''\0' An additional null character is appended to the final string to terminate the array. The file name array consists of a series of strings, each containing one file's fully qualified path, including the terminating NULL character. If you are creating a CF_HDROP format to place in a data object, you will need to construct the file name array. If you are extracting a CF_HDROP format from a data object, you can use DragQueryFile to extract individual file names from the global memory object. The pFiles member of the DROPFILES structure contains an offset to a double null-terminated character array that contains the file names. The structure's hGlobal member points to a DROPFILES structure as its hGlobal member. The data consists of an STGMEDIUM structure that contains a global memory object. Unlike the other Shell formats, it is predefined, so there is no need to call RegisterClipboardFormat. This clipboard format is used when transferring the locations of a group of existing files. These formats are used to transfer one or more files or other Shell objects. Formats for Communication Between Source and Targetįormats for Transferring File System Objects.Formats for Transferring Virtual Objects.Formats for Transferring File System Objects.The Shell clipboard formats are organized here into three groups, based on how they are used. This function returns a valid clipboard format value, which can then be used as the cfFormat member of a FORMATETC structure. To register a Shell format, include the Shlobj.h header file and pass the CFSTR_ XXX format identifier to RegisterClipboardFormat. However, unlike predefined formats, they must be registered by both source and target before they can be used to transfer data. To differentiate these values from predefined formats, they are often referred to as simply formats. With the exception of DragWindow, they have the form CFSTR_ XXX. With the exception of CF_HDROP, Shell format identifiers are not predefined. These identifiers have predefined values and can be used directly with FORMATETC structures. A common example is CF_TEXT, which is used for transferring ANSI text data. Standard clipboard format identifiers have the form CF_ XXX.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |