Сan't call "GetProcessByExeName"
DWORD GetProcessByExeName(wchar_t* ExeName)
{
PROCESSENTRY32W pe32;
pe32.dwSize = sizeof(PROCESSENTRY32W);
HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL);
if (hProcessSnap == INVALID_HANDLE_VALUE)
{
MessageBoxW(NULL, L"Error CreateToolhelp32Snapshot", L"error", MB_OK);
return false;
}
if (Process32FirstW(hProcessSnap, &pe32))
{
do
{
if (_wcsicmp(pe32.szExeFile, ExeName) == 0)
{
CloseHandle(hProcessSnap);
return pe32.th32ProcessID;
}
} while (Process32NextW(hProcessSnap, &pe32));
}
CloseHandle(hProcessSnap);
return 0;
}
By calling GetProcessByExeName(L"chrome.exe");
writes -> Argument of type "const wchar_t" * is incompatible with parameter of type "wchar_t"