c# - 如何控制下拉列表中显示的屏保名称?

标签 c# .net windows screensaver

我有一个可用的屏幕保护程序,我想弄清楚如何控制 Windows 在屏幕保护程序下拉列表中显示的名称。目前这一切似乎都基于文件名,但我知道事实并非如此。这是我尝试过的方法和结果:

文件名:CC.Votd.scr 屏幕保护程序名称:Cc

文件名:CC Votd.scr 屏幕保护程序名称:Cc Votd

我想将文件命名为 CC.Votd.scr 并将屏幕保护程序名称显示为 CC.Votd(大写对我来说很重要,所以即使CC Votd 没问题:-))

我很确定这是可能的,因为 Photos 屏幕保护程序是 PhotoScreensaver.scr

预先感谢您的帮助。

最佳答案

这个线程有答案:

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/35ea8aeb-e729-474c-b6d2-544fc3c48d8d

I figured out I needed that String Table, I just didn't know how to add that native resource to my assembly. To add this String Table, I had to convert my VS2003 solution to a VS2005 solution, because VS2003 doesn't allow to add native resources to your project. Below you'll find a modified (by me) copy of what you pointed me to. How to add a nice looking title to your screen saver (The one that comes up in the dropdown list on the Screen Saver tab in Display Properties) original source: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=77460&SiteID=1 modified steps:
1. In Visual Studio, choose File -> New -> File
2. Under the General node, select Native Resource Template and click Open
3. In the Designer window, right-click the ResTempl1.rct node and click Add Resource
4. In the Add Resource dialog, select String Table and click New
5. Modify the first record so it has the following values: ID: , Value: 1, Caption: My Screen Saver Title
6. Choose File -> Save As, change Save as type to 32-bit Resource File and save the file to a location that you will remember
7. In Solution Explorer, right-click the Project node you want to change the Product Version of and click Properties
8. In the Application tab, check Resource File and click ...
9. Browse to the native resource file you created above and click OK
10. Rebuild your project

Your assembly should now reflect the values contained in the resource file. Note: If you had an Icon in your application, you'll now have to add this manually to the native resource file. This is because the Project Properties allow you to either choose "Icon" or "Resource File", not both. So to add an Icon to your application, add it to the just created native Resource File, just like you added the String Table.

关于c# - 如何控制下拉列表中显示的屏保名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2218976/

相关文章:

c# - 泛型如何影响 C# 和 .NET 的设计?

C#、WPF - OpenFileDialog 不出现

c# - 为什么这个语法 List.Add(item);{//some code }

.net - 设置页面标题不起作用

node.js - 从 Windows 命令行运行 tsc

c++ - 实现线程锁时真的需要原子性吗?

c# - 如何使 Unity 单例基类支持泛型?

asp.net - 如何防止网页上的 CSS 缓存?

c# - ASP.Net MVC 2.0 : EditorFor setting name via attributes

linux - 如何启动hadoop中的所有守护进程 - 就像linux中的start-all.sh