Drag And Drop not working on vista
Hello,
I wrote a very basic wpf window to do some drag and drop of files and folders.
<Windowx:Class="WindowsApplication3.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WindowsApplication3"Height="300"Width="300"AllowDrop="True"Drop="OnDrop"
><Grid></Grid>
</Window>
and the only function
publicvoid OnDrop(object sender,DragEventArgs e){}
This code is perfectly working under windows xp but when I use it under windows vista I can't drop any things on the window.
Does someone manage to get the drag and drop feature working on vista?
Is there something to add to get it work?
(The purpose is to drag and drop files and folders to the window)
Any input would be very welcome.
Thx
[2057 byte] By [
Gomata] at [2008-1-4]
Hi,
I tried to get it work but i can't manage to do it.
I tried to change the drag effect during the drag over event but I don't even get the even to be fired.
The only thing I get is the forbiden icon when I move files and folders over the application window.
The code was perfectly working under windows XP and not at all under vista.
I don't have any clue about what's going wrong or what is requiered to get it work under windows vista.
If any one could help I would appreciate.
Thank you
Hello,
I found a post (http://wundasworld.blogspot.com/2007/04/vista-drag-and-drop.html) that say's that
Application A will not accept "drags" from application B because Vista prevents lower security applications from giving data (and potentially hurting) higher level applications.
I m runing visual studio as administrator and the files comes from the explorer that is probably not runing as administrator.
Any one knows more about this issue?
I noticed this as well -- but didn't investigate thoroughly.
Try running your application outside of Visual Studio. Does the drag/drop work there? My experience shows that it does. I believe you can attach to the other process and debug it that way if necessary (I don't recall that needing elevated privileges).
Try running an Explorer instance (source for drag) as an Administrator -- does drag work when running debugging/from Visual Studio?
Third -- try not running VS as an admin in Vista.
I am facing the same issues mentioned above on Vista.
I have an application developed in C# that uses a listbox with drag and drop feature. when i run it with a non-admin privileges the drag and drop works fine. however when i run it with the admin privileges it just does not work.
I require that the application HAS to run with admin privileges as there are a couple of directories/files i need to create/modify and this sometimes fails in with the normal privileges.
Has anyone got drag and drop working with Admin Privileges on Vista?
if you have plz let me know how? plz mail me @ manish.goyal@in.v2solutions.com
thanks a lot in advance.
There may be no workaround to this problem as this is a Vista issue, not WPF. Rather than running your application as administrator, is it possible to grant additional security to the directories and folders to the normal user rather than elevating privileges of the application?
If you drag from one admin window to another admin window, does that work?
The problem is that you're not allowed to drag from one application running with a normal user security token to another application running with an elevated security token.