Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Drop on CWebBrowser2

Posted on 2002-05-07
2
Medium Priority
?
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

618 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