TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Reply To: Using TWAIN from windows service application

Forums › TWAIN Classic › Using TWAIN from windows service application › Reply To: Using TWAIN from windows service application

January 6, 2008 at 11:22 pm #24244
gabe
Participant
  • Topics - 9
  • Replies - 583
  • Total Posts - 592

Yes this is possible. It’s tricky depending on your programming language to get the messagepump to work correctly but after the pump is running it isn’t too much work. I have a vb.net windows service to make scanners available over the network. it listens/watches a network share for message files and based on the files performs a scan.
In addition to the regular twain code you’ll have to work out some sort of dialog box management as a dialog box saying that the device is offline or that there has been a paperjam is a show stopper if the app is running as a service. From .net the dialog box manager was somewhat troublesome as it involved setting a cbthook and a shellhook. It didn’t initially seem that 2 different hooks would be required but some of the vendors don’t seem to… well some vendors are more creative than others.
The remaining piece is a config Ui, in my case I have a standard form that sets up a profile and saves the parameters, the config Ui communicates with the service via a ipcServerCahnnel. That part was simple enough.
The client side can be anything that is able to write the text files used for communication – in my case the client is a win32 app hosted by our main product.

In general you’ll need to have a larger portion of the twain spec covered and implemented than if this were a desktop app as there won’t be much onscreen indication that something has gone wrong since the app will be running for all intents and purposes headless.

All in all it was a pain to write but the payoff is that our main product running in citrix/terminal server session is able to acquire images from the machine that started the session.

If you’re looking for help getting a project running, let me know what language you’re using and I try to help.

.

Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in