首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

一次性打开多个文件的疑问。该怎么解决

2012-02-09 
一次性打开多个文件的疑问。环境:我已经实现了文件关联。如:*.xyz 用自己写的程序abc.exe打开。这个时候我想

一次性打开多个文件的疑问。
环境:

  我已经实现了文件关联。如:*.xyz 用自己写的程序abc.exe打开。

这个时候我想得到这样的效果。

比如在文件夹中同时选中多个 *.xyz文件 按下回车。

怎么把选中的这么多个*.xyz文件列表传递给abc.exe让他来打开呢?

能给个例子,或者是给个代码吗?先谢谢高手了。

[解决办法]
还有一种方法是,做个ShellHook(JCL有个控件TjvShellHook,可直接放在你的程序中),监听消息。
具体消息类型参考:http://msdn.microsoft.com/en-us/library/bb774198(v=vs.85).aspx
其中有关文件操作的相关消息如下:
FM_GETFILESEL
 Sent by a File Manager extension to retrieve information about a selected file from the active File Manager window (either the directory window or the Search Results window).
 
FM_GETFILESELLFN
 Sent by a File Manager extension to retrieve information about a selected file from the active File Manager window (either the directory window or the Search Results window). The selected file can have a long file name.
 
FM_GETFOCUS
 Sent by a File Manager extension to retrieve the type of File Manager window that has the input focus.
 
FM_GETSELCOUNT
 Sent by a File Manager extension to retrieve a count of the selected files in the active File Manager window (either the directory window or the Search Results window).
 
FM_GETSELCOUNTLFN
 Sent by a File Manager extension to retrieve the number of selected files in the active File Manager window (either the directory window or the Search Results window). The count includes files that have long file names.
 

热点排行