This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

39
guitar/DragQueryFile.hpp Normal file
View File

@@ -0,0 +1,39 @@
#ifndef _COMMON_DRAGQUERYFILE_HPP_
#define _COMMON_DRAGQUERYFILE_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
class DragQueryFile
{
public:
static bool getFileNames(HDROP hDrop,Block<String> &strFileNames);
private:
};
inline
bool DragQueryFile::getFileNames(HDROP hDrop,Block<String> &strFileNames)
{
String strBuffer;
UINT numFiles;
strFileNames.remove();
strBuffer.reserve(512);
if(0==hDrop)return false;
numFiles=::DragQueryFile(hDrop,0xFFFFFFFF,0,0);
if(!numFiles)return false;
for(int index=0;index<numFiles;index++)
{
::DragQueryFile(hDrop,index,strBuffer,512);
strFileNames.insert(&strBuffer);
}
return strFileNames.size()?true:false;
}
#endif