Link to home
Start Free TrialLog in
Avatar of FSOFT-SA
FSOFT-SAFlag for Viet Nam

asked on

Use Win API to set EnableDHCP flag

Dear expert,

I need to use Win APIs to set value for EnableDHCP flag.
But it seems I can not find the API to do this.
So, is there any API for doing this? Please help me to find this.

Note: until now, I can use Win API to set value for IPAddress , DefaultGateway and SubnetMask.

Regards.
Avatar of sarabande
sarabande
Flag of Luxembourg image

the EnableDHCP flag is a registry REG_DWORD below

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\{xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb}\Parameters\Tcpip

where xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb is the GUID of the LAN connection.

you find the GUID below

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network

note, the GUID would not change as long as you don't add/remove network adapters or their connections.

Sara
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial