?
Solved

Drop on CWebBrowser2

Posted on 2002-05-07
2
Medium Priority
?
206 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 300 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Screencast - Getting to Know the Pipeline
Suggested Courses

850 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