创建一个填满一半屏幕的新进程

问题描述

我想从 python 脚本运行一个可执行文件,并让他填满屏幕的一半。我看到子进程无法设置新进程的位置或大小(即subprocess.Popen sets size and location of the external executed programme?)。我尝试使用 win32.createProcess method,但 startupinfo 似乎对过程没有影响。这是我的代码

StartupInfoBlender = win32process.STARTUPINFO()
StartupInfoBlender.dwFlags = (win32con.STARTF_USESTDHANDLES ^
              win32con.STARTF_USESHOWWINDOW)

StartupInfoBlender.dwX,StartupInfo.dwY = (width_screen/2,0)
StartupInfoBlender.dwFlags ^= win32con.STARTF_USEPOSITION

StartupInfoBlender.dwXSize,StartupInfo.dwYSize = (width_screen/2,height_screen)
StartupInfoBlender.dwFlags ^= win32con.STARTF_USESIZE

StartupInfoBlender.wShowWindow = 1
(hProcess,hThread,dwProcessId,dwThreadId) = win32process.CreateProcess(defaultPathBlender,None,win32process.norMAL_PRIORITY_CLASS,StartupInfoBlender)

如果你知道我的代码有什么问题,或者我可以用来做这件事的另一个 python 模块,请告诉我。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)