To give VBSCript an Interface you use an hta

Using CreateObject (in Visual Basic for instance) is it possible to
embed a HTA - like you can with a Webbrowser Object - or is HTA not the
way to do this

I want to script on the machine from within an application with a web
browser like rendering (and maintain control of the object)

Re: Embedded HTA by mayayana

mayayana
Sat Jul 19 08:02:35 CDT 2008

By "maintain control" you mean that the code
is not accessible/editable by the people using
your tool? Then why not just use VB? A webpage
can only render a poor facsimile of the GUI options
you can get in compiled software.

If you really need to present a webpage for some
reason, you probably can't entirely hide the source
code. You could maybe do something like save the
webpage as a resource in your EXE, write it to the
TEMP folder at startup, then open it in your WB control
and delete the file in TEMP.

Either way, an HTA is almost identical to a webpage.
It IS a webpage, in an IE browser window (which is the
same as a WB control), but in the case of an HTA the
browser window is wrapped and managed by mshta.exe.
So an HTA is not something you can create. It's just
the functionality of mshta.exe. The main difference between
hta and html is just that an HTA has no security other than
the requirement that it be local. It may be possible to use a
WB in VB and bypass all security by doing whatever mshta.exe
does, but I don't know of any documentation about that.


> To give VBSCript an Interface you use an hta
>
> Using CreateObject (in Visual Basic for instance) is it possible to
> embed a HTA - like you can with a Webbrowser Object - or is HTA not the
> way to do this
>
> I want to script on the machine from within an application with a web
> browser like rendering (and maintain control of the object)



Re: Embedded HTA by mr_unreliable

mr_unreliable
Sat Jul 19 12:03:57 CDT 2008

David Bray wrote:
> I want to script on the machine from within an application with a web
> browser like rendering (and maintain control of the object)

hi David,

Microsoft also offers the "Microsoft Script Control" --
which may be found on the ms scripting website. Er wait,
it is now called the: "Windows Script Control".

The Script Control is intended to be embedded in some
other app (like a vb app), and allow for scripting
INSIDE the app.

It is generally used in situations where the app
provides the basic framework (business or engineering
model), but where the user needs to provide input of
a sort that goes beyond simply entering numbers,
(e.g., entering equations or supplemental logic).

If interested, you can find the script control here:

http://www.microsoft.com/downloads/details.aspx?familyid=D7E31492-2595-49E6-8C02-1426FEC693AC&displaylang=en

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)

Re: Embedded HTA by David

David
Sun Jul 20 02:27:17 CDT 2008

Thanks Mayayana

It's the last minute scripting I want access to, but I need the interface.

This is mainly a custom reporting function - I can/do write
hta where I am on site and need a report
I script a quick report and link it to the menu system of the app
- but the app looses control over it from an interface point of
view - I'd like a bit of modality

security is not an issue - I don't care about the source etc being
visible - Internet explorer doesn't allow access to the file system (of
course) - the HTA's are perfect programatically, but they don't fit
aesthetically

mayayana wrote:
> By "maintain control" you mean that the code
> is not accessible/editable by the people using
> your tool? Then why not just use VB? A webpage
> can only render a poor facsimile of the GUI options
> you can get in compiled software.
>
> If you really need to present a webpage for some
> reason, you probably can't entirely hide the source
> code. You could maybe do something like save the
> webpage as a resource in your EXE, write it to the
> TEMP folder at startup, then open it in your WB control
> and delete the file in TEMP.
>
> Either way, an HTA is almost identical to a webpage.
> It IS a webpage, in an IE browser window (which is the
> same as a WB control), but in the case of an HTA the
> browser window is wrapped and managed by mshta.exe.
> So an HTA is not something you can create. It's just
> the functionality of mshta.exe. The main difference between
> hta and html is just that an HTA has no security other than
> the requirement that it be local. It may be possible to use a
> WB in VB and bypass all security by doing whatever mshta.exe
> does, but I don't know of any documentation about that.
>
>
>> To give VBSCript an Interface you use an hta
>>
>> Using CreateObject (in Visual Basic for instance) is it possible to
>> embed a HTA - like you can with a Webbrowser Object - or is HTA not the
>> way to do this
>>
>> I want to script on the machine from within an application with a web
>> browser like rendering (and maintain control of the object)
>
>

Re: Embedded HTA by mayayana

mayayana
Sun Jul 20 10:24:57 CDT 2008

I'm not sure I really understand what you need, but
it sounds like an ActiveX DLL or EXE might be the
thing. You could script an ActiveX EXE, have events,
etc. But it might be a lot of work to build the GUI
and to write the COM methods you'd need.

> Thanks Mayayana
>
> It's the last minute scripting I want access to, but I need the interface.
>
> This is mainly a custom reporting function - I can/do write
> hta where I am on site and need a report
> I script a quick report and link it to the menu system of the app
> - but the app looses control over it from an interface point of
> view - I'd like a bit of modality
>
> security is not an issue - I don't care about the source etc being
> visible - Internet explorer doesn't allow access to the file system (of
> course) - the HTA's are perfect programatically, but they don't fit
> aesthetically
>
> mayayana wrote:
> > By "maintain control" you mean that the code
> > is not accessible/editable by the people using
> > your tool? Then why not just use VB? A webpage
> > can only render a poor facsimile of the GUI options
> > you can get in compiled software.
> >
> > If you really need to present a webpage for some
> > reason, you probably can't entirely hide the source
> > code. You could maybe do something like save the
> > webpage as a resource in your EXE, write it to the
> > TEMP folder at startup, then open it in your WB control
> > and delete the file in TEMP.
> >
> > Either way, an HTA is almost identical to a webpage.
> > It IS a webpage, in an IE browser window (which is the
> > same as a WB control), but in the case of an HTA the
> > browser window is wrapped and managed by mshta.exe.
> > So an HTA is not something you can create. It's just
> > the functionality of mshta.exe. The main difference between
> > hta and html is just that an HTA has no security other than
> > the requirement that it be local. It may be possible to use a
> > WB in VB and bypass all security by doing whatever mshta.exe
> > does, but I don't know of any documentation about that.
> >
> >
> >> To give VBSCript an Interface you use an hta
> >>
> >> Using CreateObject (in Visual Basic for instance) is it possible to
> >> embed a HTA - like you can with a Webbrowser Object - or is HTA not the
> >> way to do this
> >>
> >> I want to script on the machine from within an application with a web
> >> browser like rendering (and maintain control of the object)
> >
> >