Retrieve List of Files from Clipboard
MSDN: Windows Clipboard API
| This is sample code. Add error handling and adjust to your requirements as necessary. |
* Load required Windows API functions =LoadApiDlls() * Open clipboard lnResult = OpenClipboard(_SCREEN.hWnd) * Get handle on file list structure ( Format type 15) lnHdrop = GetClipboardData (15) IF lnHdrop > 0 lcBuffer = SPACE(512) lnSize = LEN(lcBuffer) * Get number of files in the list lnFile = BITOR(0xFFFFFFFF,0) lnFileCount = DragQueryFile(lnHdrop, lnFile, @lcBuffer, lnSize ) * Get each file name FOR lnFile = 0 TO lnFileCount-1 * The name of the file in the lcBuffer including terminating CHR(0), length of the name in lnLen lnLen = DragQueryFile(lnHdrop, lnFile, @lcBuffer, lnSize ) * File name lcFileName = LEFT(lcBuffer, lnLen) ? lnFile+1, lcFileName ENDFOR ENDIF * Empty clipboard, if necessary *= EmptyClipboard() * Close clipboard = CloseClipboard() RETURN FUNCTION LoadApiDlls DECLARE Long OpenClipboard IN WIN32API Long hWndNewOwner DECLARE Long CloseClipboard IN WIN32API DECLARE Long EmptyClipboard IN WIN32API DECLARE Long GetClipboardData IN WIN32API Long lnFormat DECLARE Long DragQueryFile IN Shell32 Long hDrop, Long iFile, String @ lpszFile, Long cch RETURN
Recent comments
1 week 5 days ago
1 week 5 days ago
2 weeks 1 hour ago
2 weeks 1 day ago
2 weeks 2 days ago
2 weeks 5 days ago
3 weeks 5 days ago
3 weeks 6 days ago
4 weeks 13 hours ago
4 weeks 4 days ago