mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-24 09:24:12 +08:00
22 lines
446 B
C++
22 lines
446 B
C++
|
// apiwin_p.cc
|
||
|
// 10/6/2012 jichi
|
||
|
#include "texthook/winapi_p.h"
|
||
|
#include <windows.h>
|
||
|
|
||
|
WINAPI_BEGIN_NAMESPACE
|
||
|
|
||
|
bool IsProcessActiveWithId(DWORD dwProcessId)
|
||
|
{
|
||
|
bool ret = false;
|
||
|
if (HANDLE hProc = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwProcessId)) {
|
||
|
DWORD dwExitCode;
|
||
|
ret = ::GetExitCodeProcess(hProc, &dwExitCode) && (dwExitCode == STILL_ACTIVE);
|
||
|
::CloseHandle(hProc);
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
WINAPI_END_NAMESPACE
|
||
|
|
||
|
// EOF
|