initial code for HCapture