npruntime mfc dialog

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

npruntime mfc dialog

nona
Hello,

I have try to insert a mfc dialog box in the npruntime sample. But unable to do so.

Anybody know how to insert a dialog box inside the npruntime sample?
My objective is simple. Click on the html button, called a javascript function and then pops the dialog box.

The code below does not give a modal dialog. It works on MessageBox but it does not work on domodal dialog. Any idea?

bool
ScriptablePluginObject::Invoke(NPIdentifier name, const NPVariant *args,
                               uint32_t argCount, NPVariant *result)
 if (name == sFoo_id) {
    printf ("foo called!\n");

        MessageBox(NULL, L"Log 1 ", L"Log", MB_OK);
        CDialog a;
       a.domodal();




Reply | Threaded
Open this post in threaded view
|

Re: npruntime mfc dialog

Benjamin Smedberg
Plugins should not ever present modal dialogs. A modal dialog will block
the browser from receiving events and will cause it to stop painting,
and the browser will likely detect that the plugin has hung and kill it
after 45-60 seconds.

--BDS

On 6/4/2015 4:42 AM, nona wrote:

> Hello,
>
> I have try to insert a mfc dialog box in the npruntime sample. But unable to
> do so.
>
> Anybody know how to insert a dialog box inside the npruntime sample?
> My objective is simple. Click on the html button, called a javascript
> function and then pops the dialog box.
>
> The code below does not give a modal dialog. It works on MessageBox but it
> does not work on domodal dialog. Any idea?
>
> bool
> ScriptablePluginObject::Invoke(NPIdentifier name, const NPVariant *args,
>                                 uint32_t argCount, NPVariant *result)
>   if (name == sFoo_id) {
>      printf ("foo called!\n");
>
> MessageBox(NULL, L"Log 1 ", L"Log", MB_OK);
>          CDialog a;
>         a.domodal();
>
>
>
>
>
>
>
>
> --
> View this message in context: http://mozilla.6506.n7.nabble.com/npruntime-mfc-dialog-tp340474.html
> Sent from the Mozilla - Plug-ins mailing list archive at Nabble.com.
> _______________________________________________
> dev-tech-plugins mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-plugins

_______________________________________________
dev-tech-plugins mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-plugins
Reply | Threaded
Open this post in threaded view
|

Re: npruntime mfc dialog

nona
Excerpt from https://developer.mozilla.org/en/docs/NPN_GetValue,

"The method returns a value of type HWND. In many cases, a plug-in may still have to create its own window (a transparent child window of the browser window) to act as the owner window for popup menus and modal dialogs. This transparent child window can have its own WindowProc within which the plug-in can deal with WM_COMMAND messages sent to it a result of tracking the popup menu or modal dialog."

I think it is possible. But don't know where to insert the code to interact with the plugin.
Reply | Threaded
Open this post in threaded view
|

Re: npruntime mfc dialog

Aaron Klotz
On 6/4/2015 7:49 PM, nona wrote:
>
> I think it is possible. But don't know where to insert the code to interact
> with the plugin.
>
>
The problem is not that it isn't possible; the problem is that modal
dialogs in plugins are a known cause of performance problems in the
browser.
_______________________________________________
dev-tech-plugins mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-plugins
Reply | Threaded
Open this post in threaded view
|

Re: npruntime mfc dialog

nona
So does it means scriptable plugin can never have a dialog box?
Or do i have some other alternative to integrate a dialog interface to scriptable plugin.
I just want to have a dialog to list all the user certificate like Mozilla certificate manager.
Reply | Threaded
Open this post in threaded view
|

Re: npruntime mfc dialog

Georg Fritzsche-3
If you are using a plugin, it will be instantiated by some page.
The best solution usually is to make that page display the information.

You could e.g. expose a scriptable function to JavaScript that returns the
information to the page or send it to the page asynchronously.

Georg

On Thu, Jun 4, 2015 at 8:03 PM, nona <[hidden email]> wrote:

> So does it means scriptable plugin can never have a dialog box?
> Or do i have some other alternative to integrate a dialog interface to
> scriptable plugin.
> I just want to have a dialog to list all the user certificate like Mozilla
> certificate manager.
>
>
>
>
> --
> View this message in context:
> http://mozilla.6506.n7.nabble.com/npruntime-mfc-dialog-tp340474p340499.html
> Sent from the Mozilla - Plug-ins mailing list archive at Nabble.com.
> _______________________________________________
> dev-tech-plugins mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-plugins
>
_______________________________________________
dev-tech-plugins mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-plugins
Reply | Threaded
Open this post in threaded view
|

Re: npruntime mfc dialog

rockstarkimk
In reply to this post by nona
Try this
_______________________________________________
dev-tech-plugins mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-plugins