1. 최초 커밋
This commit is contained in:
32
KeyHookForCapture/Utility.cpp
Normal file
32
KeyHookForCapture/Utility.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "stdafx.h"
|
||||
#include "Utility.h"
|
||||
|
||||
//------------------------------------------
|
||||
// <20><><EFBFBD>ڷ<EFBFBD> <20><><EFBFBD><EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD>μ<EFBFBD><CEBC><EFBFBD><EFBFBD><EFBFBD> ã<>´<EFBFBD>
|
||||
//------------------------------------------
|
||||
DWORD FindProcessID( LPCTSTR szProcessName )
|
||||
{
|
||||
DWORD dwPID = 0xFFFFFFFF;
|
||||
HANDLE hSnapShot = INVALID_HANDLE_VALUE;
|
||||
PROCESSENTRY32 pe;
|
||||
|
||||
// Get the snapshot of the system
|
||||
pe.dwSize = sizeof( PROCESSENTRY32 );
|
||||
hSnapShot = CreateToolhelp32Snapshot( TH32CS_SNAPALL, NULL );
|
||||
|
||||
// find process
|
||||
Process32First(hSnapShot, &pe);
|
||||
do
|
||||
{
|
||||
if(!_stricmp(szProcessName, pe.szExeFile))
|
||||
{
|
||||
dwPID = pe.th32ProcessID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while( Process32Next(hSnapShot, &pe ) );
|
||||
|
||||
CloseHandle(hSnapShot);
|
||||
|
||||
return dwPID;
|
||||
}
|
Reference in New Issue
Block a user