Figures
Figure 1
Figure 1
Figure 1 VBScript and JScript Interoperability
<html>
<head>
<script language="javascript">
var jsVersion;
function jsWhoAmI() {
    var result;
    result = "I Am: ";
    result += ScriptEngine();
    result += " " + ScriptEngineMajorVersion();
    result += "." + ScriptEngineMinorVersion();
    result += " [build:" + ScriptEngineBuildVersion() + "]";
    jsVersion = result;
    return result;
}
function jsReport() {
    var msg;
    msg = "The Languages Currently Running Are:\n";
    msg += jsWhoAmI();
    msg += "\n";
    msg += vbWhoAmI();
    alert (msg);
}
</script>
<script language="vbscript">
dim vbVersion
function vbWhoAmI()
    dim result
    result = "I Am: "
    result = result & ScriptEngine()
    result = result & " " & ScriptEngineMajorVersion()
    result = result & "." & ScriptEngineMinorVersion()
    result = result & " [build:" & ScriptEngineBuildVersion() & "]"
    vbVersion = result
    vbWhoAmI = result
end function
sub vbReport()
    dim msg
    msg = msg & "The Languages Currently Running Are:" & vbCRLF
    msg = msg & jsWhoAmI()
    msg = msg & vbCRLF
    msg = msg & vbWhoAmI()
    alert msg
end sub

</script>
</head>
<body>
<button onclick="jsReport()" language="vbscript">jsReport</button>
<button onclick="vbReport();" language="javascript">vbReport</button>
<button onclick="alert (jsVersion & vbCRLF & vbVersion)" language="VBScript">vbReport2</button>
<button onclick="alert (jsVersion+'\n'+vbVersion);" language="JavaScript">jsReport2</button>
</body>
</html>
Figure 2 Disabling the Toolbar
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function popup(url, name, width, height)
        {
            settings=
            "toolbar=no,location=no,directories=no,"+
            "resizable=yes,width="+width+",height="+height;
            
            new_window=window.open(""+url,name,settings);
        }
//-->
</SCRIPT>
</HEAD>

<A HREF="javascript:popup('appform.htm');">Click here to fill out the  form</A>
<BR>
Figure 3 Launching a Browser Window with ShellExecute
Private Const SW_SHOW = 5       ' Displays Window in its current size
                                ' and position
Private Const SW_SHOWNORMAL = 1 ' Restores Window if Minimized or
                                ' Maximized

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
   "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
   String, ByVal lpFile As String, ByVal lpParameters As String, _
   ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Declare Function FindExecutable Lib "shell32.dll" Alias _
   "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As _
   String, ByVal lpResult As String) As Long

Private Sub Command1_Click()
Dim FileName, Dummy As String
Dim BrowserExec As String * 255
Dim RetVal As Long
Dim FileNumber As Integer

' First, create a known, temporary HTML file
BrowserExec = Space(255)
FileName = "C:\temphtm.HTM"
FileNumber = FreeFile                    ' Get unused file number
Open FileName For Output As #FileNumber  ' Create temp HTML file
    Write #FileNumber, "<HTML> <\HTML>"  ' Output text
Close #FileNumber                        ' Close file
' Then find the application associated with it
RetVal = FindExecutable(FileName, Dummy, BrowserExec)
BrowserExec = Trim(BrowserExec)
' If an application is found, launch it!
If RetVal <= 32 Or IsEmpty(BrowserExec) Then ' Error
    MsgBox "Could not find associated Browser", vbExclamation, _
      "Browser Not Found"
Else
    RetVal = ShellExecute(Me.hwnd, "open", BrowserExec, _
      "www.microsoft.com", Dummy, SW_SHOWNORMAL)
    If RetVal <= 32 Then        ' Error
        MsgBox "Web Page not Opened", vbExclamation, "URL Failed"
   End If
End If
Kill FileName                   ' delete temp HTML file
End Sub
Figure 4 Setting Volume Parameters
<html>
<body>
<OBJECT ID="MPlay1" width="0" height="0"
 classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
 TYPE="application/x-oleobject">
 <PARAM NAME="FileName" VALUE="MyFavoriteSongOfTheMoment.mid">
 <PARAM NAME="Volume" VALUE="-600">
</OBJECT>
<button onclick="ChangeVolume(100)">+</button>
<button onclick="ChangeVolume(-100)">-</button>
<span id="VolSetting" style="width:50;background:beige">&nbsp;</span>
 
<script language=javascript>
var iVolume = MPlay1.volume;
VolSetting.innerText = iVolume;
 
function ChangeVolume(amount) {
 iVolume += amount;
 if (iVolume < -10000) {
  iVolume = -10000;
 } else if (iVolume > 0){
  iVolume = 0;
 } 
 MPlay1.volume = iVolume;
 VolSetting.innerText = iVolume;
}
</script>
</body>
</html>
Page view tracker