On Windows 95-Vista, you might consider GetComputerName.

:: Edit
Meh...