API函数中ShellExecute里第五个参数lpDirectory实际作用

来源:百度知道 编辑:UC知道 时间:2024/06/01 03:27:47
API函数中ShellExecute里的lpDirectory参数解释是"指向默认目录",大都说通常将其设置为NULL即可,我想问的是,这个参数的作用何在,微软不可能弄一个完全无作用的参数在里边吧.其存在的意义究竟是什么呢.

MSDN

lpDirectory
[in] A pointer to a null-terminated string that specifies the default (working) directory for the action. If this value is NULL, the current working directory is used. If a relative path is provided at lpFile, do not use a relative path for lpDirectory

如果为NULL,当前目录为工作目录,
如果不为NULL,lpDirectory为工作目录。

工作目录的意思,lpFile如果为现对路径,则在工作目录开始找lpFile。