ShellExecute,WinExec 应用错误
#include<windows.h>
#include <iostream.h>
void main(int argc,char* argv[])
{
cout<<"Opening With WinExec\n";
if (WinExec("D:\Program Files\01.txt",SW_SHOW)<32)
{
MessageBox(NULL,"Can not WinExec",NULL,MB_OK);
}
cout<<"Opening With ShellExecute\n";
if (ShellExecute(NULL,"explore","D:\Program Files\01.txt",NULL,NULL,SW_SHOW)<(HANDLE)32)
{
MessageBox(NULL,"Can not ShellExecute\n",NULL,MB_OK);
}
}
我在D:\Program Files创建了 01.txt,但是ShellExecute,WinExec 都应用 错误,为什么啊?