CreateProcess 和 ShellExecute 的区别 [英] CreateProcess and ShellExecute differences

查看:43
本文介绍了CreateProcess 和 ShellExecute 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两者的主要区别是什么?我愿意从我的(C++)应用程序中只运行另一个 EXE.在继承环境、安全特性等方面有什么不同吗?

What are the main differences between the two? I'm willing to run only another EXE from my (C++) application. Are there any differences when inheriting environments, security features etc?

推荐答案

CreateProcessShellExecute 的主要区别如下: CreateProcess更面向低级别,ShellExec 位于高用户级别,可以在资源管理器中看到用户.

The main difference between CreateProcess and ShellExecute is the following: CreateProcess is more oriented on low level and ShellExec on the high user lever which see the user in explorer.

例如使用CreateProcess 可以使用长度大于MAX_PATH 的命令行.它有 32,768 个字符的限制.您还可以使用 CreateProcess 在另一个 Windows 桌面(如登录屏幕)上启动程序(如果您有足够的权限).

For example using of CreateProcess one can use command line which length is more as MAX_PATH. It has 32,768 characters restriction. You can also use CreateProcess to start program (if you have enough permissions) on another windows desktop like on the Logon Screen.

另一个例子.您可以使用 ShellExecute 来启动控制面板或打开计算机上存在的任何程序来编辑 JPG 文件.因此,您可以使用 ShellExecute 接近 Windows 资源管理器中的相应操作.

Another example. You can use ShellExecute to start Control Panel or open any program which existed on the computer for editing of JPG filed for example. So you works with ShellExecute close to the corresponding actions in the Windows Explorer.

这篇关于CreateProcess 和 ShellExecute 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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