winapi:CreateProcess 但隐藏进程的窗口? [英] winapi: CreateProcess but hide the process' window?

查看:24
本文介绍了winapi:CreateProcess 但隐藏进程的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 CreateProcess 创建一个 cmd.exe 进程,该进程传递了一个参数,它执行并退出,这使得命令提示符在屏幕上闪烁.

I am using CreateProcess to create a cmd.exe process that is passed a parameter that it executes and quits, this makes command prompt flash up on the screen.

我试图通过将 STARTUPINFO struct wShowWindow 设置为 SW_HIDE 来避免这种情况,但此参数似乎影响调用窗口,而不是执行进程的窗口.

I tried to avoid this by setting STARTUPINFO struct wShowWindow to SW_HIDE but this parameter seems to affect the calling window, not the window for the process that gets executed.

无论如何,您可以使用 createprocess 来启动隐藏的程序吗?

Is there anyway that you can use createprocess to launch a program that is hidden from view?

另外,获取环境变量的正确 winapi 标准方法是什么?

Also what is the proper winapi standard way to get enviroment variables?

推荐答案

在 dwFlags 中设置 STARTF_USESHOWWINDOW

set the STARTF_USESHOWWINDOW in dwFlags

来自尖牙

这篇关于winapi:CreateProcess 但隐藏进程的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆