<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
  <channel>
    <title>HtmlEditor</title>
    <link>http://www.itwriting.com/phorum/list.php?3</link>
    <description><![CDATA[For discussion of the .Net HTMLEditor control]]></description>
    <language>EN</language>
    <pubDate>Mon, 09 Aug 2010 15:43:21 +0100</pubDate>
    <lastBuildDate>Mon, 09 Aug 2010 15:43:21 +0100</lastBuildDate>
    <category>HtmlEditor</category>
    <generator>Phorum 5.1.25</generator>
    <ttl>60</ttl>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,4404#msg-4404</link>
      <author>Robert</author>
      <description><![CDATA[I had the full implementation but in vb.net.<br />
<br />
Please send me an email to send u]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,4404#msg-4404</guid>
      <pubDate>Mon, 09 Aug 2010 15:43:21 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2986#msg-2986</link>
      <author>Alice.MM</author>
      <description><![CDATA[You can use as:<br />
ed.iEvent.ondrop-=new HTMLTextContainerEvents2_ondropEventHandler(ed.iEvent_ondrop);.....<br />
to remove the eventHandler when drop is completed.<br />
when you do drag-drop than add these event.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2986#msg-2986</guid>
      <pubDate>Tue, 28 Mar 2006 13:08:11 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2985#msg-2985</link>
      <author>Alice.MM</author>
      <description><![CDATA[public HTMLTextContainerEvents2_Event iEvent;<br />
..........................................................<br />
iEvent = (HTMLTextContainerEvents2_Event)(HTMLBody)(((HTMLDocument)(editocx.DOM)).body);<br />
..........................................................<br />
<br />
ed.iEvent.ondrop+=new HTMLTextContainerEvents2_ondropEventHandler(ed.iEvent_ondrop);<br />
						ed.iEvent.ondragover+=new HTMLTextContainerEvents2_ondragoverEventHandler(ed.iEvent_ondragover);<br />
						ed.iEvent.ondragenter+=new HTMLTextContainerEvents2_ondragenterEventHandler(ed.iEvent_ondragenter);<br />
							ed.iEvent.ondragleave+=new HTMLTextContainerEvents2_ondragleaveEventHandler(ed.iEvent_ondragleave);<br />
<br />
...................................................................................<br />
public bool iEvent_ondrop(IHTMLEventObj pEvtObj)<br />
        {<br />
............<br />
}<br />
public bool iEvent_ondragover(IHTMLEventObj pEvtObj)<br />
        {<br />
............<br />
}<br />
public bool iEvent_ondragenter(IHTMLEventObj pEvtObj)<br />
        {<br />
............<br />
}<br />
public bool iEvent_ondragleave(IHTMLEventObj pEvtObj)<br />
        {<br />
............<br />
}]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2985#msg-2985</guid>
      <pubDate>Tue, 28 Mar 2006 00:47:05 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2873#msg-2873</link>
      <author>Ashish Sharma</author>
      <description><![CDATA[Hi, I am getting GetDropTarget() called only the 1st time. For subsequent drag-drops, I don't get GetDropTarget() called.<br />
Can someone suggest why this might be happening.<br />
<br />
thanks,<br />
ashish]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2873#msg-2873</guid>
      <pubDate>Thu, 05 Jan 2006 02:43:15 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2862#msg-2862</link>
      <author>fadi</author>
      <description><![CDATA[hi George Soules <br />
i am using ur code , to do drag and drop on web browser control<br />
but got stucked???<br />
i am draging treenode and droping it on web browser control<br />
can u tel me wat type of changes i should made in ur code to achive <br />
this<br />
waiting 4 ur reply]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2862#msg-2862</guid>
      <pubDate>Thu, 15 Dec 2005 08:22:49 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2834#msg-2834</link>
      <author>George Soules</author>
      <description><![CDATA[Attached is my version of drag and drop support.  It is a simplified version of the code originally posted by Tomcat on 11-30-04 and 12-03-04.  I can't guarantee that it's correct, but it seems to work for my application.<br />
<br />
I am using Tim's original files with some minor modifications.  The changes I made for drag and drop are detailed below.  You need to edit HtmlEditor.cs, comsupport.cs, and HtmlSite.cs.  Most of the code is new (marked &quot;New&quot;), but some existing code was modified (marked &quot;Modified).<br />
<br />
Note that my app subclasses HtmlEditor.  The subclass overrides DropAllowed and OnDrop.  My application-specified logic examines dataObject and takes appropriate action in these methods.  This is similar to Tomcat's DataObjectConverter logic.  I found, however, that the COM code could be much simpler if I let the subclass decide if draging/dropping was acceptable.<br />
<br />
I hope this helps those of you that are looking for a simple example.  I think this is about as simple as it can be and still work.  Thank you to everyone who contributed to this thread and made it possible for me to add drag and drop to my app.<br />
<br />
George<br />
<br />
<br />
---- HtmlEditor.cs -----------------<br />
<br />
// New<br />
public virtual bool DropAllowed(DataObject dataObject, Point screenPoint)<br />
{<br />
   return false;<br />
}<br />
<br />
public virtual void OnDrop(DataObject dataObject, Point screenPoint)<br />
{<br />
}<br />
<br />
<br />
---- comsupport.cs --------------<br />
<br />
// Modified<br />
int GetDropTarget([In, MarshalAs(UnmanagedType.Interface)] IOleDropTarget pDropTarget,<br />
   [Out, MarshalAs(UnmanagedType.Interface)] out IOleDropTarget ppDropTarget);<br />
<br />
// New<br />
[System.Runtime.InteropServices.ComImport()]<br />
[System.Runtime.InteropServices.InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]<br />
[System.Runtime.InteropServices.GuidAttribute(&quot;00000122-0000-0000-C000-000000000046&quot;)]<br />
[System.Runtime.InteropServices.ComVisibleAttribute(true)]<br />
public interface IOleDropTarget<br />
{<br />
   [System.Runtime.InteropServices.PreserveSig()] int OleDragEnter (IntPtr pDataObj, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U4)] int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Struct)] tagPOINT pt, ref int pdwEffect);<br />
   [System.Runtime.InteropServices.PreserveSig()] int OleDragOver (int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Struct)] tagPOINT pt, ref int pdwEffect);<br />
   [System.Runtime.InteropServices.PreserveSig()] int OleDragLeave ();<br />
   [System.Runtime.InteropServices.PreserveSig()] int OleDrop (IntPtr pDataObj, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U4)] int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Struct)] tagPOINT pt, ref int pdwEffect);<br />
}<br />
<br />
<br />
---- HtmlSite.cs ---------------<br />
<br />
// Modified<br />
public int GetDropTarget(IOleDropTarget pDropTarget, out IOleDropTarget ppDropTarget)<br />
{<br />
   ppDropTarget = new DropTarget((HtmlEditor)container, pDropTarget);<br />
   return HRESULT.S_OK; <br />
}<br />
<br />
// New<br />
private sealed class DropTarget : IOleDropTarget<br />
{<br />
const int DROPEFFECT_NONE = 0;<br />
const int DROPEFFECT_COPY = 1;<br />
const string guidForIDataObject = &quot;0000010E-0000-0000-C000-000000000046&quot;;<br />
<br />
private DataObject dataObject;<br />
private IntPtr dataObjectPtr;<br />
private HtmlEditor htmlEditor;<br />
<br />
public DropTarget (HtmlEditor htmlEditor, IOleDropTarget originalDropTarget)<br />
{<br />
   this.htmlEditor = htmlEditor;<br />
}<br />
<br />
public int OleDragEnter(IntPtr pDataObj, int grfKeyState, tagPOINT pt, ref int pdwEffect)<br />
{<br />
   dataObject = new DataObject(Marshal.GetObjectForIUnknown(pDataObj));<br />
   IntPtr intPtr = Marshal.GetIUnknownForObject(dataObject);<br />
   Guid guid = new Guid(guidForIDataObject);<br />
   Marshal.QueryInterface (intPtr, ref guid, out dataObjectPtr);<br />
   Marshal.Release(intPtr);<br />
   pdwEffect = DROPEFFECT_NONE;<br />
   return HRESULT.S_OK;<br />
}<br />
<br />
public int OleDragOver(int grfKeyState, tagPOINT pt, ref int pdwEffect)<br />
{<br />
   bool dropAllowed = htmlEditor.DropAllowed(dataObject, new Point(pt.x, pt.y));<br />
   pdwEffect = dropAllowed ? DROPEFFECT_COPY : DROPEFFECT_NONE;<br />
   return HRESULT.S_OK;<br />
}<br />
<br />
public int OleDrop(IntPtr pDataObj, int grfKeyState, tagPOINT pt, ref int pdwEffect)<br />
{<br />
   DataObject draggedDataObject = new DataObject(Marshal.GetObjectForIUnknown(pDataObj));<br />
   htmlEditor.OnDrop(draggedDataObject, new Point(pt.x, pt.y));<br />
<br />
   IntPtr pUnk = Marshal.GetIUnknownForObject(dataObject);<br />
   Guid guid = new Guid(guidForIDataObject);<br />
   Marshal.QueryInterface(pUnk, ref guid, out dataObjectPtr);<br />
   Marshal.Release(dataObjectPtr);<br />
<br />
   dataObject = null;<br />
   dataObjectPtr = IntPtr.Zero;<br />
<br />
   return HRESULT.S_OK;<br />
}<br />
<br />
public int OleDragLeave()<br />
{<br />
   if (dataObject != null)<br />
   {<br />
      dataObject = null;<br />
      Marshal.Release(dataObjectPtr);<br />
      dataObjectPtr = IntPtr.Zero;<br />
   }<br />
   return HRESULT.S_OK;<br />
}]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2834#msg-2834</guid>
      <pubDate>Sun, 30 Oct 2005 15:15:47 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2801#msg-2801</link>
      <author>moon</author>
      <description><![CDATA[how  i  can ussed   darg&amp;drop]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2801#msg-2801</guid>
      <pubDate>Wed, 12 Oct 2005 16:47:56 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2775#msg-2775</link>
      <author>Alice.MM</author>
      <description><![CDATA[If I add WebBrowser control in VB6.0 ,then I could drag items to it and drop,I think Com control to Com control is works ok ,but when add WebBrowser control in .net programe,it doesn't work.<br />
You are right &quot;WebBrowser control does not show HTML&quot;,but WebBrowser control has a DOM property,and use mshtml.HTMLDocument Interface ,I can control it's html,what I want to do is draging item into WebBrowser control,and when droped I add some html string into some where by mshtml.HTMLDocument interface.<br />
If some one want simple code,I can send it to your Email adress,my email is cecilia_in_love@163.com .I really want help!<br />
Also sorry for my poor English ,I'm not a English speaking country.:)]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2775#msg-2775</guid>
      <pubDate>Wed, 07 Sep 2005 01:49:56 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2768#msg-2768</link>
      <author>Alice.mm</author>
      <description><![CDATA[hi,<br />
C an Any one post a simple solution to me?<br />
thanks,my email is<br />
cecilia_in_love@163.com ;<br />
I'm a new c# learner,Thanks every one!! :)]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2768#msg-2768</guid>
      <pubDate>Thu, 01 Sep 2005 11:58:46 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,2767#msg-2767</link>
      <author>Alice.mm</author>
      <description><![CDATA[hi,<br />
   Any one can post a simple solution to me ,thanks,my email is<br />
 cecilia_in_love@163.com  ;I'm a c# learner,Thanks every one!!]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,2767#msg-2767</guid>
      <pubDate>Thu, 01 Sep 2005 11:46:45 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1886#msg-1886</link>
      <author>shashi  jha</author>
      <description><![CDATA[hi,<br />
     <br />
     i have used ur code for drag drop.all events are fired properly,<br />
     but item is not dropped.witch type items , we can drop.<br />
     <br />
<br />
public virtual DragLoadInfo CanConvertToHtml (DataObject dataObject)<br />
{<br />
<br />
//Check that the draged data is of desired format and return DragLoadInfo.CanConvert<br />
foreach (string format in dataObject.GetFormats())<br />
{<br />
if(format == typeof(//DesiredType Like ToolboxItem).ToString())<br />
{ <br />
return DragLoadInfo.CanConvert; <br />
}<br />
}<br />
return DragLoadInfo.Unhandled; <br />
}<br />
<br />
i could not understand above method.what should i have to fill up in <br />
comment section.<br />
<br />
typeof(//DesiredType Like ToolboxItem).ToString())<br />
<br />
<br />
suppose i am going to drop listview item , what should i do.<br />
what is the use of <br />
<br />
CanConvertToHtml <br />
ConvertToHtml<br />
methods.<br />
<br />
<br />
<br />
<br />
waiting for ur reply<br />
<br />
shashi]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1886#msg-1886</guid>
      <pubDate>Tue, 01 Mar 2005 15:05:07 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1837#msg-1837</link>
      <author>James Hancock</author>
      <description><![CDATA[Thanks! Next UberBuild will have full .NET drag/drop implimented :)]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1837#msg-1837</guid>
      <pubDate>Fri, 28 Jan 2005 15:03:59 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1820#msg-1820</link>
      <author>Tomcat</author>
      <description><![CDATA[public int OleDrop (IntPtr pDataObj, int grfKeyState, mshtml.tagPOINT pt, ref int pdwEffect)<br />
{<br />
 System.Windows.Forms.DataObject theDataObject;<br />
 theObject = Marshal.GetObjectForIUnknown (pDataObj);<br />
 theDataObject = new DataObject (theObject);<br />
}]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1820#msg-1820</guid>
      <pubDate>Tue, 18 Jan 2005 05:21:42 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1810#msg-1810</link>
      <author>James Hancock</author>
      <description><![CDATA[Anyone have any code to convert the IDataObject that is implimented above to the .net version?<br />
<br />
If someone can post some code to do that, then we're set and Drag and Drop becomes purely a .net endevour.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1810#msg-1810</guid>
      <pubDate>Fri, 14 Jan 2005 16:27:50 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1807#msg-1807</link>
      <author>nabil</author>
      <description><![CDATA[hi , <br />
I have read all these notes,  actually I am facing the same problem , I want to restrict the drag drop in my MSHTML WebBrowser , if I some starts to drag an Element in the Editor and drops in the Editor it should not work , so wat I want is an editor which doesnot support Drag and Drop of elements . I have implemented IHTMLEditHost Interface it is working with the Absouute images why it is not working for other type of Images]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1807#msg-1807</guid>
      <pubDate>Fri, 14 Jan 2005 11:00:20 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1729#msg-1729</link>
      <author>James Hancock</author>
      <description><![CDATA[(Yes I know that some of the above is about that, but it's just not clear at all, and it appears that it hasn't actually been implimented yet)<br />
<br />
I just need to figure out how to use the .GetData function on the pDataObj and I'm set.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1729#msg-1729</guid>
      <pubDate>Fri, 10 Dec 2004 20:54:05 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1728#msg-1728</link>
      <author>James Hancock</author>
      <description><![CDATA[Ok, road block.<br />
<br />
Unfortunately, I figured I could just use the IDataObject defined in System.windows.forms, but unfortunately I can't, so I'm having trouble rasing the Drag/drop events in .net<br />
<br />
Anyone have an idea how to create a new System.Windows.Forms.IDataObject and convert the standard implimentation to it?<br />
<br />
Once that's done, then all of the drag/drop stuff will work in .net.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1728#msg-1728</guid>
      <pubDate>Fri, 10 Dec 2004 20:40:36 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1727#msg-1727</link>
      <author>James Hancock</author>
      <description><![CDATA[FYI for everyone.  I'm almost done implimenting in my version, full drag and drop that exposes everything as .net objects and fires the .net events.<br />
<br />
I'll post a new version when it's done.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1727#msg-1727</guid>
      <pubDate>Fri, 10 Dec 2004 20:09:50 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1711#msg-1711</link>
      <author>Tomcat</author>
      <description><![CDATA[hi !<br />
1. remove all code and references to the BaseEditor _owner variable from the implementation or Replace the  private BaseEditor _owner  with  private HtmlEditor _owner both in constructor and in the declaration section.<br />
<br />
2. this._dropTarget is a variable of IOleDropTarget type , define it in MshtmlSite implementation if not already defined. <br />
<br />
3. this._parent is the control on which MshtmlSite is hosted (HtmlEditor) <br />
the the code as for HtmlEditor <br />
<br />
public int GetDropTarget( ComInterop.IOleDropTarget pDropTarget,out ComInterop.IOleDropTarget ppDropTarget)<br />
{<br />
HtmlEditor theHtmlEditor;<br />
DragLoadConverter theDataObjectConverter;<br />
if (this._dropTarget == null)<br />
{<br />
theHtmlEditor = (this.container as HtmlEditor);<br />
if (theHtmlEditor != null)<br />
{<br />
theDataObjectConverter = theHtmlEditor.DataObjectConverter;<br />
if (theDataObjectConverter != null)<br />
{<br />
this._dropTarget = new DropTarget(theHtmlEditor,theDataObjectConverter, pDropTarget);<br />
}<br />
}<br />
}<br />
<br />
p.s. <br />
sorry for my poor english]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1711#msg-1711</guid>
      <pubDate>Fri, 03 Dec 2004 10:46:17 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1706#msg-1706</link>
      <author>kanvishok</author>
      <description><![CDATA[How can i trigger these events. <br />
<br />
i just return the interface in my comsuport.cs like the following.<br />
<br />
<br />
[System.Runtime.InteropServices.ComImport()]<br />
	[System.Runtime.InteropServices.InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]<br />
	[System.Runtime.InteropServices.GuidAttribute(&quot;00000122-0000-0000-C000-000000000046&quot;)]<br />
	[System.Runtime.InteropServices.ComVisibleAttribute(true)]<br />
	public interface IOleDropTarget<br />
	{<br />
		#region Methods<br />
		[System.Runtime.InteropServices.PreserveSig()] int OleDragEnter (IntPtr pDataObj, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U4)] int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U8)] long pt, ref int pdwEffect);<br />
		[System.Runtime.InteropServices.PreserveSig()] int OleDragOver (int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Struct)] mshtml.tagPOINT pt, ref int pdwEffect);<br />
		[System.Runtime.InteropServices.PreserveSig()] int OleDragLeave ();<br />
		[System.Runtime.InteropServices.PreserveSig()] int OleDrop (IntPtr pDataObj, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U4)] int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Struct)] mshtml.tagPOINT pt, ref int pdwEffect);<br />
		#endregion<br />
	}<br />
<br />
<br />
after that i implement these methods in my htmlsite.cs. but <br />
OleDragEnter ,oleDrageOver, OleDrop none of the events were triggered.<br />
<br />
how can i trigger these events<br />
<br />
thanks<br />
<br />
kannan.c]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1706#msg-1706</guid>
      <pubDate>Wed, 01 Dec 2004 11:03:04 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1704#msg-1704</link>
      <author>kannan chandrasekaran</author>
      <description><![CDATA[also <br />
<br />
this._parent in getdropTarget method]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1704#msg-1704</guid>
      <pubDate>Wed, 01 Dec 2004 08:16:06 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1703#msg-1703</link>
      <author>kannan chandrasekaran</author>
      <description><![CDATA[hi Tom<br />
<br />
Fine thanks for ur reply.<br />
<br />
but still i am not able to implement. because <br />
the following declarations are not available for me<br />
<br />
1) private BaseEditor _owner;<br />
<br />
2) this._dropTarget in getdroptarget method.<br />
<br />
expecting ur help<br />
<br />
thanks<br />
<br />
kannan.c]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1703#msg-1703</guid>
      <pubDate>Wed, 01 Dec 2004 07:32:43 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1696#msg-1696</link>
      <author>Tomcat</author>
      <description><![CDATA[my this will help you , this my implementation of IDropTarget<br />
#region &quot;IDropTarget Definition&quot;<br />
<br />
[System.Runtime.InteropServices.ComImport()]<br />
		[System.Runtime.InteropServices.InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]<br />
		[System.Runtime.InteropServices.GuidAttribute(&quot;00000122-0000-0000-C000-000000000046&quot;)]<br />
		[System.Runtime.InteropServices.ComVisibleAttribute(true)]<br />
		public interface IOleDropTarget<br />
			<br />
		{<br />
			#region Methods<br />
			[System.Runtime.InteropServices.PreserveSig()] int OleDragEnter (IntPtr pDataObj, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U4)] int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U8)] long pt, ref int pdwEffect);<br />
			[System.Runtime.InteropServices.PreserveSig()] int OleDragOver (int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Struct)] mshtml.tagPOINT pt, ref int pdwEffect);<br />
			[System.Runtime.InteropServices.PreserveSig()] int OleDragLeave ();<br />
			[System.Runtime.InteropServices.PreserveSig()] int OleDrop (IntPtr pDataObj, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.U4)] int grfKeyState, [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Struct)] mshtml.tagPOINT  pt, ref int pdwEffect);<br />
			#endregion<br />
		}<br />
<br />
<br />
<br />
#region IDocHostUIHandler Implementation <br />
<br />
public int GetDropTarget( ComInterop.IOleDropTarget pDropTarget,out ComInterop.IOleDropTarget ppDropTarget)<br />
		{<br />
			HtmlEditor theHtmlEditor;<br />
			DragLoadConverter  theDataObjectConverter;<br />
			if (this._dropTarget == null)<br />
			{<br />
				theHtmlEditor = (this._parent  as HtmlEditor);<br />
				if (theHtmlEditor != null)<br />
				{<br />
					theDataObjectConverter = theHtmlEditor.DataObjectConverter;<br />
					if (theDataObjectConverter != null)<br />
					{<br />
						this._dropTarget = new DropTarget(theHtmlEditor,theDataObjectConverter, pDropTarget);<br />
					}<br />
				}<br />
			}<br />
			<br />
			ppDropTarget = ((ComInterop.IOleDropTarget) this._dropTarget);<br />
			if (this._dropTarget == null)<br />
			{<br />
				return ComInterop.HRESULT.S_FALSE;<br />
			}<br />
			<br />
			return ComInterop.HRESULT.S_OK;   <br />
		}<br />
<br />
<br />
#region &quot;IDropTarget Implementation&quot;<br />
private sealed class DropTarget : BPMDesigner.Interop.ComInterop.IOleDropTarget<br />
			<br />
		{<br />
			#region Fields<br />
			private DragLoadConverter _converter;<br />
			private DragLoadInfo _converterInfo;<br />
			private DataObject _currentDataObj;<br />
			private IntPtr _currentDataObjPtr;<br />
			private ComInterop.IOleDropTarget _originalDropTarget;<br />
			private BaseEditor _owner;<br />
			<br />
			#endregion<br />
				<br />
			#region Constructors<br />
				<br />
			public DropTarget (BaseEditor owner, DragLoadConverter converter, ComInterop.IOleDropTarget originalDropTarget)<br />
					<br />
			{<br />
				this._owner = owner;<br />
				this._converter = converter;<br />
				this._originalDropTarget = originalDropTarget;<br />
			}<br />
					<br />
			#endregion<br />
				<br />
			#region Methods<br />
				<br />
			public int OleDragEnter (IntPtr pDataObj, int grfKeyState, long pt, ref int pdwEffect)<br />
			{<br />
				object theObject;<br />
				DataObject theDataObject;<br />
				IntPtr theIntPtr;<br />
				Guid theGuid;<br />
				theObject = Marshal.GetObjectForIUnknown (pDataObj);<br />
				theDataObject = new DataObject (theObject);<br />
				this._converterInfo = this._converter.CanConvertToHtml (theDataObject);<br />
				   <br />
				if (this._converterInfo == DragLoadInfo.CanConvert)<br />
				{<br />
					this._currentDataObj = new DataObject (DataFormats.Html, string.Empty);<br />
					theIntPtr = Marshal.GetIUnknownForObject (this._currentDataObj);<br />
					theGuid = new Guid (&quot;0000010E-0000-0000-C000-000000000046&quot;);<br />
					Marshal.QueryInterface (theIntPtr, ref theGuid, out this._currentDataObjPtr);<br />
					Marshal.Release (theIntPtr);<br />
					  <br />
					return this._originalDropTarget.OleDragEnter (this._currentDataObjPtr, grfKeyState, pt, ref pdwEffect);<br />
				}<br />
				if (this._converterInfo == DragLoadInfo.Disabled)<br />
				{<br />
					pdwEffect = 0;<br />
					return 0;<br />
				}<br />
				if (this._converterInfo != DragLoadInfo.Unhandled)<br />
				{<br />
					return 0;<br />
				}<br />
				<br />
				return this._originalDropTarget.OleDragEnter (pDataObj, grfKeyState, pt, ref pdwEffect);<br />
			}<br />
					<br />
					<br />
			public int OleDragLeave ()<br />
					<br />
			{<br />
				this._converterInfo = DragLoadInfo.Disabled;<br />
				if (this._currentDataObj == null)<br />
				{<br />
					return 0;<br />
				}<br />
				<br />
				this._currentDataObj = ((DataObject) null);<br />
				Marshal.Release (this._currentDataObjPtr);<br />
				this._currentDataObjPtr = IntPtr.Zero;<br />
				return this._originalDropTarget.OleDragLeave ();<br />
				<br />
			}<br />
					<br />
			public int OleDragOver (int grfKeyState, mshtml.tagPOINT  pt, ref int pdwEffect)<br />
			{<br />
				if (this._converterInfo != DragLoadInfo.Disabled)<br />
					return this._originalDropTarget.OleDragOver(grfKeyState, pt,ref pdwEffect);<br />
				<br />
				return 0;<br />
			}<br />
					<br />
			public int OleDrop (IntPtr pDataObj, int grfKeyState, mshtml.tagPOINT  pt, ref int pdwEffect)<br />
			{<br />
				int hr;<br />
				Control host;<br />
				Form parent;<br />
				object theObject;<br />
				DataObject theDataObject;<br />
				bool flag;<br />
				IntPtr pUnk;<br />
				Guid sid;<br />
 <br />
				theObject = Marshal.GetObjectForIUnknown(pDataObj);<br />
				theDataObject = new DataObject(theObject);<br />
				hr = 0;<br />
				host = this._owner;<br />
				while (host != null) <br />
				{<br />
					try<br />
					{<br />
						parent =(Form) host.Parent;<br />
				<br />
						if (parent == null)<br />
							continue;<br />
						parent.BringToFront();<br />
						break;<br />
					}<br />
					catch(Exception)<br />
					{<br />
						break;<br />
					}<br />
					<br />
				}<br />
				if (this._converterInfo == DragLoadInfo.CanConvert ) <br />
				{<br />
					theObject = Marshal.GetObjectForIUnknown(pDataObj);<br />
					theDataObject = new DataObject(theObject);<br />
					<br />
					flag = this._converter.ConvertToHtml(theDataObject, this._currentDataObj ,point);<br />
					<br />
					if (flag) <br />
					{<br />
						pUnk = Marshal.GetIUnknownForObject(this._currentDataObj);<br />
						sid = new Guid(&quot;0000010E-0000-0000-C000-000000000046&quot;);<br />
						Marshal.QueryInterface(pUnk, ref sid, out this._currentDataObjPtr);<br />
						<br />
						hr = this._originalDropTarget.OleDrop( this._currentDataObjPtr, grfKeyState, pt, ref pdwEffect);<br />
						<br />
						Marshal.Release(this._currentDataObjPtr);<br />
						this._currentDataObj = null;<br />
						this._currentDataObjPtr = IntPtr.Zero;<br />
					}<br />
				}<br />
				else if (this._converterInfo == DragLoadInfo.Unhandled)<br />
					hr = this._originalDropTarget.OleDrop(pDataObj, grfKeyState, pt,ref  pdwEffect);<br />
					<br />
				return hr;<br />
			}<br />
					<br />
			#endregion<br />
		}<br />
			<br />
		#endregion<br />
<br />
<br />
public class DragLoadConverter<br />
	<br />
	{<br />
<br />
<br />
		#region Constructors<br />
		<br />
			public DragLoadConverter ()<br />
			{<br />
			<br />
			}<br />
			<br />
		#endregion<br />
		<br />
		#region Methods<br />
		<br />
			public virtual DragLoadInfo CanConvertToHtml (DataObject dataObject)<br />
			{<br />
<br />
				//Check that the draged data is of desired format and return DragLoadInfo.CanConvert<br />
				foreach (string format in dataObject.GetFormats())<br />
				{<br />
					if(format == typeof(//DesiredType Like ToolboxItem).ToString())<br />
					{ <br />
						return DragLoadInfo.CanConvert; <br />
					}<br />
				}<br />
				return DragLoadInfo.Unhandled;  	<br />
			}<br />
			<br />
			<br />
			public virtual bool ConvertToHtml (DataObject originalDataObject, DataObject newDataObject,System.Drawing.Point  pt)<br />
			{<br />
			<br />
				<br />
				<br />
				foreach (string format in originalDataObject.GetFormats())<br />
				{<br />
					if(format == typeof(//DesiredType Like ToolboxItem).ToString())<br />
					{ <br />
						found = true;	<br />
						break;<br />
					}<br />
				}<br />
					<br />
				if(!found) return false;<br />
					<br />
				<br />
				//convert the droped type into its Html representation and set the data	<br />
				newDataObject.SetData(DataFormats.Html ,&quot;&lt;B&gt; Something is Dropped&quot;); <br />
				return true;<br />
			}<br />
			<br />
		#endregion<br />
	}<br />
<br />
<br />
<br />
[System.Serializable()]<br />
public enum DragLoadInfo<br />
	<br />
{<br />
	Disabled = 0,<br />
	CanConvert = 1,<br />
	Unhandled = 2,<br />
}<br />
<br />
<br />
add this public property to HtmlEditor Control<br />
<br />
public DragLoadConverter DataObjectConverter<br />
		{<br />
			get<br />
			{<br />
				return this._dataObjectConverter;<br />
			}<br />
			set<br />
			{<br />
				this._dataObjectConverter = value;<br />
			}<br />
		}<br />
<br />
<br />
private DragLoadConverter _dataObjectConverter;<br />
<br />
and in the appropriate constructor create an instance of DragLoadConverter<br />
this._dataObjectConverter = new DragLoadConverter();]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1696#msg-1696</guid>
      <pubDate>Tue, 30 Nov 2004 11:12:53 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1693#msg-1693</link>
      <author>kannan chandrasekaran</author>
      <description><![CDATA[Hi <br />
<br />
is there any way to restrict the drag and drop inside the mshtml?<br />
<br />
thanks<br />
kannan.c]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1693#msg-1693</guid>
      <pubDate>Mon, 29 Nov 2004 09:32:08 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1692#msg-1692</link>
      <author>kannan chandrasekaran</author>
      <description><![CDATA[Hi Tim.<br />
<br />
i just fixed that one and it is working fine for me. also the drag and drop is restricted from out side. but if i drag it from instide it get strucked. the selected text is still selected even i deselect that. Even i typed some thing then looks like selected.<br />
<br />
do u have any idea regarding this? <br />
<br />
thanks<br />
kannan.c]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1692#msg-1692</guid>
      <pubDate>Mon, 29 Nov 2004 07:57:09 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1691#msg-1691</link>
      <author>Tim</author>
      <description><![CDATA[The accessibility issue is because in the code Rob posted the interfaces are not declared public, whereas others you are using it with are. Add public to all the interfaces and it will work.<br />
<br />
Tim]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1691#msg-1691</guid>
      <pubDate>Mon, 29 Nov 2004 07:33:04 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,1690#msg-1690</link>
      <author>kannan chandrasekaran</author>
      <description><![CDATA[hi Rob Cowell <br />
<br />
i just used ur &quot;IEnumFORMATETC&quot; interface but it is giving some bug like the following<br />
<br />
&quot;Inconsistent accessibility: return type 'onlyconnect.IEnumFORMATETC' is less accessible than method 'onlyconnect.IDataObject.EnumFormatEtc(onlyconnect.DATADIR)' &quot;. <br />
<br />
can u give me some idea.<br />
<br />
thanks <br />
kannan.chandrasekaran]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,1690#msg-1690</guid>
      <pubDate>Mon, 29 Nov 2004 06:47:30 +0000</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,502#msg-502</link>
      <author>Rob Cowell</author>
      <description><![CDATA[Ok, I found the answer - seems like I do need IDropSource...<br />
<br />
Anyone else working on the drag and drop problem here?  Might be useful to compare notes...<br />
<br />
Rob.<br />
<br />
]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,502#msg-502</guid>
      <pubDate>Thu, 10 Apr 2003 09:52:04 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,485#msg-485</link>
      <author>Rob Cowell</author>
      <description><![CDATA[Another question for anyone thats feeling benevolent this morning :-)<br />
<br />
In order to implement dragdrop on the HTML Control, does my item that I wish to drag need to implement IDropSource as well as IDataObject ?<br />
<br />
Rob<br />
<br />
]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,485#msg-485</guid>
      <pubDate>Mon, 07 Apr 2003 11:31:08 +0100</pubDate>
    </item>
    <item>
      <title>Re: how to manipulate the darg and drop of the webbrowser editor!!</title>
      <link>http://www.itwriting.com/phorum/read.php?3,425,478#msg-478</link>
      <author>Rob Cowell</author>
      <description><![CDATA[Test post, ignore me :)<br />
<br />
]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,425,478#msg-478</guid>
      <pubDate>Fri, 04 Apr 2003 13:03:41 +0100</pubDate>
    </item>
  </channel>
</rss>
