|
Тема |
Re: Стартиране на външен файл [re: lvan] |
|
Автор |
SDR (TaskMaster) |
|
Публикувано | 21.10.02 11:27 |
|
|
CreateProcess
The CreateProcess function creates a new process and its primary thread. The new process runs the specified executable file.
...
BOOL CreateProcess(
LPCTSTR lpApplicationName, // name of executable module
LPTSTR lpCommandLine, // command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
BOOL bInheritHandles, // handle inheritance option
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // new environment block
LPCTSTR lpCurrentDirectory, // current directory name
LPSTARTUPINFO lpStartupInfo, // startup information
LPPROCESS_INFORMATION lpProcessInformation // process information
);
...
The process is assigned a process identifier. The identifier is valid until the process terminates. It can be used to identify the process, or specified in the OpenProcess function to open a handle to the process. The initial thread in the process is also assigned a thread identifier. The identifier is valid until the thread terminates and can be used to uniquely identify the thread within the system. These identifiers are returned in the PROCESS_INFORMATION structure
--------------------------
The WaitForSingleObject function returns when one of the following occurs:
The specified object is in the signaled state.
The time-out interval elapses.
To enter an alertable wait state, use the WaitForSingleObjectEx function. To wait for multiple objects, use the WaitForMultipleObjects.
DWORD WaitForSingleObject(
HANDLE hHandle, // handle to object
DWORD dwMilliseconds // time-out interval
);
...
The WaitForSingleObject function can wait for the following objects:
Change notification
Console input
Event
Job
Mutex
Process
Semaphore
Thread
Waitable timer
A Chestito! i priqtno kodirane
------------------------------
I got a COMPILER, and I'm not afraid to use it!
|
| |
|
|
|