分类：电脑/网络-软件
问题：VFP如何判断一个程序是否运行如：判断C：/1.txt是否被打开 
VFP如何判断一个是否运行如：判断C：/1.txt是否被打开
回答：void  WaExec(char  *  lpCommLin)  {             PROCESS_INFORMATION  ProcInfo;             LPSTARTUPINFO  lpStartUp  =  new  STARTUPINFO;             memset(lpStartUp,0,sizeof(STARTUPINFO));             lpStartUp->cb  =  sizeof(STARTUPINFO);                                                  if(!CreateProcess(  NULL,lpCommLin,  NULL,  NULL,  FALSE,  NULL,  NULL,  NULL,  lpStartUp,                          &ProcInfo))             {                         DWORD  dwError  =  GetLastError();                         CString  temp;                                 temp.Format("错误代码:  %d",temp)                         AfxMessageBox(temp);                         exit(0);             }              if(WAIT_TIMEOUT  !=  WaitForSingleObject(ProcInfo.hProcess,INFINITE))               {                         if(ProcInfo.hThread  !=  0)                         {                                     CloseHandle(  ProcInfo.hThread);                         }                         if(ProcInfo.hProcess  !=  0)                         {                                     CloseHandle(ProcInfo.hProcess);                         }             }  }