python.exe.manifest是在win8中使pywinauto访问metro风格的应用程序的正确方法吗?

时间:2013-11-12 04:20:51

标签: microsoft-metro python-2.6 pywinauto

我正在尝试使用Python 2.6中的pywinauto枚举和自动化Windows 8.1中的metro风格应用程序。 如果我使用Windows Kit中的inspect.exe获取HWND,然后将其传递给pywinauto.handleprops.process_id(),我就能获得正确的进程ID。

但是,如果我使用pywinauto.findwindows.enum_windows(),我没有看到在那里列出的inspect.exe的特定HWND。我怀疑原因可能与UAC / UIPI有关,因为c:\ python26 \ python.exe没有清单。我是对的吗?

我尝试通过放下python.exe.manifest和pythonw.exe.manifest来解决:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
    name="*.*.*"
    processorArchitecture="x86"
    version="1.0.0.0"
    type="win32"/>
  <description>*</description>
  <dependency>
      <dependentAssembly>
          <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"/>
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
      <security>
          <requestedPrivileges>
              <requestedExecutionLevel level="highestAvailable" uiAccess="true"/>
          </requestedPrivileges>
      </security>
  </trustInfo>
</assembly>

但它似乎没有帮助。我甚至不认为UAC高程发生,因为没有出现UAC提示。无论如何,inspect.exe.manifest使用<requestedExecutionLevel level="asInvoker" uiAccess="true"/>

有没有人有更好的建议我该怎么办?

0 个答案:

没有答案
相关问题