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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.