ZenoTest
ZenoTest is a lightweight and powerful tool for Windows desktop UI test automation. Record, generate, and run automated tests efficiently for WPF, WinForms, and native apps.

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);
    }
}
#include CloseAUT Console mode do...while DoubleClick Execute Fail File for GetAUTFileVersion GetAUTProductVersion GetAUTQtVersion GetAUTSuspectedCompiler GetAUTSuspectedFramework GetCurrentWorkingDir GetName GetProcessID GetProcessIDHandle GetQtProperty GetText GetValue Handle HasFocus IsAUT64Bit IsChecked IsEnabled IsVisible LeftMouseClick LeftMouseDown LeftMouseUp MiddleMouseDown MiddleMouseUp MouseWheel Pass Predefined Constants Print RightMouseClick RightMouseDown RightMouseUp Script Language SendKeys SendMessage SetFocus SetQtProperty ShellProcess Sleep StartAUT string TerminateProcess TimerStart TimerStop TimerVerifyLess vec2d VerifyContains VerifyEndsWith VerifyEqual VerifyExists VerifyGreater VerifyLess VerifyNotEqual VerifyNotExists VerifyScreenCompareEdgeBased VerifyScreenComparePixelExact VerifyStartsWith while