See the documentation:
DragQueryFile function (Windows)[
^].
Call
DragQueryFile
first with
iFile
set to 0xFFFFFFFF. That call will return the number of file names. Then use a loop to get each file name:
UINT fileCount = DragQueryFile(hDrop, 0xffffffff, NULL, 0);
for (UINT i = 0; i < fileCount; i++)
{
DragQueryFile(hDrop, i, lpszFileName, MAX_PATH);
}