鼠标悬停获取文件路径Windows资源管理器 [英] Mouse Over Get File Path windows explorer

查看:299
本文介绍了鼠标悬停获取文件路径Windows资源管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨firends我想找到一个文件的路径,我的鼠标在它上面..

windows显示有关文件的信息,当你继续它..我想要它的路径..如果不知道哪个文件点击它可以。

我尝试做什么;

i在我使用它之前用于linux之前我看到了当你来到文件时它显示了它的priew关于它所以我想为Windows 7做同样的事情,但是当我把鼠标放在它上面需要帮助时你需要帮助你读取文件路径。

Hi firends i want to find a path of file which my mouse over it..
windows shows information about file when u go on it..i want it path..if cant which file clicked it can be.
What i m tryign to do ;
i used before linux for short when i was using it i saw a when u come over file it shows priew about it so i would like to do same for windows 7 but i codunt get file path when mouse over it need help thx for ur read..

推荐答案

间谍++ [ ^ ]。



您可以实现全局消息钩子,Spy ++可以帮助您确定要查找的内容 - Windows类,要监视的消息等等。



shell API提供了许多通知:

http://msdn.microsoft.com/en-us/library/bb774198(v = vs.85).aspx [ ^ ] - 一些几乎适合账单 - 就像SFVM_GETTOOLTIPTEXT一样。



如果你可以通过使用通知,你很幸运 - 另一种方法更复杂,可能非常容易出错 - 甚至不确定它是否有效相似的各种版本的窗口...



问候

Espen Harlinn
Play around with Spy++[^].

You could implement a global message hook, Spy++ can help you determine what to look for - Windows class, messages to monitor and so on.

The shell API provides many notifications:
http://msdn.microsoft.com/en-us/library/bb774198(v=vs.85).aspx[^] - some which nearly fits the bill - like SFVM_GETTOOLTIPTEXT.

If you can get by using the notifications, you are in luck - the other approach is MUCH more complicated, and probably quite error prone - not even sure it will work alike for various versions of windows ...

Regards
Espen Harlinn


添加到Espen的回答:



您可以在资源管理器窗口(或者更确切地说是特定的资源管理器窗口)上使用钩子,并尝试读取其子控件的内容。该信息与当前鼠标位置一起可以为您提供足够的数据来确定鼠标是否悬停在文件名上。



但是由于很多Shell API都是通过COM公开的,所以你可能想要使用它。有关详细信息,请参阅此优秀文章:



自动化活动Windows资源管理器或Internet Explorer窗口 [ ^ ]
Adding to Espen's answer:

You can use a hook on the Explorer window (or rather a specific Explorer window) and try and read the contents of its child controls. That info together with the current mouse position can give you enough data to figure out if the mouse is hovering over a filename.

But since a lot of the Shell API is exposed via COM, you might want to use that. See this excellent article for more info:

Automate the Active Windows Explorer or Internet Explorer Window[^]


我发现了一些东西,但我不知道如何使用



[ComImport]

[Guid(00021500-0000-0000-C000-000000000046)]

[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]

公共接口IQueryInfo

{

[PreserveSig]

void GetInfoTip(int dwFlags,out IntPtr ppwszTip);



[PreserveSig]

无效GetInfoFlags(IntPtr pdwFlags);

}



但我不确定这是否归来无效?所以我怎么能理解
i found something but i dont undetstand how can i use

[ComImport]
[Guid("00021500-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IQueryInfo
{
[PreserveSig]
void GetInfoTip(int dwFlags, out IntPtr ppwszTip);

[PreserveSig]
void GetInfoFlags(IntPtr pdwFlags);
}

but i am not sure this returns void ? so how can i get i didn't understand


这篇关于鼠标悬停获取文件路径Windows资源管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆