Thursday, April 26, 2007

Vista drag and drop

Can someone please help me out?

Application A runs with medium security permissions on Vista.

Application B runs as a Browser Plugin in IE on the same machine.

IE runs with low security permissions on Vista.

Application A will not accept "drags" from application B because Vista prevents lower security applications from giving data (and potentially hurting) higher level applications. In theory this is a nice thing to do.

If you add some registry settings, A can accept "drags" from IE -- woo hoo.

Here is the problem: B sometimes starts its own "drags" and A won't accept them (even though A accepts drags that IE started)

Any ideas? (disabling protected mode does work, but is not really a solution)

6 comments:

Sea said...

Did you solve it? :)
any ideas?

wunda said...

Sea,

We had our plugin create another process -- with the proper registry settings it can. This process has higher security rights than the plugin.

Next, we had the plugin communicate with the process with messages and shared memory, this article came in very handy.

Once we had the messaging setup, we tried to have the new process do a drag drop instead of the plugin, this article helped us remember how to do that in c++.

(We could have done everything from the first article in c#, but we just wanted proof of concept, so modifying the other code was much faster)

We were all excited, the drag worked!

However, the behavior was completely f***ed up.

We ended up with a support call to microsoft, nothing yet...

sea said...

Thank you wunda! We left the problem with drag and drop for future fix because creating new process will change the architecture and it is not so important to have it now. I'll keep reading of your blog not only because I'm curious about the answer of Microsoft support center :) but also I liked your writing style, thought, skills /obviously skilled :)/ and you picture of course ;).
Keep going!

preethi said...

hi wunda,

can you tell me what registry settings did you modify so that user running application B running on IE was able to drag and drop to application A? In my case, from IE I have to be able to drag and drop content to desktop. It works fine in XP and other platforms except Vista :(

thanks,
preethi

wunda said...

preethi,

Is this for an IE plugin or just to accept drags from IE?

If it is IE, I suggest you read this article.

It has information about protected mode and the registry settings.

I'm not completely sure what program you would need to specify in the registry settings though. Maybe explorer?

If its a drop from a plugin, well thats a whole other solution...

-Wendy

bdhc73a said...

I had perhaps the same problem with a drag and drop test program. When run in DEV CPP, it did not accept a drag and drop file. When the executable ran by itself, it did. Same code running under debugger in MSVC++, did accept. All running on Win7, and I used explorer to drag the file.