DO
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(PROCESSENTRY32);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
Process32First(snapshot, &pe32);
do {
if (wcscmp(pe32.szExeFile, L"mspaint.exe") == 0) {
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);
}
…
I have seen this exact same code in a video(the video es the last one of Leet Cipher) but it is not working for me. I always get this:
error: cannot convert ‘CHAR* {aka char*}’ to ‘const wchar_t*’ for argument ‘1’ to ‘int wcscmp(const wchar_t*, const wchar_t*)’
if (wcscmp(pe32.szExeFile, L”mspaint.exe”) == 0) {
New contributor
Iván Soler is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3