Replying to myself in case it's of interest for someone else. Still haven't found how to refuse drag and drop of files on my embedded browser..
However, the code below isn't without effect as it prevents cut and paste to work in the browser. Philippe -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] lla.org] De la part de Philippe Torrelli Envoyé : mardi 4 novembre 2008 15:36 À : [email protected] Objet : disable d&d ? Hello, Im trying to disable the d&d support from the win32_test, following the instructions from the faq. To do so, in createwindow, after the call to baseWindow->Create, I stuck the following code : rv = baseWindow->Create(); if (NS_FAILED(rv)) { printf("Create\n"); } <here> /* Drag and drop */ nsCOMPtr<nsICommandManager> CommandManager = do_GetInterface(mPrivate->webBrowser); if (CommandManager) { nsCOMPtr<nsIDOMWindow> theDOMWindow = do_GetInterface(mPrivate->webBrowser); nsCOMPtr<nsICommandParams> cmdParamsObj = do_CreateInstance(NS_COMMAND_PARAMS_CONTRACTID,&rv); nsISupports *tmp; tmp = (nsISupports *)mPrivate->chrome; cmdParamsObj->SetISupportsValue("addhook", tmp ); // reinterpret_cast<nsISupports*>(mPrivate->chrome) returns an error CommandManager->DoCommand("cmd_clipboardDragDropHook", cmdParamsObj, theDOMWindow); } I also modified the WebBrowserChrome so that it implements nsIClipboardDragDropHooks and provided a default implementation for every method of nsIClipboardDragDropHooks. In particular changed NS_IMPL_ISUPPORTS5 ( ... ) into NS_IMPL_ISUPPORTS6(WebBrowserChrome, nsIWebBrowserChrome, nsIInterfaceRequestor, nsIEmbeddingSiteWindow, nsIClipboardDragDropHooks, nsIWebProgressListener, nsISupportsWeakReference ) At execution, the interface is never requested, and its methods never called. Any hint appreciated . TIA. Philippe. _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
