简体   繁体   English

如何从资源管理器中获取热项目名称和路径?

[英]How to get the hot item name and path from Explorer?

It was easy when the Windows' explorer was using a SysListView32 control for displaying its files list as opposed to the DirectUIHWND control in the subsequent versions of Windows after XP.当 Windows 的资源管理器使用 SysListView32 控件来显示其文件列表时,这很容易,而不是 XP 之后 Windows 的后续版本中的 DirectUIHWND 控件。

A simple task such as obtaining the 'hot item' which is that item (a filename) the mouse hovers above for some hundreds of milliseconds, where before I could use the macros一个简单的任务,例如获取“热门项目”,即鼠标在上方悬停数百毫秒的项目(文件名),在此之前我可以使用宏

ListView_GetHotItem with ListView_GetItemText and be able to obtain the filename under the mouse cursor. ListView_GetHotItem 和 ListView_GetItemText 并能够获得鼠标 cursor 下的文件名。

This simple task becomes almost impossible to do with the DirectUIHWND window unless I revert this control back to a SysListView32 which I have seen being proposed as the only solution on the many sites I have searched, and even if used the change does not occur immediately but only after I navigate out of the folder first.这个简单的任务几乎不可能用 DirectUIHWND window 来完成,除非我将此控件恢复为 SysListView32,我已经看到它被提议为我搜索过的许多网站上的唯一解决方案,即使使用了更改也不会立即发生,而是只有在我先导航出文件夹之后。

It has taken me almost 2 years trying to find a solution to this and until now I feel stumped.我花了将近 2 年的时间试图找到解决这个问题的方法,直到现在我都感到难过。

Anyone any idea please?请问有人有什么想法吗?

Basically I have subclassed the parent of the tooltip and intercepted the tooltip notifications and all I need is the filename and the full path of the item the mouse hoovers above it, the hot item.基本上,我已经对工具提示的父级进行了子类化并截获了工具提示通知,我需要的只是文件名和鼠标悬停在其上方的项目的完整路径,即热门项目。

https://docs.microsoft.com/en-us/archive/msdn-magazine/2000/march/windows-2000-ui-innovations-enhance-your-user-s-experience-with-new-infotip-and-icon-overlay-shell-extensions https://docs.microsoft.com/en-us/archive/msdn-magazine/2000/march/windows-2000-ui-innovations-enhance-your-user-s-experience-with-new-infotip-and-图标覆盖外壳扩展

IQueryInfo is required to provide the runtime text to the shell.需要 IQueryInfo 向 shell 提供运行时文本。 IPersistFile is used by Explorer to let the extension know about the specific file currently under the mouse pointer. Explorer 使用 IPersistFile 让扩展了解当前鼠标指针下的特定文件。

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

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