Solved

Drop on CWebBrowser2

Posted on 2002-05-07
2
197 Views
Last Modified: 2013-11-20
Hi,
I want to drag a text over a CWebBrowser2 control (ex. http://www.pippo.com) to make the browser navigate.
I used this code:

COleDataSource*     pSource = new COleDataSource();
if(pSource)
{
  CSharedFile sf(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT);
  CString iText;
  iText=m_Link;
  sf.Write(iText, iText.GetLength());
  HGLOBAL hMem = sf.Detach();
  if (!hMem)
    return;
  pSource->CacheGlobalData(CF_TEXT, hMem);
  pSource->DoDragDrop();
  delete pSource;
}

If I drag over my window it works but if I drag over CWebBrowser2 it doesn't (the drag is not catched).
Can you help me?
0
Comment
Question by:css
2 Comments
 
LVL 1

Accepted Solution

by:
Ilia earned 100 total points
ID: 6995818
Hi, It seems to use CF_HDROP clipboard format to redirect webbrowser. See DROPFILES structure description into Shlobj.h

regards, Ilia
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7000436
The WebBrowser control will automatically accept a LINK as a valid drop -- without any programming at all.  This is, by defualt is is registered as a drop target for hyperlinks or even desktop shortcuts that point to a URL.

Is that what you want?

Or do you want to be able to drag any old random text onto the control?

-- Dan
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question