Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1632772
  • 博文数量: 584
  • 博客积分: 13857
  • 博客等级: 上将
  • 技术积分: 11883
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-16 09:34

分类: Windows平台

2013-01-16 10:49:32

解决方案一
转载 
解决方案二

VS2008前的版本需要添加一个manifest文件,内容如下:

xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    
version="1.0.0.0"
    processorArchitecture
="X86"
    name
="mulitray.exe.manifest"
    type
="win32"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    
<security>
        
<requestedPrivileges>
            
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
        
requestedPrivileges>
    
security>
trustInfo>
assembly>

 

保存为UAC.manifest,在rc文件中添加以下内容

1 24 "UAC.manifest"

 

(VS2005可能会报错,在rc上清除以上代码,使用项目属性添加的方法项目属性->manifest tool->input and output)

 

VS2008中就相对简单的多了,只需要动手选择一下就行,项目属性->配置属性->连接器->manifest file : 将UAC Execution Level勾选为requireAdministrator



解决方案三
在pro文件中添加

QMAKE_LFLAGS += /MANIFESTUAC:"level='requireAdministrator'uiAccess='false'"
阅读(4530) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~