Callback functions
Previous  Top  Next


Callback functions with specific names will execute only under certain conditions. For example, callback functions allow script code to execute only when an application starts or quits.

Currently defined callback function names:

OnFirstSandboxOwner - Called only when an application first locks the sandbox. This callback will not be called if a 2nd copy of the same application is launched using the same sandbox which the first copy is still running. If a 1st application spawns sub-process and then quits, the sandbox remains locked by the 2nd sub-process so this callback will not execute again until all sub processes have quit and the application is run again.

OnFirstParentStart - Called prior to executing a Thinstall EXE file regardless of weither the sandbox is simutaneously owned by another Thinstall'ed EXE.

OnFirstParentExit - Called when the first parent process exits. If a parent process executes a child process and quits, this callback will be called even if the child process continues to execute.

OnLastProcessExit - Called when the last process owning the sandbox exits. If a parent process executes a child process and quits, this callback will be called when the last child process exits.


------------------------example.vbs ---------------------------------

Function OnFirstSandboxOwner
   msgbox "The sandbox owner is: " + GetCurrentProcessName
End Function


Function OnFirstParentExit
   msgbox "Quiting application: " + GetCurrentProcessName
End Function


msgbox "This code will execute for all parent and child processes"

----------------------------------------------------------------------------