Solved

Drop on CWebBrowser2

Posted on 2002-05-07
2
190 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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now