Wei Wang wrote:
JeffP wrote:
I want to add a short-cut to a windows app similar to launching from a windows
run line
a New window, to prevent changing an existing browser window from moving off a
current logged in session to another web application.
And, I'd like it to be a chromeless window, sans toobars and sized similar to a
popup.
I am just guessing here.
Something like the following?
window.open("product.xul", "Product",
"chrome,dialog,modal,close=no,titlebar=no,resizabl e=no");
That's something I have been trying out with Firefox and XUL. Have no
idea about Windows or IE.
Regards,
On IE, if you rename any .html file to .hta, it becomes an "HTML
Application" and launches outside the browser as its own app. There are
additional parameters (and I'll post a sample structure below) that
control the window's appearance and restrictions on things like right
clicking.
The biggest thing to be aware of (for you and any users of your app) is
that an HTA is outside the security sandbox (such as it is) for IE. That
means that while a regular HTML file using Javascript can't access local
files, the registry, etc. an HTA file *can* do all of those things. It
has pretty much unfettered access to the local machine. The example
below contains a function that launches Notepad to edit the HTA itself.
To use an HTA as a basic site container, you're usually best off to make
a full-size <iframe> that has it's src attribute pointed to your
starting URL. This prevents clicked links from opening new IE windows
and keeps everything inside your HTA.
Also be sure to either leave either the sysmenu set to true (giving you
the "x" in the top right or provide a button/link to window.close().
Otherwise, it takes an ALT-F4 to kill the window. To make the example
chromeless, change the CAPTION to "no" instead of "yes".
All of the attributes of the HTA:Application tag are documented at
microsoft.com
-------------------------------------
J Wynia
Myriad Intellect, Inc.
"Web technology that earns its keep."
www.myriadintellect.com
-------------------------------------
----------yourfile.hta-------------
<HTML>
<HEAD>
<TITLE>Your HTA Application</TITLE>
<HTA:APPLICATION ID="yourHTA"
APPLICATIONNAME="Your HTA Application"
BORDER="thin"
CAPTION="yes"
CONTEXTMENU="yes"
ICON=""
INNERBORDER="no"
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
NAVIGABLE="yes"
SCROLL="auto"
SELECTION="yes"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="no"
SYSMENU="yes"
VERSION="1.0"
WINDOWSTATE="normal"/>
<script language="javascript">
<!--
function edit_hta(){
$this_hta = yourHTA.commandLine;
$command = "notepad.exe " + $this_hta;
$objShell = new ActiveXObject("WScript.Shell");
$lngReturn = $objShell.Run ($command, 1, true);
}
// -->
</script>
</HEAD>
<BODY>
Your HTA content goes here. Simply <a href="#"
onclick="edit_hta();">open this HTA file</a> in a text editor and go to
town. If you're looking to make this window look much more like a
regular Windows application, I recommend looking at the <a
href="http://webfx.eae.net/docs/environ.html">CSS values that you can
grab from the current Windows theme</a>. By setting your CSS to use
those values instead of things like #CCCCCC, you can make the HTA app
blend in with the current Windows settings.
</BODY>
</HTML>