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

yxq

New member
Joined
Jan 22, 2007
Messages
1
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.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,368
Location
Sydney, Australia
Programming Experience
10+
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.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,452
Location
Norway
Programming Experience
10+
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
 
Top Bottom