简体   繁体   English

如何使用C#中的钩子将多个屏幕截图直接保存到Word文件中?

[英]How can I save a multiple screenshots using hook in C#, directly to a word file?

Before I start, I am totally new to C# and most of my programming knowledge come from searching what i need on Google. 在开始之前,我是C#的新手,我的大部分编程知识都来自于在Google上搜索所需内容。 :PI am good at copy paste but have basic programming skills. :PI擅长复制粘贴,但具有基本的编程技能。

I am working on an windows screenshot application to capture screens using Print Scrn key (by Hook in C#). 我正在使用Windows屏幕截图应用程序来使用Print Scrn键(由C#中的Hook捕获)捕获屏幕。 So this application minimizes on start and user would be able to capture screens by just clicking on Print Scrn key. 因此,该应用程序最小化了启动时间,用户只需单击Print Scrn键就可以捕获屏幕。

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). 我的问题是我希望应用程序能够将这些屏幕截图保存在后台的Word文件中,并且当用户单击“结束”键时,应该显示Word文件“保存”对话框(这样,用户可以通过以下方式保存Word文件:一个名字)。

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 ..... 打开Word->截屏->导航至Word->粘贴->导航至窗口->截屏->再次导航至Word->粘贴.....

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. 我发现有一部分代码可以从堆栈溢出中使用Hook,我所需要的只是在后台打开句柄单词文件的一种方法。

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. 我也可以使用第三方.dll生成pdf文件-生成带有水印的文档:(因此,我认为我应该使用Word。

Your help would be much appreciated! 您的帮助将不胜感激! Cheers! 干杯! :) :)

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. 在升级到PDF的中间步骤中发送到Word很奇怪。 With iTextSharp library you can, with relative ease, add images to a PDF. 使用iTextSharp库,您可以相对轻松地将图像添加到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. 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. 使用.NET截屏捕获整个屏幕并将其放置在覆盖整个屏幕的表单上并不难。 You can then allow them with their cursor to select a portion of the form. 然后,您可以让他们及其光标选择表单的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM