两个问题:C语言中WinExec函数具体用法和auturun.inf文件的使用方法!

1.C语言中WinExec函数的具体的用法是什么?里面有几个参数?为什么我怎么启动不了程序?还有,如果以SW_SHOWMAXIMIZED为参数的话.我在启动一个CMD程序... 1.C语言中WinExec函数的具体的用法是什么?
里面有几个参数?为什么我怎么启动不了程序?
还有,如果以SW_SHOWMAXIMIZED为参数的话.我在启动一个CMD程序.会不会全屏显示?那启动QQ呢??

举个具体的例子,最好参数都用上

2.autorun.inf是引导文件,我想放在D盘下,当打开D盘时,启动一个程序,用[autorun]OPEN=123.EXE,为何启动不了?文件名无错,还有如何改变D盘标卷的图标?
具个具体的例子!

谢谢!
知道的回答一个问题也行~~!!!!
分不是问题!来人~~
展开
 我来答
wind556
2011-07-18 · TA获得超过250个赞
知道小有建树答主
回答量:673
采纳率:50%
帮助的人:274万
展开全部
WinExec
The WinExec function runs the specified application.

This function is provided for compatibility with 16-bit Windows. Win32-based applications should use the CreateProcess function.

UINT WinExec(
LPCSTR lpCmdLine, // address of command line
UINT uCmdShow // window style for new application
);

Parameters
lpCmdLine
Pointer to a null-terminated character string that contains the command line (filename plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, the system searches for the executable file in this sequence:
The directory from which the application loaded.
The current directory.
The Windows system directory. TheGetSystemDirectory function retrieves the path of this directory.
The Windows directory. TheGetWindowsDirectory function retrieves the path of this directory.
The directories listed in the PATH environment variable.
uCmdShow
Specifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of theShowWindow function. For a non-Windows – based application, the PIF file, if any, for the application determines the window state.
Return Values
If the function succeeds, the return value is greater than 31.
更多追问追答
追问
大哥,咱别来全英文的么?
追答
这可是MSDN里的原版说明···适用于16位窗口程序···32位的你要创建进程··虽然不知道你想干啥  但是我隐隐约约的明白你貌似要调用外部程序  给你推荐个函数吧HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);

这个比较好用
还是给你举个例子吧 ShellExecute(NULL,"open","calc.exe",NULL,NULL,SW_SHOWNORMAL); 运行计算器的 记得给分啊
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式