I am writing an application that checks if the computer is connected to one particular network or not, and does some magic for our users.
The application will run in the background and perform the check if the user requests it (menu in tray). I also want the application to automatically check and do magic if the user changes from wired to wireless, or disconnects and connects to a new network.
Is it possible to make it trigger when a network interface changes state?