0

Before I start, I am totally new to C# and most of my programming knowledge come from searching what i need on Google. :P I am good at copy paste but have basic programming skills.

I am working on an windows screenshot application to capture screens using Print Scrn key (by Hook in C#). So this application minimizes on start and user would be able to capture screens by just clicking on Print Scrn key.

I problem is I want the application to be able to save these screen caps in a word file in the background and when the user Hits "End" key the Word file Save Dialog should be displayed (This way user can save the word file by giving a name).

I know this is kind of tricky, but currently we do all these manually which eats up lot of our time. Open Word-> Take Screenshot - > Navigate to Word -> Paste - > Navigate to Window -> Take Screenshot - > Navigate to word again -> Paste .....

I wanted your help to make is let pain... Simple take screen caps-> keep doing it until done -> Click End to Save document.

I have found a portion of code to use Hook from stack overflow, all I need is a way to open an handle word file in the background.

Also I am able to generate pdf file using a third party .dll --which generates document with watermark :( So I thought I should use Word.

Your help would be much appreciated! Cheers! :)

  • Then use a different PDF library like iTextSharp. Even with Word, use a library or the Open XML SDK to create a Word file, don't force the user to install and run Word just for a couple of screen shots. – Panagiotis Kanavos Mar 26 '15 at 15:18
  • Also check [this duplicate question](http://stackoverflow.com/questions/3306600/c-how-to-take-a-screenshot-of-a-portion-of-screen) on how to take a screenshot in C# – Panagiotis Kanavos Mar 26 '15 at 15:21
  • @PanagiotisKanavos I am going to try Open XML to create word document. The reason why I wanted word file was- sometimes user may want to add few comments with the screenshots. – Kumar Priyank Mar 26 '15 at 16:05
  • @PanagiotisKanavos : I don't have an issue with how to capture screenshot... I am able to do that... in fact I am able to save them on local folders as well. But I want to be able to save them in a word file so that all screenshots appear chronologically. – Kumar Priyank Mar 26 '15 at 16:07

1 Answers1

0

I've actually made an application very similar to this and this is what I think personally: don't try to hook into keyboard shortcuts. What I did was created a system tray icon that if you middle click on will start the capture process.

Sending to Word as an in between staging step to get to PDF is weird. With iTextSharp library you can, with relative ease, add images to a PDF. And there is actually quite a few examples of doing so.

An existing model of an application to look at would be the Snipping Tool in Windows. It's not hard to screen capture the entire screen with .NET and place it on a form that you overlay across the entire screen. You can then allow them with their cursor to select a portion of the form.

test
  • 2,589
  • 2
  • 24
  • 52
  • Can you share the source code of your project? Did you use iTextSharp? What triggered the screen capture event? – Kumar Priyank Mar 26 '15 at 16:09
  • @KumarPriyank Unfortunately because it was developed for a business I cannot share the source code. iTextSharp wasn't used for this project, but it is easy enough to add an image using `PdfContentByte.AddImage`. As mentioned in my post, the screen capture was triggered by middle-clicking the system tray icon. – test Mar 26 '15 at 18:22