16.2. Other System Information Functions

In addition to the GetSystemInfo function described in the previous section, there are a number of other information functions scattered throughout the API. Each of them is exercised in the code shown in Listing 16.2.

Code Listing 16.2. Code demonstrating the GetComputerName, GetKeyboardType, GetSysColor, GetSystemDirectory, GetWindowsDirectory, GetSystem Metrics, GetVersion, and GetUserName functions
 // siinfo.cpp #include <windows.h> #include <iostream.h> #include <iomanip.h> ///////// // needs user32.lib ///////// void main() { BOOL success; int result; char s[1000]; int bufferSize = 1000; char computerName[MAX_COMPUTERNAME_LENGTH + 1]; DWORD computerNameLen = MAX_COMPUTERNAME_LENGTH + 1; success = ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.