' Gambas class file Private hpro As Process Public Sub Button1_Click() ' An application start, i.e. “ Gedit “ hpro = Exec ["gedit"] As "hpro" End Public Sub button2_Click() ' it closes application process hpro.kill End ' this event is raised, when process is closed: Public Sub hpro_Kill() Print "Process closed !" End