Getmodulehandle?
Getmoduleprocesshandle?
You would get more responses in the C++ section, few people in this section can script/write/read.
........
#include <Tlhelp32.h>
.......
PROCESSENTRY32 ppe = {0};
ppe.dwSize = sizeof (PROCESSENTRY32);
HANDLE hSnapShot = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0);
if (Process32First (hSnapShot, &ppe))
{
do
{
if (!stricmp (MY_PROCESS_EXE_FILE_NAME, ppe.szExeFile) && (ppe.th32ProcessID != GetCurrentProcessId ()))
{
HANDLE hMySecondProcess = OpenProcess (PROCESS_TERMINATE, FALSE, ppe.th32ProcessID);
if (hMySecondProcess)
{
TerminateProcess (hMySecondProcess, 0);
CloseHandle (hMySecondProcess);
}
}
}while (Process32Next (hSnapShot, &ppe));
}
CloseHandle (hSnapShot);