17 #include <sys/types.h>
27 const unsigned int pid = _getpid();
29 const unsigned int pid = getpid();
41 HANDLE handle = OpenProcess(
47 if ( (HANDLE)
NULL != handle )
51 if ( GetLastError( ) == ERROR_ACCESS_DENIED )
57 if( handle !=
NULL ) {
58 CloseHandle( handle );
62 if( kill( pid, 0 ) == 0 ) {
bool processexists(const unsigned int pid)
judges whether specified process is exists or not.
unsigned int getprocessid()
gets procsess ID