Fork me on GitHub

delphi XE5 程序“以管理员身份运行”

用一句话概括我十分钟前的心里,那就是:

  I tried this (Application run as Administrator Programmatically ) from 2 months But to no avail ...

问题描述:

  1.这个地址的方法,在我的程序中不生效,http://www.cnblogs.com/mumble/p/3382305.html

  2.我利用上面地址的uac.manifest文件,设置Project - Option - application -Runtime Themes为“use custom manifest ”,然后Custom Manifest使用 uac.manifest文件,是生效的。

  3.“Enable runtime themes”主题涉及到 TButton.ImageIndex的显示,必须使用,所以又不能仅仅使用2的方法解决。

 

 

新创建的工程 默认情况, Project - Option - application -Runtime Themes是”Enable runtime themes“,这个意思是说:应用程序默认使用“{XE_installedPath}\bin\default_app.manifest”文件作为主题。

于是,把default_app.manifest文件拷贝一份到当前工程的目录,修改里面的level="asInvoker" 为 level="requireAdministrator",问题解决。。。

 

posted @ 2015-07-29 19:45  aoiue  阅读(976)  评论(0)    收藏  举报
Fork me on GitHub