I have some lines of code in a method that change my clipboard content:
System.Collections.Specialized.StringCollection stC = new System.Collections.Specialized.StringCollection();
stC.AddRange(System.IO.Directory.GetDirectories(tempPath));
stC.AddRange(System.IO.Directory.GetFiles(tempPath));
Clipboard.Clear();
Clipboard.SetFileDropList(stC);
When I go in debug mode and put a breakpoint into my method all works fine and the clipboard is updated, but the content in the clipboard is not available when my method ends (my folder is not destroyed obviously).
Some ideas?
EDIT:
If I break the execution with a message box before exit it works, otherwise it does not. I tried with SetData object, but it is the same.
EDIT 2:
The filedroplist seems to be into the clipboard but the paste is disabled in the system.
EDIT 3:
I think I've found the problem: the only reason can be because the app takes ownership of the clipboard and does not release it until is closed, so it does not allow external usage of actual content. The only way is to invoke win32 Dll.