You use this to find the number of deleted files:
UINT fileCount = DragQueryFile(hDrop, 0xFFFFFFFF, nullptr, 0);
Using this information, you can select an array of strings and save each file name in an array string:
TCHAR** filenames;
filenames = malloc(fileCount * sizeof(TCHAR*));
for (UINT i = 0; i < fileCount; ++i) {
UINT filenameLength = DragQueryFile(hDrop, i, nullptr, 0);
filenames[i] = malloc(filenameLength);
DragQueryFile(hDrop, i, filenames[i], filenameLength);
}
I understood all this by reading the documentation .
EDIT: ++ ( free), :
std::vector<std::basic_string<TCHAR> > filenames(fileCount);
for (UINT i = 0; i < fileCount; ++i) {
UINT filenameLength = DragQueryFile(hDrop, i, nullptr, 0);
filenames[i].reserve(filenameLength);
DragQueryFile(hDrop, i, &(filenames[i][0]), filenameLength);
}