Solved

DHCP enabled?

Posted on 2002-05-21
4
174 Views
Last Modified: 2010-04-02
Hi,
i need using C++ / win32  /MFC to ind out if DHCP is enabled to a specific computer

thanks
Shay
0
Comment
Question by:Shay050799
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
mblat earned 50 total points
ID: 7025589
To do that you need to read registry entry.

For Win2000

it is

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCpip\Parameters.

Then you need to go to read Adapters
find out what Interfaces they are using and
now you can read interfaces and find out id they are using DHCP.

Needless to say that as any registry hack this is highly unportable, bound to change in next service pack and from OS to OS ( I am quite sure that keys are different on Win95 machines) and works only for Microsoft stack.

My suggestion would be here to start shell, run ipconfig  utility to a file and then parse it.

something like

ipconfig /all >> ipconfig.txt

Hope it helps...
 
0
 
LVL 3

Author Comment

by:Shay050799
ID: 7025678
excellent !!! thanks a lot
maybe you can help me with something else
i m looking for the video max card resolution and num of colors


Shay
0
 
LVL 4

Expert Comment

by:mblat
ID: 7025714
You need to look at the following calls

EnumDisplaySettings
EnumDisplayDevices

They should do the job...


Hope it helps....
0
 
LVL 3

Author Comment

by:Shay050799
ID: 7025744
thank you soo much it works
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now