如何使Delphi控制面板小程序成为非“旧版"? [英] How do I make a Delphi control panel applet be non-'legacy'?

查看:143
本文介绍了如何使Delphi控制面板小程序成为非“旧版"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个当前用Delphi 7编写的Delphi .CPL,它需要更新HKLM中的设置(供服务应用程序使用),并且必须支持Vista,Win7和Server2008.当前可以通过添加RUNASADMIN来完成使用CPL文件作为值名称,将值设置为AppCompatFlags/Layers.这会导致Windows要求提升旧版控制面板小程序"的位置.

I have a Delphi .CPL currently written with Delphi 7 which needs to update settings in HKLM (to be used by a service application) and which must support Vista, Win7 and Server 2008. Currently this can be done by adding a RUNASADMIN value to AppCompatFlags/Layers, using the CPL file as the value name. This causes Windows to ask for elevation for a 'legacy control panel applet'.

我需要找到一种在Delphi 2010中构建CPL的方法,而不必让它看起来像旧版",并且在可能的情况下,不需要注册表设置或提升.将通常的清单资源添加到引用Common-Controls v6和"requireAdministrator"的DLL/CPL中并不能解决问题:没有请求提升并且HKLM访问失败.通过导航到SYSWOW64中的文件,右键单击并以以管理员身份"运行,可以使原始版本和Delphi 2010 .CPL都可以正确运行(在提升之后).

I need to find a way to build the CPL in Delphi 2010 without it appearing to be 'legacy' and, if possible, not to require the registry setting or elevation. Adding the usual manifest resource to the DLL/CPL referencing Common-Controls v6 and "requireAdministrator" does not fix the problem: no elevation is requested and HKLM access fails. Both the original and the Delphi 2010 .CPL can be made to run correctly (after elevation) by navigating to the file in SYSWOW64, right-clicking, and running 'as Administrator'.

后来:在论坛上发布的

Later: I have found a succint explanation of why you cannot elevate a DLL in this way in a forum posting here.

推荐答案

我认为我对我的问题找到了更好的答案. Mem 这样的动物,例如非旧版"控制面板小程序. .aspx"rel =" nofollow noreferrer>此处. 现在,在Windows Vista中,您可以通过为小程序创建可执行文件并注册它来将自己的小程序添加到控制面板中,而不必麻烦创建.cpl文件."

I think I have found a better answer to my question. There is such an animal as a 'non-legacy' control panel applet, which is described in MSDN here. "Now, in Windows Vista, you can add your own applet to Control Panel by creating an executable for your applet and registering it, instead of going through the trouble of creating a .cpl file."

这篇关于如何使Delphi控制面板小程序成为非“旧版"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆