DragQueryFile

  WORD DragQueryFile(hDrop, iFile, lpFile, cb)    
  HANDLE hDrop; /* identifies structure for dropped files */
  WORD iFile; /* index of file to query */
  LPSTR lpFile; /* buffer for returned filename */
  WORD cb; /* size of buffer for filename */

The DragQueryFile function retrieves filenames for dropped files.

Parameters

hDrop

Identifies the internal data structure containing filenames for the dropped files.

iFile

Specifies the index of the file to query. If the value of the iFile parameter is -1, DragQueryFile returns the number of files dropped. If the value of the iFile parameter is between 0 and the total number of files dropped, DragQueryFile copies the filename corresponding to that value to the buffer pointed to by the lpFile parameter.

lpFile

Points to a null-terminated string that contains the filename of a dropped file when the function returns. If this parameter is NULL, DragQueryFile returns the required size of the buffer (in bytes).

cb

Specifies the size (in bytes) of the lpFile buffer.

Return Value

When the function copies a filename to the lpFile buffer, the return value is the number of bytes copied. If the iFile parameter is 0xFFFF, the return value is the number of dropped files. If the iFile parameter is between 0 and the total number of dropped files and the lpFile parameter is NULL, the return value is the required size of the lpFile buffer.

See Also

DragQueryPoint