English Deutsch Français Italiano Particle Software Buy Now


Particle Software
 
Passing Switches
   ..::   About  •  Purchasing  •  Search  •  Contact  • Home   ::..
 
Screenshots
• Sample
Downloads
Resources
• FAQ
• Macros

 
  Using the IntraLaunch function ExecuteIt(), you can dynamically change what you run or the switches you wish to pass to your program on the fly with Javascript. You must set the Run parameter to Null for the given IntraLaunch object.


 
 
<HTML>

<BODY>

(Common HTML Web Page)

<a href="Javascript:IntraLaunch.ExecuteIt('wordpad.exe')">WordPad.exe</a>

(Common HTML Web Page Continued)

</BODY>
</HTML>

<OBJECT ID="IntraLaunch" WIDTH=65 HEIGHT=77 STYLE="display : none"    CODEBASE="http://intranet.net/menu/IntraLaunch.CAB#version=5,0,0,0"    CLASSID="CLSID:0AE533FE-B805-4FD6-8AE1-A619FBEE7A23">
   <PARAM NAME="ImageLoc" VALUE="Null">
   <PARAM NAME="ImageSrc" VALUE="Null">
   <PARAM NAME="Run" VALUE="Null">
   <PARAM NAME="RunParms" VALUE="">
   <PARAM NAME="DefDir" VALUE="">
   <PARAM NAME="Display" VALUE="MAX">
</OBJECT>
 
 
       



 
 
<HTML>

<SCRIPT LANGUAGE="JavaScript">
  function Run()
  {
    IntraLaunch.ExecuteIt(document.main_form.program.value + "|" + document.main_form.switches.value);
  }
</SCRIPT>

<BODY>

(Common HTML Web Page)

<FORM name="main_form" action="Javascript:Run()">
    Program to Run: <input type="text" name="program" value="">
    Switches for Program: <input type="text" name="switches"value="">
    <input type="submit" value=" Launch ">
</FORM>

(Common HTML Web Page Continued)

</BODY>
</HTML>

<OBJECT ID="IntraLaunch" WIDTH=65 HEIGHT=77 STYLE="display : none"    CODEBASE="http://intranet.net/menu/IntraLaunch.CAB#version=5,0,0,0"    CLASSID="CLSID:0AE533FE-B805-4FD6-8AE1-A619FBEE7A23">
   <PARAM NAME="ImageLoc" VALUE="Null">
   <PARAM NAME="ImageSrc" VALUE="Null">
   <PARAM NAME="Run" VALUE="Null">
   <PARAM NAME="RunParms" VALUE="">
   <PARAM NAME="DefDir" VALUE="">
   <PARAM NAME="Display" VALUE="MAX">
</OBJECT>
 
 
       

  The above example demonstrates how to use ExecuteIt() to pass different switches to an IntraLaunch object. Clicking the Launch button in the form calls the Javascript function called Run, which in turn pulls the values program and switches from the form and passes them to the IntraLaunch object to launch. A pipe (|) must separate the program from any switches as shown. All other parameters such as Display and Sound are still processed and used for the executing program.

  This feature can also be used with other form objects such as drop down boxes, radio buttons, etc. Keep in mind backslashes from Javascript may have to be escaped with another backslash. Eg. C:\\path\\to\\file.txt.


Copyright © 1997-2012 Particle Software - All Rights Reserved
Web services provided by Extreme Hosting