How to handle drag & drop from low integrity Internet Explorer

March 12th, 2010 - 02:14 pm ET by Jon Potter | Report spam
Hi,

When dragging images, etc out of a low-integrity Internet Explorer window,
the data in the IDataObject appears inaccessible. Calling GetData on any of
the formats simply returns E_FAIL. And yet Explorer is able to handle drag &
drops from IE in this fashion (after showing a security prompt).

What does a third-party app have to do to be able to receive drag & drop
from IE?

Thanks,
Jon Potter
email Follow the discussionReplies 7 repliesReplies Make a reply

Similar topics

Replies

#1 Jim Barry
March 15th, 2010 - 11:35 am ET | Report spam
Jon Potter wrote:
When dragging images, etc out of a low-integrity Internet Explorer
window, the data in the IDataObject appears inaccessible. Calling
GetData on any of the formats simply returns E_FAIL. And yet Explorer is
able to handle drag & drops from IE in this fashion (after showing a
security prompt).

What does a third-party app have to do to be able to receive drag & drop
from IE?



You need to register your app under the registry key
[HKLM\SOFTWARE\Microsoft\Internet Explorer\Low Rights\DragDrop], as
described in the article "Understanding and Working in Protected Mode
Internet Explorer":

http://msdn.microsoft.com/en-us/library/bb250462(VS.85).aspx#wpm_addya

- Jim
Replies Reply to this message
#2 Leo Davidson
March 15th, 2010 - 06:57 pm ET | Report spam
On 15 Mar, 16:35, Jim Barry wrote:

You need to register your app under the registry key
[HKLM\SOFTWARE\Microsoft\Internet Explorer\Low Rights\DragDrop], as
described in the article "Understanding and Working in Protected Mode
Internet Explorer":

http://msdn.microsoft.com/en-us/library/bb250462(VS.85).aspx#wpm_addya



Those registry settings don't seem to make any difference with IE8.

I don't think those registry settings are meant to be required to make
drag & drop *work*, at least according to the documentation: Without
registering there, drag & drop from IE to apps is supposed to work but
with a security prompt. The registry settings are meant to disable the
security prompt for specified apps so you can drop on them without
having to see/click an extra prompt.

The problem is that with IE8 (on Win7 x64), the drop doesn't work at
all, and never shows the security prompt either. Setting the registry
values doesn't seem to change anything.

There's sample code for working with protected mode in IE7, and which
now seems to fail with drops from IE8:

http://www.codeproject.com/KB/vista...Guide.aspx

Seems that IE8 has changed things but the documentation hasn't been
updated.
Replies Reply to this message
#3 Jim Barry
March 16th, 2010 - 04:27 am ET | Report spam
Leo Davidson wrote:
On 15 Mar, 16:35, Jim Barry wrote:
Those registry settings don't seem to make any difference with IE8.



I tested it in Win7 (x86) before posting and it did work. I had to
restart IE after modifying the registry, though.

I don't think those registry settings are meant to be required to make
drag & drop *work*, at least according to the documentation: Without
registering there, drag & drop from IE to apps is supposed to work but
with a security prompt. The registry settings are meant to disable the
security prompt for specified apps so you can drop on them without
having to see/click an extra prompt.



Looks like the default policy has changed from 2 to 0. If the app is not
registered, drag drop is not allowed. If the app is registered with
Policy=2 then drag-drop is allowed, after a security prompt. With
Policy=3, drag-drop is allowed without any prompt.

The default policy is controlled by the registry value "DefaultDragDrop"
under [HKLM\SOFTWARE\Microsoft\Internet Explorer\Low Rights].

The problem is that with IE8 (on Win7 x64), the drop doesn't work at
all, and never shows the security prompt either. Setting the registry
values doesn't seem to change anything.



Well, I suppose there may be a problem with x64. I don't have access to
an x64 system right now but I'll give it a try when I do.

- Jim
Replies Reply to this message
#4 Leo Davidson
March 16th, 2010 - 05:56 am ET | Report spam
On 16 Mar, 09:27, Jim Barry wrote:
Well, I suppose there may be a problem with x64. I don't have access to
an x64 system right now but I'll give it a try when I do.



Many thanks, Jim! That prompted me to look again and find that there
is indeed a difference with x64 systems.

On an x64 machine, the x86 IE looks here:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer
\Low Rights\DragDrop

The x64 IE looks here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Low Rights
\DragDrop

So on x64 you have to register your app in both places. (I guess
portable apps that can't modify the registry are sheep outta
luck. :) )

(If RegEdit was updated to have something like the Explorer's
"compatibility files" toggle/indicator, but for things like the normal
vs Wow6432Node areas and HKLM vs HKCU areas, life would be a lot
easier!)
Replies Reply to this message
#5 Jim Barry
March 16th, 2010 - 11:11 am ET | Report spam
Leo Davidson wrote:
Many thanks, Jim! That prompted me to look again and find that there
is indeed a difference with x64 systems.

On an x64 machine, the x86 IE looks here:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer
\Low Rights\DragDrop

The x64 IE looks here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Low Rights
\DragDrop



Yes, on x64 the 32-bit IE will be subject to registry redirection, as
with all 32-bit apps.

So on x64 you have to register your app in both places. (I guess
portable apps that can't modify the registry are sheep outta
luck. :) )



Right... not quite sure what you mean by "portable apps" though. A
32-bit app can access the 64-bit registry using the KEY_WOW64_64KEY flag.

(If RegEdit was updated to have something like the Explorer's
"compatibility files" toggle/indicator, but for things like the normal
vs Wow6432Node areas and HKLM vs HKCU areas, life would be a lot
easier!)



There is a 32-bit RegEdit in %SystemRoot%\SysWOW64. Annoyingly, the
32-bit and 64-bit versions can't both be run simultaneously, as each one
activates the "previous instance" of the other.

- Jim
Replies Reply to this message
Help Create a new topicNext page Replies Make a reply
Search Make your own search