Professional Edition Only
SafeHouse Professional includes an ActiveX component which is registered with Windows when the product is initially installed. This component can be used by programmers to gain access to a variety of SafeHouse's features, making it possible to automate many of the product's functions using custom scripts and programming.
Module: SafeHouseCOM.dll
ProgID: SafeHouseCOM.SafeHouseUtility
Threading: Apartment
Interface: Dual, supporting both late and early binding.
The following executables found in the SafeHouse program files folder support a rich set of command line options that are so complete that you can practically do anything through scripting that you can otherwise do from the standard SafeHouse dialogs. This includes creating new volumes, opening and closing volumes, as well as resizing them.
TIP: Running the SafeHouse utilities silently without a window requires using the /SILENT and /GO command line options in addition to the usual parameters required by each utility. When you specify these options and are not missing any other required options, the SafeHouse utilities will not display and visual user interface.
Before using the ActiveX component with Visual Basic you must first set a reference to the module in Visual Basic as you would with any other COM component that you might choose to work with. Once you set a reference, you can access the component as shown below.
Dim sAboutText as String
Dim SafeHouse As New SAFEHOUSECOMLib.SafeHouseUtility
sAboutText = SafeHouse.About
Returns a string indicating the version of the ActiveX module.
Returns a string with the version of the SafeHouse device driver in the form "3.00.000", or if not loaded, then "0.0.0".
Returns string with list of the drive letters currently in use by open SafeHouse volumes. If there aren't any open volumes, then an empty string is returned.
If SafeHouse has three open volumes using drive letters D, E and F, this property would return "DEF" as the property value.
Returns the filepath for the volume associated with the mapped drive letter. If no volume is mapped to this letter, then returns empty string.
GetVolumeFilepathFromDriveLetter(DriveLetter as String) as String
Calling this function as shown below might return a string such as "c:\SafeHouse\Test.sdsk".
GetVolumeFilepathFromDriveLetter("D")
Executes the specified application with command line and working directory by calling the Win32 CreateProcess() API. Wait is a flag which is used to specify if the function should return immediately (False), or if it should Wait (True) for the application to terminate, and then return the application ExitCode. If Wait is False, then you will not be able to obtain the exit code since this function will return prior to the code becoming available.
ExecuteProgram(Application as String, CmdLine as String, WorkingDir as String, Wait as Boolean) as Integer
Application is the filepath to the program to execute. Although this function was intended to make it easy to invoke the SafeHouse utilities, it could in fact be used to invoke any standard Windows executable.
If Wait is set to False, the return code from this function is always 0. See SafeHouse Exit Codes for a complete list of possible return values.
CmdLine and WorkingDir may be empty strings if not needed.
The following example will close all open SafeHouse volumes without displaying any visual interface or sounds. Since the /force option is included, the volumes will be closed even if they have open files. Notice that /silent and /go are used to keep SafeHouse from displaying its dialog.
Dim Result as Integer
Result = SafeHouse.ExecuteProgram("c:\Program Files\SafeHouse\SDWMAP32.EXE", "/unmap=all /silent /go /force /sound=0", "", True)