Discussion:
npruntime mfc dialog
nona
2015-06-04 08:42:35 UTC
Permalink
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.
Benjamin Smedberg
2015-06-04 13:56:10 UTC
Permalink
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
Post by 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();
--
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
https://lists.mozilla.org/listinfo/dev-tech-plugins
nona
2015-06-05 01:49:58 UTC
Permalink
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.



--
View this message in context: http://mozilla.6506.n7.nabble.com/npruntime-mfc-dialog-tp340474p340496.html
Sent from the Mozilla - Plug-ins mailing list archive at Nabble.com.
Aaron Klotz
2015-06-05 03:04:33 UTC
Permalink
Post by nona
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.
nona
2015-06-05 03:03:53 UTC
Permalink
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.
Georg Fritzsche
2015-06-29 09:01:20 UTC
Permalink
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
Post by 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.
--
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
https://lists.mozilla.org/listinfo/dev-tech-plugins
r***@gmail.com
2015-08-15 13:35:00 UTC
Permalink
Try this

Loading...