Solved

Drop on CWebBrowser2

Posted on 2002-05-07
2
195 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 91
Looking for a specific application/software 2 110
FizzBuzz challenge 9 81
Increment column based of a FK 8 23
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…
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 …
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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