#Include "window9.bi"

Function GetClipBoardFile() As String Export
	Dim Handle as Handle,_
	sRet As String,_
	buffer As ZString*MAX_PATH,_
	i As Integer, numFiles As Integer

	If IsClipboardFormatAvailable(CF_HDROP) = 0 Then Exit Function
	If OpenClipboard(0) = 0 Then Exit Function
	Handle = Cast(DROPFILES Ptr,GetClipboardData(CF_HDROP))
	if Handle <> 0 then
		numFiles = DragQueryFile(Handle, &hFFFFFFFF, 0, 0)
		for i = 0 to numfiles - 1
			DragQueryFile(Handle, i, @buffer, SizeOf(buffer))
			sRet = sRet & buffer & Chr(0) 
		Next
		CloseClipboard()
	endif
   sRet = sRet & Chr(0) 
   Return sRet
End Function
