有什么方法可以在没有命令外壳的情况下立即运行Python脚本?用“ .pyw”扩展名命名我的文件不起作用。
编辑:ShellExecute()解决的问题
使用ShellExecuteEx函数。
BOOL ShellExecuteEx(
_Inout_ SHELLEXECUTEINFO *pExecInfo
);
这是pExecInfo:*** nShow-用于指定在打开应用程序时如何显示应用程序的标志
typedef struct _SHELLEXECUTEINFO {
DWORD cbSize;
ULONG fMask;
HWND hwnd;
LPCTSTR lpVerb;
LPCTSTR lpFile;
LPCTSTR lpParameters;
LPCTSTR lpDirectory;
int nShow;/*=0 if you don't want the console window to appear*/
HINSTANCE hInstApp;
LPVOID lpIDList;
LPCTSTR lpClass;
HKEY hkeyClass;
DWORD dwHotKey;
union {
HANDLE hIcon;
HANDLE hMonitor;
} DUMMYUNIONNAME;
HANDLE hProcess;
} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句