开发者

Is it possible to add a version number to a file that will be visible in Properties/Details in windows explorer

I have an unmanaged C++ project where I am writing data to a custom file format that I have defined.

What I would like to know is if there is a way to add a he开发者_如何学Goader that is compatible with Windows Explorer so that a version number will be displayed, as in the example below showing a Windows font.

Is it possible to add a version number to a file that will be visible in Properties/Details in windows explorer

The purpose of this is so that non-tech savvy users could simply right click and identify the version of the file, without having to open it in Notepad etc.

Any help would be appreciated.

Tom


You cannot achieve this for a file in general. But if your file format stores a version information, you can teach the Windows Explorer to display it.

You have to write a Shell Extension for the Explorer, that can extract arbitrary information out of your files. This extension must be installed on the target computer and registered in the registry.

An excellent guide on how to write and register Shell Extensions can be found here on CodeProject. (Part VIII should cover what you need)


The version information comes from VERSIONINFO resource, attached to a binary file, such as .EXE or .DLL. So it is easy to link such resource into your build target, this resource is also editable.

However, this is limited to the binary executable files, and you cannot attach this resource information to arbitrary files (as you wanted), including such as text files.


In VC just go to menu Project->AddResource and pick Version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜