Reputation: 51094
While I can't get my desktop, running Win7 64, to connect to our network printer, I'd like to be able to paste files, using Input Director, into a share on my laptop. There I'd like a FileSystemWatcher to pick them up and print, then delete them. How can I do thi? I assume I need to hook into the shell somehow, meaning my app can't be a service, but I'm really clueless here.
I've installed Input Director, so I can move my cursor off my desktop desktop screen onto my laptop desktop, and just right click the file to print. However, I am still interested in learning ways to do the printing.
Upvotes: 2
Views: 1966
Reputation: 4171
System.Drawing.Printing will help you do what you want. No need to hook into the shell, so you could do this as a service. Whenever you detect a new file, just ship it off to the printer.
For more involved types (Word documents and such), you can use the Interop libraries to use Word itself to print the document. For example, here is the Interop.Word PrintOut method.
Upvotes: 0
Reputation: 2356
I suppose it would depend on what you are trying to print, since the app is responsible for rendering a document to the print device, not the shell itself.
Isn't this just the long way round to finding correct drivers for your printer?
Upvotes: 1
Reputation: 4546
Given your requirement (a non-production, non-server solution) why not just have a command-line app that starts on your laptop and does the FileSystemWatcher hook and prints them? Or you could write an app that "lived" in the icon tray.
As for how to print them, that's app by app specific, but for many apps you can let the shell figure it out and use the ShellExecute API with the print operation.
Upvotes: 0