Return to the tutorials
Return to the scripting


HDR Shop Scripting - ActiveX controls

Sometimes the standard HDRShop dialog control is not enough for more complex scripts. Some functions such as drag-and-drop can only be implemented with custom ActiveX controls. As ActiveX can contain arbitrary user code, HDRShop is not responsable for what happens inside the control. The control is responsable for its own memory management and user interface. To handle ActiveX controls, HDRShop has a custom Javascript class called AXControl. To initialize the control one must pass the name of the activeX control and a pointer to the HDRShop window it will inhabit.
var wnd = new Window(); // create an empty window
var ax = new AXControl("FILEDROPPER.FileDropperCtrl.1", wnd); // create a control in this window
ActiveX controls generate arbirary events. To handle these HDRShop defines a second helper event handler. Using this class, the user can map ActiveX scripts to Javascript functions.
var axe = GetEventHandler(ax);

// event handler
axe.OnFileDropped = function(filename)
{
  // do something
}
To see ActiveX controls in action try out hdr2ldr.js. This script uses the File Dropper control to generate a list of drag-and-drop files. HDRShop assumes you already have the necessary ActiveX controls installed on your system otherwise the script will generate an error. While there are several ways to install controls, you can easily use the Regsvr32 command line program included with the standard Windows install. (Quick'n'Dirty: Just type 'regsvr32 FileDropper.ocx' from a Command Prompt in the HDRShop\plugins directory.)

Return to the scripting
Return to the tutorials