Code:
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::Diagnostics;
using namespace System::ComponentModel;
int main() {
// Get all instances of Notepad running on computer.
Process* localByName[] = Process::GetProcessesByName(S"notepad");
What for() should I use there? I need to get the process ID, make a for loop then pass the process id in the following code:
Code:
DWORD dwProcess;
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, dwProcess);
TerminateProcess(hProcess, 1);
CloseHandle(hProcess);