So I am looking to write something that would detect if a laptop is docked or not. I am thinking the simple way is to detect if a certain nic card is present since all of my docks have the same hardware device type for the nic.
What I need help with is how to make this work to read when the laptop is docked and undocked. and how to make the program run without eating memory I found sleeping isn't effective but maybe that's me
thanks for the help
UPDATE 1:
Maybe looking at the key will work better for docking. But how to make it know when the state changes from a 1 to a 2?
HKLM\SYSTEM\CurrentControlSet\Control\IDConfigDB\CurrentDockInfo\DockingState