General information
Category:
ActiveX controls in VFP
I lose control of my vfp application after executing the startscan method.
The focus switches to another open window. How do I keep focus on the scanning application main window? I'm calling vfp executable from another vfp application. The scanning application has a main form with the activex control on it. Once scanning begins, the focus switches to the most recent open\active window
such as excel or email. I wish focus to stay on the scanning application until i have completed processing.
Below is the code for initiating the scan process.
with thisform.ImgScan1
*if .showselectscanner<>0 then
* create new file key for automatically naming the file
* thisform.generate_newfileno()
* check to see if scanner is available before proceeding
if .scanneravailable() then
.scanto=1
.multipage=.t.
*.pagecount=thisform.txtpagcnt.value
*.image = IMAGEPATH + ALLT(ThisForm.cbotempfiletype.value) + alltrim(newidkeyc) + ".tif"
.image = ImgPath + ALLT(ThisForm.cbofiletype.value) + alltrim(filenumber) + ".tif"
* start scanning...
.startscan()
*.scandone()
*goimgapp.switchfocus()
*.ScanUIDone()
* stop scanning...
*.stopscan()
* select image file and finalize update
* append unique scanned file to image lookup file
*thisform.save_scanning()
else
wait window "Scanner Not Available"
endif
*else
* wait window "Scanner Not Selected"
*endif
endwith
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only