#Include <Services.au3>
Const $aStatuses[7][2] = [ _
['$SERVICE_STOPPED', $SERVICE_STOPPED], _
['$SERVICE_START_PENDING', $SERVICE_START_PENDING], _
['$SERVICE_STOP_PENDING', $SERVICE_STOP_PENDING], _
['$SERVICE_RUNNING', $SERVICE_RUNNING], _
['$SERVICE_CONTINUE_PENDING', $SERVICE_CONTINUE_PENDING], _
['$SERVICE_PAUSE_PENDING', $SERVICE_PAUSE_PENDING], _
['$SERVICE_PAUSED', $SERVICE_PAUSED] ]
Local $aRes = _Service_QueryStatus('dhcp')
;
For $i = 0 To UBound($aStatuses) - 1 Step 1
If BitAnd($aRes[1], $aStatuses[$i][1]) = $aStatuses[$i][1] Then
MsgBox(64, '', $aStatuses[$i][0])
Exit
EndIf
Next