ZenoTest
ZenoTest — Windows desktop UI test automation for Qt, WPF, WinForms & native apps. Record, script, and run automated GUI tests with CI/CD integration.

GetProcessID

int GetProcessID(string executableName)

Description
Returns the process ID (PID) of a running process identified by its executable name.
The function searches through all running processes and returns the PID of the first match.
The comparison is case-insensitive.
If the process is not found, 0 is returned.

Parameter
- executableName - The name of the executable to search for (e.g. "notepad.exe").

Return
- int - The process ID of the found process, or 0 if no matching process was found.

Example
void main()
{
    int pid = GetProcessID("notepad.exe");
    if (pid != 0)
    {
        Print("Process found with PID: " + pid);
    }
}
#define #include abs Array ceil CloseAUT Console mode do...while DoubleClick DragAndDrop Execute Fail File floor for Format GetAUTFileVersion GetAUTProductVersion GetAUTQtVersion GetAUTSuspectedCompiler GetAUTSuspectedFramework GetClipboard GetCurrentDate GetCurrentTime GetCurrentWorkingDir GetEnv GetName GetProcessID GetProcessIDHandle GetQtProperty GetText GetTimestamp GetValue Handle HasFocus IsAUT64Bit IsChecked IsEnabled IsVisible LeftMouseClick LeftMouseDown LeftMouseUp max MiddleMouseClick MiddleMouseDown MiddleMouseUp min MouseMove MouseWheel Pass pow Predefined Constants Print rand Regex RegexMatch RightMouseClick RightMouseDown RightMouseUp round Script Language SendKeys SendMessage SetClipboard SetFocus SetGlobal SetQtProperty ShellProcess Sleep sqrt srand StartAUT string TerminateProcess TimerStart TimerStop TimerVerifyLess vec2d VerifyContains VerifyEmpty VerifyEndsWith VerifyEqual VerifyExists VerifyFalse VerifyGreater VerifyGreaterEqual VerifyLess VerifyLessEqual VerifyNotEqual VerifyNotExists VerifyScreenCompareEdgeBased VerifyScreenComparePixelExact VerifyStartsWith VerifyTrue WaitForControl WaitUntilEnabled WaitUntilVisible while