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.
<Window x: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
public
void 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
Все ответы
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. There is Windows Policie which privent you to do such thing
When you run your application Under Admin privialge at that time your Programe have Highest priority, n Explorer have Midioum priority.
Whindos Define that Low Prioprity can not send messge to high prioprity.
If you force fully want to perfom this you may have to change messge priority when messge post to your application ..
Hi there folks
I run vista enterprise in a workgroup, and I have disabled UAC. I dont have any problems like this, I can drag 'n drop as much as I wan't to.
I will bet that if you're running vista in a domain, you have to set these rules (drag 'n drop) via group policies
in active directory, if you are not admin, ask him!
- I'm working on Server 2008 for a Windows SharePoint Services application and I'm finding it almost impossible:
- Can't easily use the GAC
- Can't drag and drop into VS!
- "Allow", "Allow", "Allow"
So I created a shortcut to C:\Windows\Explorer.exe onto the desktop and then "Ran as Administrator" and guess what? It doesn't work. No drag and drop.
- Can't easily use the GAC

