well, since I don't know how to do it via API - you may consider looking directly in the registry. This means you will have to know where to look for each windows version. In Win2K, I have found the following two keys:
Each time the value was stored in "EnableDHCP", which is a dword value set to 0 for false, and 1 for true. I trust you know how to use the registry API?