# Obtain list of file(s) currently copied to clipboard

**URL:** <https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498>\
**Category:** Windows\
**Created:** [September 28, 2024, 11:25pm UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498 "2024-09-28T23:25:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_E](https://forum.xojo.com/user_avatar/forum.xojo.com/joseph_e/32/613_2.png) [@Joseph\_E](https://forum.xojo.com/u/Joseph_E)\
**Post date:** [September 28, 2024, 11:25pm UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/1 "2024-09-28T23:25:15Z")

</div>

Files can be copied via right click in windows file explorer. How can I obtain a list of file(s) and resolve to a FolderItem after the user has copied them to the clipboard?

I am seeing in documents text is easy to obtain, so are pictures, but I am not seeing anything on files. RawData may work, but I need to know the data type prior to reading.

Ultimately I want users to be able to use file explorer to copy files, then paste the link to file in my app.

Ideas?

---

<div class="post-metadata">

**Author:** ![Eric\_Williams](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/ecccb3/32.png) [@Eric\_Williams](https://forum.xojo.com/u/Eric_Williams)\
**Post date:** [September 29, 2024, 2:55am UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/2 "2024-09-29T02:55:39Z")

</div>

I’d suggest you experiment with the various object types the Xojo framework knows how to access. Perhaps the file paths are passed as text, for example.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [September 29, 2024, 6:27am UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/3 "2024-09-29T06:27:58Z")

</div>

If you use [MBS Xojo Plugins](https://www.monkeybreadsoftware.de/xojo/), please check [WindowsClipboardMBS](https://www.monkeybreadsoftware.net/class-windowsclipboardmbs.shtml) function and the [GetFiles](https://www.monkeybreadsoftware.net/windows-windowsclipboardmbs-method.shtml#9) function.

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [September 29, 2024, 6:54am UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/4 "2024-09-29T06:54:21Z")

</div>

at windows 11 you have to hold shift and use the menu copy as path.

 ![grafik](https://forum.xojo.com/uploads/default/original/3X/9/f/9f0cfb0c6d74e62d662f7a851e833d0b908d505c.png)

otherwise windows copy file pointers …

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [September 29, 2024, 7:07am UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/6 "2024-09-29T07:07:01Z")

</div>

> [@Emile\_Schwarz](#):
>
> As a user, I would use drag and drop

that could be not feasible because you have to see the files and a window as drop target.  
files could be dropped before the target unwanted and windows messed up.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 29, 2024, 7:09am UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/7 "2024-09-29T07:09:34Z")

</div>

This case never comes to me.

But, as I stated in my prior message, the mechanicsa to get the files contents is the same, so it’s OP UI.

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [September 29, 2024, 8:19am UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/8 "2024-09-29T08:19:50Z")

</div>

Mac users have the tendency to drag and drop  
Windows users have the tendency to right-clic…

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [September 29, 2024, 10:54am UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/9 "2024-09-29T10:54:51Z")

</div>

I think I was wrong (far above)…

In the Exlorer, you Right-Click one or many items,  
In the Xojo window, you place a ConstructContextualMenu Event and deal there with the File(s) yu already have “copied”…

```auto
Function ConstructContextualMenu(base As DesktopMenuItem, x As Integer, y As Integer) Handles ConstructContextualMenu as Boolean
  ' Add some items
  base.AddMenu(New DesktopMenuItem("Paste Item(s)"))
  
  Return True
  
End Function

Function ContextualMenuItemSelected(selectedItem As DesktopMenuItem) Handles ContextualMenuItemSelected as Boolean
  Var Clip As New Clipboard
  
  If SelectedItem <> Nil Then
    
    If selectedItem.Text = "Paste Item(s)" Then 
      
      Beep
    End If
  End If
  
  Clip.Close
  
  Return True
End Function

```

Clip contents:  
 ![image](https://forum.xojo.com/uploads/default/original/3X/3/6/3670ff7d92905767d6b0f89e5a4fdfb1d41290d5.png)

rough, but you get the idea. (done with a mac).  
I selected:

 ![image](https://forum.xojo.com/uploads/default/original/3X/5/4/54040285ce8a379dbb268999054fced7b8226fdc.png)

a rar file, a folder and a jpg file (by pure hazard, the idea was to choose different ob,ects).

---

<div class="post-metadata">

**Author:** ![Joseph\_E](https://forum.xojo.com/user_avatar/forum.xojo.com/joseph_e/32/613_2.png) [@Joseph\_E](https://forum.xojo.com/u/Joseph_E)\
**Post date:** [September 29, 2024, 4:20pm UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/10 "2024-09-29T16:20:50Z")

</div>

This is true, not only that, they can select multiple files while holding the shift or control key while selecting and then right clip to copy all. That’s why I want mechanism to use existing methods the users are used too.

---

<div class="post-metadata">

**Author:** ![Joseph\_E](https://forum.xojo.com/user_avatar/forum.xojo.com/joseph_e/32/613_2.png) [@Joseph\_E](https://forum.xojo.com/u/Joseph_E)\
**Post date:** [September 29, 2024, 4:23pm UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/11 "2024-09-29T16:23:15Z")

</div>

Emile,

I am looking for a Windows solution, hence the Windows category in the OP. But thanks.

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [September 29, 2024, 5:27pm UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/12 "2024-09-29T17:27:27Z")

</div>

i have a other idea which is maybe possible.  
register a send to app for the explorer context menu.  
similar compress to zip menu in windows explorer.  
at least it not need a shift key hold for the extra context menu.  
or this open with app menu.

---

<div class="post-metadata">

**Author:** ![Joseph\_E](https://forum.xojo.com/user_avatar/forum.xojo.com/joseph_e/32/613_2.png) [@Joseph\_E](https://forum.xojo.com/u/Joseph_E)\
**Post date:** [September 29, 2024, 6:27pm UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/13 "2024-09-29T18:27:39Z")

</div>

That’s interesting Markus. Any idea how to do that?

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [September 29, 2024, 7:52pm UTC](https://forum.xojo.com/t/obtain-list-of-file-s-currently-copied-to-clipboard/82498/14 "2024-09-29T19:52:05Z")

</div>

just add a shortcut file to the right folder.

See

> **[How to Customize the 'Send to' Menu in Windows](https://www.pcmag.com/how-to/how-to-customize-the-send-to-menu-in-windows)**
>
> The Windows 'Send to' menu is a handy way to send files to a specific folder, application, or other destination. But you're not stuck with the menu as is.

Your app installer can do this.
