How to generate a manifest file for VS 2017 for a c++ project and be sure its working?

浪尽此生 提交于 2020-03-04 05:52:13

问题


I've been looking around trying to figure out how to generate a manifest file for a c++ application for VS2017. I've seen some stuff for VS2010, and the only thing I've seen for VS2017 is this page on the MS site. However, actually generating the file wasn't clear. So what I did was:

  1. Go to project properties
  2. Go to Configuration Properties > Manifest Tool > Embed Manifest and set it to No.
  3. Apply and build.

I now have an external file named filename.exe.manifest next to my filename.exe. I then added the following bold and italic info to the manifest which I got from disableWindowFiltering on the MS site (unfortunately, not a direct link as there are no anchors on the page):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"

  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2011/WindowsSettings">
      <disableWindowFiltering>true</disableWindowFiltering>
    </asmv3:windowsSettings>
  </asmv3:application>

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

Once done, I executed the application. It didn't seem to change the results. I still couldn't enumerate all of the windows using EnumWindows() and EnumChildWindows(). The process is also running under admin rights too.

Did I do something wrong?

来源:https://stackoverflow.com/questions/53330015/how-to-generate-a-manifest-file-for-vs-2017-for-a-c-project-and-be-sure-its-wo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!