SAMPLE: FILEDRAG: How to Support File Drag Server Capabilities

Last reviewed: April 30, 1997
Article ID: Q139067
4.00 WINDOWS kbole kbfile kbhowto

The information in this article applies to:

  • Microsoft Win32 Software Development Kit (SDK) version 4.0

SUMMARY

Sample code is available that shows how an application can provide the File Drag drop server capabilities. It shows how to set up the data structures for CF_HDROP and ShellIDList formats. In this sample, the user can enable support for any combination of CF_HDROP and ShellIDList format and see the drag drop result. To obtain this sample:

Download FILEDRAG.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:

  • The Microsoft Network

          On the Edit menu, click Go To, and then click Other Location
          Type mssupport
          Double-click the MS Software Library icon
          Find the appropriate product area
          Download FILEDRAG.EXE (size: 70856 bytes) 
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download FILEDRAG.EXE (size: 70856 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib\Mslfiles directory
          Get FILEDRAG.EXE (size: 70856 bytes) 
    

MORE INFORMATION

In Windows 3.x, the only application that could act as a File Drag-Drop server was File Manager. Now the file drag-drop server capability is extended to all applications via OLE Drag Drop.

An OLE drag-drop server application that supports the CF_HDROP format can support file drag drop as does File Manager. The Windows system generates the appropriate WM_DROPFILES message for client applications that support File Drop, or the Windows system passes the IDataObject if the client application supports OLE Drop target for CF_HDROP format.

One of the new features of the shell is when you drop files on an icon on the desktop. The Shell opens the particular application with the drop file in it provided the application supports command line arguments where file can be passed as in this example:

   notepad.exe myfile.txt

This feature could also be provided by a file drag drop server that supports the ShellIDList format, in addition to the CF_HDROP format.


Additional reference words: 4.00
KBCategory: kbole kbfile kbhowto
KBSubcategory:
Keywords : kbfile kbhowto kbole
Version : 4.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.