ShutdownWindows Method



 
The ShutdownWindows method closes SiteKiosk and all other running applications and shuts down windows.


Syntax

    SiteKiosk.ShutdownWindows()
Return Value
    None.
Remarks
    Periods of time are always indicated in milliseconds.
Examples
    The following example calls a method of the SiteKiosk object that will shut down Windows after 3 seconds.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    window.setTimeout("SiteKiosk.ShutdownWindows();", 3000);
    </SCRIPT>


    The following example can be modified and added to the "TrayWindow.html" of the used browser skin to achieve that SiteKiosk reboots or shuts down at an exact point of time.

    <script language="javascript">
    // Time:
    // use time in 24-hour format (HH:MM)
    // and "0" for no action.
    // Example: 
    // sWeekDays[1] = "01:25"; // Time Mondays 1:25 a.m.
    // Action: 
    // true=reboot, false=shutdown
    // Example:
    // bWeekReboot[1] = false;  // Shutdown Mondays
    
    var sWeekDays = new Array();
    var bWeekReboot = new Array();
    
    // Monday:
    sWeekDays[1] = "0";
    bWeekReboot[1] = true;
    
    // Tuesday
    sWeekDays[2] = "0";
    bWeekReboot[2] = true;
    
    // Wednesday
    sWeekDays[3] = "0";
    bWeekReboot[3] = true;
    
    // Thursday
    sWeekDays[4] = "0";
    bWeekReboot[4] = true;
    
    // Friday
    sWeekDays[5] = "0";
    bWeekReboot[5] = true;
    
    // Saturday
    sWeekDays[6] = "0";
    bWeekReboot[6] = true;
    
    // Sunday
    sWeekDays[7] = "0";
    bWeekReboot[7] = true;
    
    
    // Cutomizable Scheduler to reboot/shutdown this terminal
    function CreateShutdownScheduler()
    {
       var CurrentDate = new Date();
       var Day = CurrentDate.getDay();
       var strDays = new String();
       if (sWeekDays[Day] != "0")
       {
          strDays = sWeekDays[Day];
          if (bWeekReboot[Day])
          {
             SiteKiosk.Scheduler.AddFixedTimeEvent(
             parseInt(strDays.substring(0, 2)),
             parseInt(strDays.substring(3, 5)), 0,
             RebootScheduler);
          }else
          {
             SiteKiosk.Scheduler.AddFixedTimeEvent(
             parseInt(strDays.substring(0, 2)),
             parseInt(strDays.substring(3, 5)), 0,
             ShutdownScheduler);
          }
       }
    }
    
    // Customizable function to reboot
    function RebootScheduler(eventID)
    {
       SiteKiosk.RebootWindows();
    }
    
    // Customizable function to shutdown
    function ShutdownScheduler(eventID)
    {
       SiteKiosk.ShutdownWindows();
    }
    
    // Create Scheduler to shutdown/reboot the terminal
    CreateShutdownScheduler();
    </script>
    

Applies to
    SiteKiosk v5.0 (and later versions).

Back to top