最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

windows shell - How to customize the file open behavior for a specific file type? - Stack Overflow

programmeradmin0浏览0评论

I am using windows cloud file API () to create some local placeholder files to represent the data from cloud. For most of the normal files, it works well that it can be hydrated automatically when users double click them. However, for some specific file types, users do not want them to be downloaded and they can only be viewed only.

So this is what I want to achieve:

  1. When the user double click this kind of placeholder file or right click to choose open in context menu, I need to skip the hydration of this file. Instead, I need to open web browser and go to a specific website.
  2. When the user right click this kind of placeholder files and choose "Always keep it in device", it needs to pop up the Not supported dialog saying this operation is not supported.
  3. When the user double click other files, they can be hydrated and opened by Windows OS.

It looks like the difficult part is how to differentiate the file opening and "Always keep it in device" as both of them requires the files to be hydrated first. I have tried to hook up CF_CALLBACK_TYPE_FETCH_DATA event of these placeholder files and returned Not Supported for this specific kind of file. But the result is not good as the "Not supported" error also showed up when I double click it.

发布评论

评论列表(0)

  1. 暂无评论