Assuming you're using WinForms, you could try handling the GotFocus and LostFocus events. Detecting whether a new program has been opened could cause issues, especially during startup, since you can't be sure your program is opened last, and Windows could be starting up a bunch of programs.
Is it also possible to stop it when I start up another programm ?
A particular program? Is it one that you have the source code for? You could always create a cmd file to start that particular program then create a shortcut to the cmd file and always start it from that. The cmd file could have a line to kill your program and another to start the requested program.
I have a scroling text that starts running at the bottom of my desktop when I start up my computer. I would like to know if it is possible to have it detect when any other program starts and have itself shutdown. Just curious if it can be done.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...