Skip to main content

Drag & Drop in WebBrowser

5 replies [Last post]
dargham
Offline
Joined: 2005-03-17

Hello,

Is it possible to prevent drag and drop between the windows desktop and the WebBrowser? If not, I suggest it as a future enhancement.

Thanks,
Basheer

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
georgez
Offline
Joined: 2003-08-19

Hello Basheer,

With the current API, there is no way for that. Could you state your case why you want to prevent it ?

And I'd appreciate it if you fire an issue with type "ENHANCEMENT":
https://jdic.dev.java.net/servlets/ProjectIssues

Thanks,
-George.

dargham
Offline
Joined: 2005-03-17

George,

Thanks for your response.

The case I'm in is that I'm porting a web-based application to become a standalone, CD application. The idea is to run a Java-based webserver (e.g. Jetty) and the browser both in the same runtime to be able to start and stop them when I want. To the end user, it should appear to be a standalone application.

Via Javascript, I can disable the contextual menus and the hitting of keys like backspace or F5 to prevent the user from breaking the application workflow but I can't stop them from dragging into the application a random web link.

Best regards,
Basheer

georgez
Offline
Joined: 2003-08-19

Hi Basheer,

I understand, and saw your reported issue, thanks !

I'll take a look at it.

-George.

ashikaumanga
Offline
Joined: 2008-04-01

Hi George ,

I also wanted to disable drag and drop feature in my IE. So i tried it by modifying the 'ie' VC++ project.
I tried following ,but it didnt solved by issue.Could you please guide me on this?

Best Regards
Umanga.

void BrowserWindow::CreateChildBrowserWindow(IDispatch **ppDisp)
{
........
pChild->m_pWB->put_RegisterAsBrowser(VARIANT_FALSE);
pChild->m_pWB->put_RegisterAsDropTarget(VARIANT_FALSE);
....
}

ashikaumanga
Offline
Joined: 2008-04-01

Hi guys,

I was able to fix this drag and drop thing.But not in Java.By changing IeEmbed VC++ project.

In BrowserWindow.cpp SetReady method ,add line

m_pWB->put_RegisterAsDropTarget(VARIANT_FALSE);

ie method looks like this:

void BrowserWindow::SetReady(int pInsNum)
{
initialized = true;
m_InstanceID = pInsNum;

m_pWB->put_RegisterAsDropTarget(VARIANT_FALSE);

}

then recompile the project.Now Drag n Drop is disabled in JDIC Explorer Window