delphi编写系统服务:为Delphi编写的屏幕保护程序增加描述

虽说屏幕保护只是个相对特殊exe(会接受/C、/P、/S等启动参数具体可见诸多博文在此不赘述)但是却让个小小描述卡住了

我们知道作为屏幕保护安装后会在系统“显示”对话框列表里出现而进而我们发现现有屏幕保护显示并不是文件名而是行描述而使用Delphi编写exe却无法具备这个特性

向搜索引擎寻求帮助后得到了如下描述:

You can the text that will appear in the Control Panel Desktop list of screen savers by adding a {$D text} directive to the project source file. The $D directive inserts the given text o the module description entry of the executable file. For the Control Panel to recognize the text you must start with the term "SCRNSAVE", followed by your description.

Select Project Source from the Delphi View menu so you can edit the source file. Beneath the directive "{$R *.RES}", add the following line:

{$D SCRNSAVE Spheres Screen Saver}The text "Spheres Screen Saver" will appear in the Control Panel list of available screen savers when we complete the project.



(http://burks.brighton.ac.uk/burks/language/pascal/uddf/pages/scrnsave.htm)



大意是在dpr文件中写入{$D SCRNSAVE [要显示描述]}就可以在编译的后exe内加入屏幕保护描述

而就是这个仅有介绍说明(貌似疯狂转载并不是好事连已经无效思路方法都被这样流传着)让我走了很多弯路以这个介绍说明为前提我险些否定了自己工作

直到天研究无果后我决定另辟蹊径既然里面说了是那么估计应该在内能找到

于是我将系统内置屏幕保护用eXeScope打开赫然发现了新大陆:

串节点下key为1值就是SCRNSAVE +空格+屏幕保护描述

那么那个{$D text}是什么呢?进而通过仔细查询发现这个关键字是生成应用描述而非串资源(找到这个介绍说明后才猛然醒悟为啥不深究下这个$D呢都怪自己太不自信了)

既然知道了描述规则那就动手搞定

新建个.rc文件设置如下格式:



table
begin
1, "SCRNSAVE [要显示描述串]"
End
Tags:  delphi编写远控教程 delphi编写注册 delphi编写远控 delphi编写系统服务

延伸阅读

最新评论

发表评论