mozilla

Compare Revisions

Embedding Tips

Change Revisions

Revision 142605:

Revision 142605 by Dria on

Revision 142606:

Revision 142606 by Olaf on

Title:
How do I...
How do I...
Slug:
Mozilla_Embedding_FAQ/How_do_I...
Mozilla_Embedding_FAQ/How_do_I...
Tags:
Mozilla_Embedding_FAQ, "Embedding Mozilla"
Mozilla_Embedding_FAQ, "Embedding Mozilla"
Content:

Revision 142605
Revision 142606
tt253    <h3 name="How_do_I_disable_drag.2Fdrop_support.3F">
254      How do I disable drag/drop support?
255    </h3>
256    <p>
257      When setting up your browser add a hook to the command mana
 >ger which points to your {{template.Interface("nsIWebBrowserChrom
 >e")}} implementation. This implementation should also implement {
 >{template.Interface("nsIClipboardDragDropHooks")}}. Deny the drop
 > by setting the return value of the AllowDrop() function.
258    </p>
259    <pre>
260nsCOMPtr&lt;nsICommandManager&gt; CommandManager = do_GetInterfac
 >e(iWebBrowser);
261if (CommandManager)
262{
263  nsCOMPtr&lt;nsIDOMWindow&gt; theDOMWindow = do_GetInterface(iWe
 >bBrowser); 
264  nsCOMPtr&lt;nsICommandParams&gt; cmdParamsObj = do_CreateInstan
 >ce(NS_COMMAND_PARAMS_CONTRACTID,&amp;rv);
265  cmdParamsObj-&gt;SetISupportsValue("addhook", reinterpret_cast&
 >lt;nsISupports*&gt;(iChromeImplementation));
266  CommandManager-&gt;DoCommand("cmd_clipboardDragDropHook", cmdPa
 >ramsObj, theDOMWindow);
267}
268</pre>

Back to History