Если нужно узнать является ли второй процесс дочерним первому, то сделать это можно так:
Код:

$aChilds_IDs = _ProcessGetChildren("приложение.exe")
If Not @error And $aChilds_IDs[0][0] >= 1 Then
Exit 2
Else
Run("1234.exe")
EndIf
;===================================================================================================
; Function Name: _ProcessGetChildren()
;
; Description: Retrieve an array of all top level child processes
;
; Parameter(s): $i_pid: The process identifier of the process you want to list the child
; processes from
;
; Return Value(s):
; On Success:
; 2 dimensional array:
; [0][0] number of child processes found
; [n][0] is the process id of the child
; [n][1] is the process name of the child
;
; On Failure:
; Non array
;
; @Error:
; (1): CreateToolhelp32Snapshot failed
; (2): Process32First failed
; (3): No children processes found
;
; Remark(s): Tested on Windows XP SP2
;
; Author(s): SmOke_N (Ron Nielsen)
;
;===================================================================================================
Func _ProcessGetChildren($i_Pid) ; First level children processes only
If IsString($i_Pid) Then $i_Pid = ProcessExists($i_Pid)
If Not $i_Pid Then Return SetError(-1, 0, $i_Pid)
Local Const $TH32CS_SNAPPROCESS = 0x00000002
Local $a_tool_help = DllCall("Kernel32.dll", "long", "CreateToolhelp32Snapshot", "int", $TH32CS_SNAPPROCESS, "int", 0)
If IsArray($a_tool_help) = 0 Or $a_tool_help[0] = -1 Then Return SetError(1, 0, $i_Pid)
Local $tagPROCESSENTRY32 = _
DllStructCreate( _
"dword dwsize;" & _
"dword cntUsage;" & _
"dword th32ProcessID;" & _
"uint th32DefaultHeapID;" & _
"dword th32ModuleID;" & _
"dword cntThreads;" & _
"dword th32ParentProcessID;" & _
"long pcPriClassBase;" & _
"dword dwFlags;" & _
"char szExeFile[260]")
DllStructSetData($tagPROCESSENTRY32, 1, DllStructGetSize($tagPROCESSENTRY32))
Local $p_PROCESSENTRY32 = DllStructGetPtr($tagPROCESSENTRY32)
Local $a_pfirst = DllCall("Kernel32.dll", "int", "Process32First", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32)
If IsArray($a_pfirst) = 0 Then Return SetError(2, 0, $i_Pid)
Local $a_pnext, $a_children[11][2] = [[10]], $i_child_pid, $i_parent_pid, $i_add = 0
$i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID")
If $i_child_pid <> $i_Pid Then
$i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID")
If $i_parent_pid = $i_Pid Then
$i_add += 1
$a_children[$i_add][0] = $i_child_pid
$a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile")
EndIf
EndIf
While 1
$a_pnext = DllCall("Kernel32.dll", "int", "Process32Next", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32)
If IsArray($a_pnext) And $a_pnext[0] = 0 Then ExitLoop
$i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID")
If $i_child_pid <> $i_Pid Then
$i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID")
If $i_parent_pid = $i_Pid Then
If $i_add = $a_children[0][0] Then
ReDim $a_children[$a_children[0][0] + 11][2]
$a_children[0][0] = $a_children[0][0] + 10
EndIf
$i_add += 1
$a_children[$i_add][0] = $i_child_pid
$a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile")
EndIf
EndIf
WEnd
If $i_add <> 0 Then
ReDim $a_children[$i_add + 1][2]
$a_children[0][0] = $i_add
EndIf
DllCall("Kernel32.dll", "int", "CloseHandle", "long", $a_tool_help[0])
If $i_add Then Return $a_children
Return SetError(3, 0, 0)
EndFunc ;==>_ProcessGetChildren