execute application when paste is clicked in windows (explorer)
<p>I have a little question. I have an application, which basically a copier but can do much more other stuff. What I cant get past is this:</p>

<p>I want to open the application when the user selected a few files (in explorer, desktop, eg. anywhere in Windows), and all those selected files, should be in the cache or something like that so that it is in a list or something. This is done by windows, so I don't have to do that. Anycase, so when the user selected all of the files he wanted to select, and copied it, how do I execute the application when the user pastes that files somewhere else? So that it automatically opens?</p>

<p>What I have is this: </p>

<pre><code>    [DllImport("User32.dll")]
    protected static extern int
    SetClipboardViewer(int hWndNewViewer);
    [DllImport("User32.dll", CharSet = CharSet.Auto)]
    public static extern bool
    ChangeClipboardChain(IntPtr hWndRemove,
    IntPtr hWndNewNext);
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    public static extern int SendMessage(IntPtr hwnd, int wMsg,
    IntPtr wParam,
    IntPtr lParam);

    IntPtr nextClipboardViewer;



protected override void WndProc(ref System.Windows.Forms.Message m)
{
    // defined in winuser.h
    const int WM_DRAWCLIPBOARD = 0x308;
    const int WM_CHANGECBCHAIN = 0x030D;

    switch (m.Msg)
    {
        case WM_DRAWCLIPBOARD:
            DisplayClipboardData();
            SendMessage(nextClipboardViewer, m.Msg, m.WParam, m.LParam);
            break;

        case WM_CHANGECBCHAIN:
            if (m.WParam == nextClipboardViewer)
            {
                nextClipboardViewer = m.LParam;
            }
            else
            {
                SendMessage(nextClipboardViewer, m.Msg, m.WParam,
                m.LParam);
            }
            break;

        default:
            base.WndProc(ref m);
            break;
    }
}

void DisplayClipboardData()
{
    try
    {
        IDataObject iData = new DataObject();
        iData = Clipboard.GetDataObject();
        if (iData.GetDataPresent(DataFormats.Rtf))
        {
            richTextBox1.Rtf = (string)iData.GetData(DataFormats.Rtf);
        }
        else if (iData.GetDataPresent(DataFormats.Text))
        {
            richTextBox1.Text = (string)iData.GetData(DataFormats.Text);
        }
        else
        {
            richTextBox1.Text = "[Clipboard data is not RTF or ASCII Text]";
        }


    }
    catch (Exception e)
    {
        MessageBox.Show(e.ToString());
    }
}
</code></pre>

<p>But this only works when text is selected. how can I display the file directory of each file?</p>
