Symptom:
Sometimes, you may find the cancel button in Select Source dialog doesn't work properly. After clicking the Cancel button, it proceeds with scanning.
Solution:
Please try the following code to avoid the issue.
function btnScan_onclick() {
if (frmScan.DynamicWebTwain1.SelectSource()) {
frmScan.DynamicWebTwain1.OpenSource();
frmScan.DynamicWebTwain1.AcquireImage();
}
else {
frmScan.DynamicWebTwain1.CloseSource();
}
}