DockingState is an enumerated value, if the value is 0 it will never change. If the value is 3 you prbably need the driver from the manufacturer of the laptop.
As Yusef has already stated, it is a function of the driver, not the OS.
typedef enum {
DockStateUnsupported = 0,
DockStateUnDocked = 1,
DockStateDocked = 2,
DockStateUnknown = 3
} DOCKING_STATE;