I am looking for a way to, without polling, to get a notification when the Windows machine IP address change. I need to react to this change and perform some action in my application.
Anyone has done anything of the sort?
You can use NotifyAddrChange()
to handle IPv4 address change. The linked page has a succinct demo. NotifyIpInterfaceChange()
handles both IPv4 and IPv6 (separately or simultaneously -- see the doc), but requires Vista or later.
If you are using .NET, you can implement the NetworkChange::NetworkAddressChanged Event. I believe that provides exactly what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With