Giving application elevated UAC

后端 未结 4 1769
时光取名叫无心
时光取名叫无心 2020-11-27 07:42

I have an application which needs the UAC elevation.

I have the code which lets me give that but the application opens twice.. which is the issue..

so here i

4条回答
  •  执笔经年
    2020-11-27 08:27

    You don't need to meddle with all that to make sure that your application always runs with elevated privileges. You can simply add an application manifest which instructs Windows to run your app elevated, and the UAC prompt will appear without you needing to write a single line of code.

    There's a related question with an answer that also describes how to add a manifest here: How can I embed an application manifest into an application using VS2008?

提交回复
热议问题