Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Problem in reading
1. The address of the source file
2. The address of the destination file

For example, if the user copy file textX.txt from folder C:\Document to folder E:\Data , my application should catch : The source address as C:\Document\textX.txt and The destination address as E:\Data\textX.txt

I already used SystemFileWatcher, but it can catch the destionation address only. How can I get the source address as well?
Posted

1 solution

You should check this articles here on codeproject.

VBDT Global Windows Hook

Yaca, Clipboard little helper.

They use Windows Hook to get a handle on the clipboard, you can then determine when an object is copied and when it is pasted.

You can get the content of the clipboard if it contains a Filepath like this.

C#
using System.Collections.Specialized; //a namespace.
            StringCollection files = Clipboard.GetFileDropList();
            if (files != null)
            {
                foreach (string file in files)
                {
                    MessageBox.Show(file);
                }
            }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900