It continues with scanning after clicking Cancel button in Select Source dialog.

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:

function AcquireImage() {
    if (DWObject) {
        if (DWObject.SelectSource()) {
            DWObject.OpenSource();
            DWObject.AcquireImage();
        }
        else 
            DWObject.CloseSource();
    }
}