Finding A Computer's Name

I need a way for my program to find out the name of the computer that is running my program.  Every computer has a computer name which is located in the control panel.  By clicking on network and then the identification tab of your computer you will find the name I am referring to.  Thanks for the help.
LVL 5
jamovilleAsked:
Who is Participating?
 
Tommy HuiEngineerCommented:
Use GetComputerName(). From the documentation:

BOOL GetComputerName(LPTSTR lpBuffer,  // address of name buffer
  LPDWORD nSize     // address of size of name buffer);


0
 
jamovilleAuthor Commented:
I was a little quick in putting this question on the board.  I figured out how to do it myself and because your answer is the solution I used you should get the points.
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.