Question How to drag and drop files from explorer to elevated with administrator right application in Windows 10?

yxq

Member
Joined
Jan 22, 2007
Messages
5
Programming Experience
1-3
I found the source codes for my problem on

But it will not work on Windows 10, how to drag and drop in Windows 10? thank you.
 
But it will not work
That's never an adequate explanation. Please provide a FULL and CLEAR explanation of the problem. Explain what you're trying to achieve, post the actual code that you're using (formatted appropriately) and explain what actually happens when you use it. Links to external information, screenshots and the like can help provide clarity but they should never be the meat of your post.
 
The cause is UIPI security in Windows, drag-drop is not allowed between processes running in different execution levels. One workaround is to copy the files in Explorer and read clipboard in your app. You can for example listen to KeyDown event to see the Ctrl-V (keyboard paste), or use other GUI for example a button click.
VB.NET:
Dim data = Clipboard.GetDataObject
If data.GetDataPresent(DataFormats.FileDrop) Then
    Dim files = CType(data.GetData(DataFormats.FileDrop), String())

End If
 
Back
Top