How can I know whether the EA is enabled or disabled in a MT4?

 
I want to create an EA Controller - on some condition send Ctrl+E keystroke to MT4 to enable or disable the Expert Advisors. But I don't know whether it it currently enabled or disabled, can anyone help me with this?
 
valleyfir:
I want to create an EA Controller - on some condition send Ctrl+E keystroke to MT4 to enable or disable the Expert Advisors. But I don't know whether it it currently enabled or disabled, can anyone help me with this?

Check the upper rigth corner. "x"=disabled "smile"=enabled

 
bool IsExpertEnabled( )
Returns TRUE if expert adwisors are enabled for running, otherwise returns FALSE.
Sample:
  while(!IsStopped())
{
...
if(!IsExpertEnabled()) break;
}
 
antslag:
bool IsExpertEnabled( )
Returns TRUE if expert adwisors are enabled for running, otherwise returns FALSE.
Sample:

Thank you!

Reason: