上下文菜单的捕获窗口(Alt-Print Screen)
众所周知,有时开发人员必须记录一些东西。 或者捕获一些东西来提交错误报告。
我的问题是在 MS Windows 中。
我正在尝试捕获应用程序多个区域的上下文菜单(右键单击某个项目后出现的弹出菜单)。 按 Alt 启动 Alt+PrintScreen 进程会关闭上下文菜单。
(只有按 PrintScreen 有帮助,但每次删除非窗口区域都很痛苦)。
奖励:为了捕获菜单,Alt 还会关闭菜单。 但是,如果您首先使用 Alt 键打开菜单,则它会起作用:
- 按 Alt+F (用于打开“文件” 菜单),不要释放 Alt
- 按 PrintScreen
- Tada!
As everyone knows, sometimes developers have to document stuff. Or capture some stuff for filing bug reports.
My question is in MS Windows.
I'm trying to capture the context menu (the popup menu that appears after right-clicking an item) of several areas of an application. Pressing Alt to start the Alt+PrintScreen process closes the context menu.
(Only pressing PrintScreen helps, but it's painful to remove the non-window areas everytime).
BONUS: For capturing menus, Alt also closes the menu. However, if you use the Alt key to open the menu in the first place, it works:
- Press Alt+F (for opening the "File"
menu), don't release Alt - Press PrintScreen
- Tada!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(25)
您无法单独获取菜单,但您可以通过与您在主菜单中发现的类似技巧来让它捕获父窗口+上下文菜单:
至少你不用安装任何软件!
You can't get the menu on its own, but you can get it to capture the parent window + context menu through a similar trick to the one you discovered with the main menu:
At least you don't have to install any software!
使用 Windows 7,我同时使用 Ctrl 和 PrntScr。
这占据了整个屏幕。 然后,我将 (Ctrl + V) 粘贴到图像编辑器中,并裁剪掉除上下文菜单之外的所有内容。
我的计算机上确实禁用了 Windows高对比度辅助模式(控制面板 -> 轻松访问中心 -> 使计算机更易于查看 -> 取消选中“打开或关闭”关闭高对比度...”)。 我不确定这是否有必要。
注意:如果您的键盘没有 PrntScr 作为主键(它可能以蓝色小字体显示),那么显然您必须对此进行调整(例如您可能需要按Alt才能获得PrntScr功能,这意味着总共的按键顺序为Ctrl + Alt +键盘上的 PrntScr)。
Using Windows 7, I used Ctrl and PrntScr at the same time.
That captured the entire screen. I then pasted (Ctrl + V) into an image editor, and cropped out everything except the context menu.
I do have the Windows High Contrast Acccessibility Mode disabled on my computer (Control Panel -> Ease of Access Center -> Make the computer easier to see -> uncheck "Turn on or off High Contrast ..."). I'm not sure if that was necessary or not.
Note: if your keyboard does not have PrntScr as a primary key (it might show in small blue font), then obviously you'll have to adjust for that (e.g. you may need to press Alt to get the PrntScr function, which means a total key sequence of Ctrl + Alt + PrntScr on your keyboard).
只需按打印屏幕即可。 它将捕获整个屏幕。 然后在新窗口中打开画图,然后按 Ctrl+V 进行粘贴然后裁剪。
Just press Print Screen. It will capture whole screen. Then open paint to a new window, and press Ctrl+V to paste then crop.
对于截图工具的用户来说,实际上有一种稍微简单的方法。我从 Microsoft 网站本身获取了这个方法。 它来自这个网站: http://windows.microsoft.com/en-us/windows/use-snipping-tool-capture-screen-shots#1TC=windows-7
如果您想捕获菜单的片段,例如作为“开始”菜单,请按照下列步骤操作:
单击“开始”按钮 “开始”按钮的图片,打开截图工具。 在搜索框中,键入“截图工具”,然后在结果列表中单击“截图工具”。
打开截图工具后,按 Esc,然后打开要捕获的菜单。
按 Ctrl+PrtScn
单击“新建”按钮旁边的箭头,从列表中选择“自由形式片段”、“矩形片段”、“窗口片段”或“全屏片段”,然后选择您想要捕获的屏幕区域。
There's actually a slightly easier way for those users of the Snipping Tool.. I pulled this from the Microsoft site itself. It's from this site: http://windows.microsoft.com/en-us/windows/use-snipping-tool-capture-screen-shots#1TC=windows-7
If you want to capture a snip of a menu, such as the Start menu, follow these steps:
Open Snipping Tool by clicking the Start button Picture of the Start button. In the search box, type Snipping Tool, and then, in the list of results, click Snipping Tool.
After you open Snipping Tool, press Esc, and then open the menu that you want to capture.
Press Ctrl+PrtScn
Click the arrow next to the New button, select Free-form Snip, Rectangular Snip, Window Snip, or Full-screen Snip from the list, and then select the area of your screen that you want to capture.
有更简单的方法,
只需
:)
there is much easier way,
simply
:)
尝试 SnagIT。 就像黄油里的热刀一样! 另请参阅:https://stackoverflow.com/questions/26183/screenshot-take-tools
Try SnagIT. Works like a warm knife in butter! Also see this: https://stackoverflow.com/questions/26183/screenshot-taking-tools
您可以尝试FastStone Capture,恕我直言,它是此类错误归档的最佳工具/doc 制作东西。
使用此应用程序,只需右键单击鼠标即可显示上下文菜单,点击打印屏幕,等等!
You might give a try to FastStone Capture which is imho the best tool for this kind of bug filing/doc making stuff.
With this app, just right click on the mouse so as to show the contextual menu, hit print screen, et voilà!
按 Ctrl + Alt + 打印屏幕。
Ctrl 不会执行任何操作,但会阻止 Alt 关闭上下文菜单。
Press Ctrl + Alt + Print Screen.
The Ctrl won't do anything, but it will prevent Alt for closing the context menu.
这是我的解决方案(2019/07/18 在 Windows 10 上测试)。
对于右键单击上下文菜单:(并非适用于所有情况。)
对于工具栏菜单:
Here is my solution (2019/07/18 Tested on Windows 10).
For RIGHT click context menu: (it is not work for all situation.)
For tool bar menu:
为了响应OP的“BONUS”部分,我有时只想从菜单中捕获“下拉菜单”的内容(我可能没有使用精确的术语)。 现在,功能区已取代了许多应用程序中的菜单,要从功能区(例如 Excel、主页、查找和选择)捕获“下拉菜单” - 执行以下操作:
这也会捕获所选项目上的突出显示。
这适用于我的 Win7、Office 2010。
In response to the "BONUS" part of the OP, I sometimes just want to capture the contents of a "dropdown" from a menu (I may not be using to exact nomenclature). Now that the ribbon has replaced the menu in so many apps, to capture a "dropdown" from the ribbon (e.g. Excel, Home, Find & Select) - do the following:
This also captures the highlight on the selected item.
This works for me on Win7, Office 2010.
您可以使用Screenshot Captor(免费)。
您可以执行 Windows 对象捕获来捕获仅上下文菜单(也可与菜单捕获一起使用),或者仅捕获普通的打印屏幕键来捕获整个屏幕。
-mouser
[免责声明——我是 Screenshot Captor 的作者]
You could use Screenshot Captor (free).
You can do a Windows Object Capture to grab only the context menu (works with menu capturing as well), or just normal printscreen key to capture the whole screen.
-mouser
[disclaimer -- i am the author of Screenshot Captor]
我尝试使用我最喜欢的免费屏幕捕获软件:MWSnap。 我激活了窗口/菜单捕获功能的快捷键(Ctrl + Shift + Z),当它在后台时,我调用了 Firefox 的上下文此页面上的菜单并使用快捷键。 MWSnap 突出显示了菜单,单击后即可完美捕获它。
可能适用于其他屏幕捕获软件。 PrintScreen 已经过时了... :-P
(奖励:无需打开 Paint,以您想要的任何常见格式(PNG、Jpeg)保存,自动保存和自动捕捉数量,等等。)
I tried with my favorite, free screen capture software: MWSnap. I activated a shortkey (Ctrl + Shift + Z) to window/menu capture function, and while it was in background, I called Firefox's context menu on this page and used the shortkey. MWSnap highlighted the menu and upon clicking, captured it flawlessly.
Probably works with other screen capture softwares. PrintScreen is so obsolete... :-P
(Bonus: no Paint to open, save in any common format (PNG, Jpeg) you want, autosave & auto-number of captures if you want, etc.)
您可以尝试 PicPick
You could try PicPick
我无法获得可接受的工作答案(尽管禁用高对比度),但这可以做到:
(唯一的区别是既不按 F10 也不按 Alt)
I can't get accepted answer to work (despite disabling high contrast) but this does it:
(the only difference is neither pressing F10 nor alt)
作为这篇文章的更新,来自 Microsoft 答案网站对 Windows 7+ 用户的回答
如何右键打印屏幕?
如果您使用内置的“截图工具 ” ”(在“开始”菜单中找到它),您可以截取菜单:
As an update to this post from an answer to those with Windows 7+ from the Microsoft's answer site
How to Print Screen a right click?
If you use the built-in "Snipping Tool" (find it in your Start menu), you can take a snip of a menu:
在 Windows 7 中:
In Windows 7:
20/20 还可以捕获上下文菜单
http://www.sofotex.com/20/20-download_L230.html
20/20 can also capture a context menu
http://www.sofotex.com/20/20-download_L230.html
至于捕获上下文菜单,例如右键单击菜单或其他按 Alt 键导致菜单消失的菜单,至少在 Windows 7 上,请查看:
http://blogs.technet.com/b/migreene/archive/2007/05/12/how-to-use-the-snipping-tool-to-capture-context-menus.aspx,以及 Uwa 的评论。
基本上,打开截图工具(应内置于 Windows 7 中,可以使用“开始”菜单搜索)并单击“取消”按钮,但不要关闭截图工具。 然后打开上下文菜单并按(在桌面键盘上)Ctrl+PrintScreen。 这将切换回截图工具,您可以在捕捉之前选择选项,但保持上下文菜单打开。
使用截图工具,您可以捕获全屏、窗口、矩形或自由形式的截图。 如果您只想捕获上下文菜单而不是父窗口,则矩形截图可能最适合您的需求。
As far as capturing context menus such as right-click menus or others for which pressing the Alt-key causes the menu to disappear, at least on Windows 7, check out:
http://blogs.technet.com/b/migreene/archive/2007/05/12/how-to-use-the-snipping-tool-to-capture-context-menus.aspx, as well as the comment there by Uwa.
Basically, open up Snipping Tool (which should be built into Windows 7 and can be searched for using the Start menu) and click the Cancel button, but do not close out of Snipping Tool. Then open up your context menu and press (on a desktop keyboard) Ctrl+PrintScreen. This will switch back to Snipping Tool, where you can select options before you capture, but leave your context menu open.
With Snipping Tool, you can capture a full screen, window, rectangular, or free-form snip. If you just want to capture the context menu and not the parent window, the rectangular snip will likely suit your needs best.
Linux 或 BSD 上的用户可以尝试 scrot:
这将在五秒后截取屏幕截图并将其放在您的主目录中。 确保在 5 秒结束之前单击打开的上下文菜单。 之后,使用您最喜欢的图像编辑器(例如 GIMP)编辑屏幕截图以仅保留上下文菜单。
在 Ubuntu 上,你可以像这样安装 scrot:
在 Arch 上,它是这样的:
Users on Linux or BSD can try scrot:
That will take a screenshot after five seconds and place it in your home directory. Make sure you click the context menu open before the 5 seconds are over. After that, edit the screenshot with your favorite image editor (for example GIMP) to only keep the context menu.
On Ubuntu you install scrot like this:
On Arch it goes like this:
我尝试过很多(超过 25 个应用程序)声称可以将 ScreenShot 保存到文件中。
他们做到了,但做得不好。
您可以尝试这个简单的逐步测试:
当窗口边框不是(我将使用Delphi常量名称)“bsSizeable”时,情况也是最糟糕的,如果它是“bsDialog”、“bstoolWindow”等,则大多数使用snapshops的应用程序会松动左侧和顶部的某些部分窗户的; 就像他们在哪里裁剪一样。
所以,我必须问:
是否有任何应用程序可以捕捉 Alt+Printscreen 自动保存剪贴板? 而不是他们自己制作屏幕截图!
换句话说,当我不使用任何工具时,我会得到粘贴在剪贴板上的正确大小/区域,但是当使用应用程序使屏幕截图更容易时,对于某种窗口,我会在窗口边框周围获得更多像素,或者最糟糕的是,丢失了部分窗口窗户。
所有这些应用程序都有这个问题,在它们上很容易看到它(还有更多有这个问题的应用程序,但我按字母顺序排列了最著名/最受欢迎的应用程序):Cropper 1.9.4、FSCaptureSetup53 、GreenShot、Lightscreen、PrtScrAssistant、ScreenshotCaptor 等等。
顺便问一下,为什么他们要自己制作屏幕截图? 当按下 Alt+Printscreen 时(没有任何钩子、没有运行屏幕捕获应用程序等),Windows 将正确的区域放在剪贴板上; 但是当任何此类应用程序运行时,剪贴板/文件/等会获得不正确的区域。
请注意,我说的是“标准”窗口,没有主题,全部带有矩形边框,没有个人 GUI 等...... Windows 标准形式。
某些应用程序会在窗口的矩形边框周围放置额外的边距。
其他应用程序剪切了矩形窗口的一部分,因此某些部分丢失了,以至于标题标题的第一个字母(当没有显示系统菜单图标时)丢失。
哪一个与 Windows 标准 Alt+Printscreen 一样工作(保存相同区域)? 我还不知道有哪一个,我当时测试的所有内容都失败了。
我知道的唯一解决方案是打开 Paint.Net 并使用:
从我尝试过的所有应用程序中,其中一些不会自动保存为 PNG; 大多数创建 PNG 的程序保存了错误的区域(有些区域较大,有些区域不足); 总是谈论拍摄标准矩形窗口的快照。
测试环境:Windows XP、7、8、8.1 和 10
P.D.:如果您不是可以为表单设置 BorderStyle 和 BorderIcons 的开发人员,只需尝试使用任何显示不可调整大小的工具窗口、对话框等的应用程序...很容易看出通过 windows 进行 windows 屏幕截图并粘贴结果与任何可以自动保存的应用程序之间的区别; 请记住,您需要使用 Alt+PrintScreen (仅需要活动矩形窗口的区域,不多也不少)。
I had tried a lot (more than 25 apps) that claim to save ScreenShot to a file.
They do it, but not well.
All you can try this simple step by step tests:
It is also worst when window border is not (i will use Delphi constant names) "bsSizeable", if it is "bsDialog", "bstoolWindow", etc, most of the applications that takes snapshops loose some part of the left and top part of the window; like if they where cropping.
So, i must ask:
Is there any application that can catch Alt+Printscreen to auto save the clipborad? Instead of them making their own screen shot!
In other words, when i use no tool i get the correct size / region pasted on clipboard, but when using applications to make screenshot easier, with some kind of windows i get more pixels around the windows border, or worst, lost part of the window.
All theese apps has that problem, and on them it is very easy to see it (there are a lot more with taht problem, but i put the most well known / most popular ones, in alfabethic order): Cropper 1.9.4, FSCaptureSetup53, GreenShot, Lightscreen, PrtScrAssistant, ScreenshotCaptor, ... etc.
By the way, why they are making the screen shot by them selves? When Alt+Printscreen is pressed (without any hook, no screen capture app running, etc), Windows put on the clipboard the correct region; but when any of such apps are running, the clipboard / file / etc get an incorrect region.
Please note i am talking about "standard" windows, no theme, all with rectangular border, no personal GUI, etc... windows standard forms.
Some apps, put an extra margin arround the rectangular border of the window.
Other apps, cut part of the rectangular window, so some part is lost, so much, that first letter of the title caption (when no system menu icon is shown) is lost.
Wich one does work (save same region) as the same as Windows stardard Alt+Printscreen? I do not yet know of any one, all i tested fails at that point.
The only solution i known is having Paint.Net open and use:
From all apps i had tried, some of them do not auto save as PNG; most of the ones that create a PNG save wrong region (some with bigger region, some with insuficient region); allways talking about taking a snapshot of a standard rectangular window.
Tested on: Windows XP, 7, 8, 8.1 and 10
P.D.: If you are not a developer that can set BorderStyle and BorderIcons for your forms, just try with any app that show non resizable tool windows, dialogs, etc... it is really easy to see the difference between doing windo screen shot by windows and than paste the result versus any of theese apps that can auto save; remember you need to use Alt+PrintScreen (only the region of the active rectangular window wanted, no more, no less).
发现一个像魅力一样工作: free_clipboard_manager
概念有些不同:将剪贴板复制到每个文件剪贴板更改的时间。
它还将复制到剪贴板的文本保存在 TXT 文件中。
由于它保存的是复制到剪贴板的内容,因此它会像Windows一样保存屏幕截图,包括窗口边框不同时的Alt-PrintScreen等。
它是便携式的,无需安装,无需提升等,它以普通用户帐户运行。
它创建一个名为
clipboard
的文件夹,其中将复制到剪贴板(仅使用图像和文本测试)的所有内容存储到文件中,每次剪贴板更改时都会创建一个文件,一个用于文本的 .TXT 和一个 .PNG对于图像(可以在选项中更改为 .JPG(90% 和 80%)。我已在 Windows 10 上对其进行了测试,因此它也适用于 Windows 10。
Found one working like a charm: free_clipboard_manager
Concept is somehow different: Copy the clipboard to a file each time the clipboard changes.
And it also saves TEXT copied to clipboard in a TXT file.
Since it saves what is copied to the clipboard, it saves the screenshot just as windows does it, including Alt-PrintScreen when window border is different, etc.
It is Portable, no install needed, and no elevation, etc, it runs in normal user account.
It creates a folder called
clipboard
where it store each thing copied to clipboard (tested only with image and text) to files, each time clipboard changes one file is created, a .TXT for text and a .PNG for images (can be changed in options to .JPG (90% and 80%).I had tested it on Windows 10, so it also works on Windows 10.
我使用更简单的按键顺序(对于主菜单,而不是上下文菜单):
对于上下文菜单,我使用以下顺序:
全部在 Windows 10 上进行测试。
I use a more easy key pressing sequence (for main menus, not for context menus):
For context menus I use this sequence:
All tested on Windows 10.
如果您想轻松打印菜单和子菜单
简单的一步!
W10 上的 Ctrl + Fn+ PrntScrn
粘贴到画图或写字板中
If you want to easily print menus and submenus
Easy step!
Ctrl + Fn+ PrntScrn on W10
Paste in Paint or Wordpad
您可以使用录屏软件DemoCreator录制整个过程。 您还可以在录音中添加多个标注。
You may record the whole process with screen recording software DemoCreator. And you can add multiple callouts to your recording.
你不需要任何东西。
只需勾上菜单窗口即可。
you don't need anything.
Just hook the menu window .