在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
使窗口支持Windows Shell的文件拖放功能简单的方式是使用Windows API: DragAcceptFiles,然后使用Delphi的VCL消息函数重载机制处理WM_DROPFILES消息,调用DragQueryFile即可.
DragAcceptFiles Function -------------------------------------------------------------------------------- Registers whether a window accepts dropped files. Syntax VOID DragAcceptFiles( HWND hWnd, hWnd No return value. Remarks An application that calls DragAcceptFiles with the fAccept parameter set to TRUE has identified itself as able to process the WM_DROPFILES message from File Manager. Function Information Minimum DLL Version shell32.dll version 4.0 or later
DragQueryFile Function -------------------------------------------------------------------------------- Retrieves the names of dropped files that result from a successful drag-and-drop operation. Syntax UINT DragQueryFile( HDROP hDrop, hDrop When the function copies a file name to the buffer, the return value is a count of the characters copied, not including the terminating null character. If the index value is 0xFFFFFFFF, the return value is a count of the dropped files. Note that the index variable itself returns unchanged, and will therefore remain 0xFFFFFFFF. If the index value is between zero and the total number of dropped files and the lpszFile buffer address is NULL, the return value is the required size, in characters, of the buffer, not including the terminating null character. Windows 95/98/Me: DragQueryFile is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows Me/98/95 Systems.
Function Information Minimum DLL Version shell32.dll version 4.0 or later
unit fm_DropFiles;
下载:http://www.ctdisk.com/file/5490633 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论