steam_helper.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PyCloudGameSaving 作者: sd12582000 项目源码 文件源码
def find_current_steam_game_pid():
    """
    find current play game process id with GameOverlayUI.exe
    if not find return -1
    """
    target_pid = -1
    for proc in psutil.process_iter():
        try:
            if proc.name() == 'GameOverlayUI.exe':
                cmds = proc.cmdline()
                for index, arg in enumerate(cmds):
                    if arg == '-pid':
                        target_pid = int(cmds[index+1])
                        break
                break
        except psutil.AccessDenied:
            print("Permission error or access denied on process")
    return target_pid
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号