Get process id of a running metro app

前端 未结 4 1942
遇见更好的自我
遇见更好的自我 2021-01-25 23:01

I want to get the process id of a running Metro app programatically via C++ code, from another process. I have the static information of that app like name, full name etc. What

相关标签:
4条回答
  • 2021-01-25 23:26

    Use GetForegroundWindow to get current active window, after that use GetWindowThreadProcessId to get PID of current window, then valid if is a WindowsStore app with IsImmersiveProcess, then GetPackageId to get app package info, like package name, version...

    0 讨论(0)
  • 2021-01-25 23:34

    You could use GetPackageId and GetPackagePath and then read info about app from AppxManifest.xml

    0 讨论(0)
  • 2021-01-25 23:38

    You want to call GetApplicationUserModelId on each WWAHost process.

    The sample application provided allows you to pass in a PID and get back the information about the app. For instance:

    C:\src\GetAppInfo\Debug>GetAppInfo.exe 7400
    Process 7400 (handle=00000044)
    Microsoft.BingWeather_8wekyb3d8bbwe!App
    
    0 讨论(0)
  • 2021-01-25 23:38

    You can use GetCurrentProcessId to get process id.

    0 讨论(0)
提交回复
热议问题