用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

Description of your first forum.

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子shenmingjie » 星期三, 2003年4月9日 20:40


求助!
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子zyb » 星期三, 2003年4月9日 20:47


在程序中用delete啊
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子张无忌 » 星期三, 2003年4月9日 20:49


用CreateProcess()然后用waitforsig****()
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子shenmingjie » 星期三, 2003年4月9日 20:53


可以给段小程序吗?如果用shellExecute打开c:\1.txt文件,在关闭他的时候就将他删掉!
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子LiChaoHui » 星期三, 2003年4月9日 21:11


不关闭就可以删掉了,对于文本文件来说
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子shenmingjie » 星期三, 2003年4月9日 21:32


我要处理的不光上文本,文本只是举个例子!
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子太阳火 » 星期三, 2003年4月9日 21:59


The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.

BOOL CreateProcess(

   LPCTSTR lpApplicationName, // pointer to name of executable module
   LPTSTR lpCommandLine, // pointer to command line string
   LPSECURITY_ATTRIBUTES lpProcessAttributes, // pointer to process security attributes
   LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to thread security attributes
   BOOL bInheritHandles, // handle inheritance flag
   DWORD dwCreationFlags, // creation flags
   LPVOID lpEnvironment, // pointer to new environment block
   LPCTSTR lpCurrentDirectory, // pointer to current directory name
   LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO
   LPPROCESS_INFORMATION lpProcessInformation // pointer to PROCESS_INFORMATION  
  );


Parameters

lpApplicationName

Pointer to a null-terminated string that specifies the module to execute.

The string can specify the full path and filename of the module to execute.
The string can specify a partial name. In that case, the function uses the current drive and current directory to complete the specification.
The lpApplicationName parameter can be NULL. In that case, the module name must be the first white space-delimited token in the lpCommandLine string.
The specified module can be a Win32-based application. It can be some other type of module (for example, MS-DOS or OS/2) if the appropriate subsystem is available on the local computer.

Windows NT: If the executable module is a 16-bit application, lpApplicationName should be NULL, and the string pointed to by lpCommandLine should specify the executable module. A 16-bit application is one that executes as a VDM or WOW process.  

lpCommandLine

Pointer to a null-terminated string that specifies the command line to execute.

The lpCommandLine parameter can be NULL. In that case, the function uses the string pointed to by lpApplicationName as the command line.
If both lpApplicationName and lpCommandLine are non-NULL, *lpApplicationName specifies the module to execute, and *
lpCommandLine specifies the command line. The new process can use GetCommandLine to retrieve the entire command line. C runtime processes can use the argc and argv arguments.

If lpApplicationName is NULL, the first white space-delimited token of the command line specifies the module name. If the filename does not contain an extension, .EXE is assumed. If the filename ends in a period (.) with no extension, or the filename contains a path, .EXE is not appended. If the filename does not contain a directory path, Windows searches for the executable file in the following sequence:

1. The directory from which the application loaded.
2. The current directory for the parent process.
3. Windows 95: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.

Windows NT: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32.

4. Windows NT: The 16-bit Windows system directory. There is no Win32 function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM.
5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
6. The directories that are listed in the PATH environment variable.



If the process to be created is an MS-DOS - based or Windows-based application, lpCommandLine should be a full command line in which the first element is the application name. Because this also works well for Win32-based applications, it is the most robust way to set lpCommandLine.

lpProcessAttributes

Pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpProcessAttributes is NULL, the handle cannot be inherited.

Windows NT: The lpSecurityDescriptor member of the structure specifi
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子fei鱼 » 星期五, 2003年10月3日 20:00


留个邮件地址发程序给你。
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子shenmingjie » 星期五, 2003年10月3日 20:06


shenmingjie80312@163.com
 
 
 

用shellExecute打开一个外部文件,怎样在这个外部文件关闭时将他删除?

帖子shenmingjie » 星期六, 2003年10月4日 18:45


接受答案了.