选定文件的 Shell 扩展名
有没有办法知道在 Windows 资源管理器中选择了哪个文件? 我一直在查看此处发布的教程白痴指南...但是描述的操作是:
悬停
上下文
菜单属性
拖动
拖放
我想知道是否有一个方法在选择文件时被调用。 例如创建文件的缩略图视图。
谢谢。
Is there a way to know which file is being selected in windows explorer? I've been looking at the tutorial posted here Idiots guide to ... but the actions described are:
hover
context
menu properties
drag
drag and drop
I wonder if is there a method that get invoked when a file is selected. For instance to create a thumbnail view of the file.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是我在 AutoHotkey 中执行此操作的方法:
我从资源管理器的编辑字段中获取路径(这很容易出现问题!可以不存在或可以设置为不显示完整路径)。
核心思想是询问Explorer的SysListView32控件选中的项目是什么,并获取它们。
现在,这是一个黑客,可能有更干净的方法...
PS:还发现了这个: 使用 SendMessage 从 SysListView32 中获取 C# 中的 ListView 项目
需要一些巫术才能让它在另一个进程上工作...
真正的代码位于 法国网站!
Here is how I do it in AutoHotkey:
And I get the path from the edit field of the Explorer (which is prone to problems! Can be absent or can be set up not to display full path).
The core idea is to ask the SysListView32 control of Explorer what are the selected items, and get them.
Now, that's a hack, there are probably cleaner ways...
PS.: Also found this: Getting ListView items in C# from SysListView32 using SendMessage
Need some voodoo to get it working on another process...
Real code at a French site!
我遇到了这个 python 脚本。
但我只获取打开的文件夹,而不获取该文件夹中当前选定的项目。
有人有更多信息吗?
I came across this python script.
But I only get the folder that is open and not the currently selected item in that folder.
Anyone has more info?