John,
The ImageEn Twain can detect if the twain drivers are installed in windows, but the ImageEn Twain or for that matter any twain can not be used to determine if the scanner is turned on. You can search for this on the web, but you will find there is no way to determine if a scanner is on via twain.
This approach works with digital camera and WIA, but there is no method you can call to know if a camera is plugged in or turned on:
for i := 0 to ImageEnView1.IO.WIAParams.DevicesInfoCount - 1 do
if ImageEnView1.IO.WIAParams.DevicesInfo[i].DeviceType = iewDigitalCamera
then
Camera1.Items.Add(ImageEnView1.IO.WIAParams.DevicesInfo[i].Name);
if Camera1.Items.Count = 0 then
'Camera is not plugged in or turned on'
I just tried this with a usb HP Scanner..
if ImageEnView1.IO.WIAParams.DevicesInfo[i].DeviceType = iewScanner;
Even though the scanner is off there still is a device loaded into the combobox. So I guess it depends on the devices software implementation.
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development