Scripting should NOT be optional in anyway - it defeats the whole point of doing scripting and moving many functions of Plus! into script. Either have script or don't, but just as a program wide decision.
To create a script in VBScript or JScript that uses a GUI you would need create your own GUI COM object that supplies all the methods you want - calling the Windows API doesn't work too well, and creating a message loop would make most people give up and shoot themselves.
One solution I have used before is to supply a COM object with the necessary functionality to create a window object that is actually an instance of IE's HTML object. This way you can use CSS, DHTML and HTML as the GUI, which is pretty much all powerful, and users can apply their own styles, which always looks nice.
//Sample of how to display a dialog
var NewWindow = Patchou.CreateWindow(100, 200); //100px by 200px
NewWindow.Write("<html><body>MSN Plus! Dialog box</body></html>");
The other way is to completely encapsultate all the window functionality you need in a COM object, or find one that has this already done this (I know the Forms 2 library with Office has already done this, but I think you can only access it from Office).
Maybe the middle ground is too have a C++/C binding for MP, and have it look for all dll files in some directory on startup or when you press "find new plugins". From this you could then write a script plugin, just as a C++ plugin, and leave the GUI decisions for later.
Then again you could give up on scripting as just too hard - depends how much you like playing with COM really.
|