MCPcopy Create free account
hub / github.com/benkuper/Chataigne / getRunningProcesses

Method getRunningProcesses

Source/Module/modules/system/os/OSModule.cpp:439–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439StringArray OSModule::getRunningProcesses()
440{
441 StringArray result;
442
443#if OS_SYSINFO_SUPPORT
444
445#if JUCE_WINDOWS
446 HANDLE hProcessSnap;
447 PROCESSENTRY32 pe32;
448 hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
449
450 if (hProcessSnap == INVALID_HANDLE_VALUE) {
451 LOGERROR("OS List process : Invalid handle value");
452 }
453 else {
454 pe32.dwSize = sizeof(PROCESSENTRY32);
455 if (Process32First(hProcessSnap, &pe32)) {
456 result.add(pe32.szExeFile);
457 while (Process32Next(hProcessSnap, &pe32)) result.add(pe32.szExeFile);
458 }
459 }
460 // clean the snapshot object
461 CloseHandle(hProcessSnap);
462#elif JUCE_MAC
463#elif JUCE_LINUX
464#endif
465
466#endif
467
468 return result;
469}
470
471void OSModule::timerCallback(int timerID)
472{

Callers 1

Calls 1

addMethod · 0.45

Tested by

no test coverage detected