staticVOIDInitializeSystemPage(HWND hwndDlg){ WCHAR szTime[200]; DWORD Length; DWORDLONG AvailableBytes, UsedBytes; MEMORYSTATUSEX mem; WCHAR szFormat[40]; WCHAR szDesc[50]; SYSTEM_INFO SysInfo; /* set date/time */ szTime[0] = L'/0'; Length = GetDateFormat(LOCALE_SYSTEM_DEFAULT, DATE_LONGDATE, NULL, NULL, szTime, sizeof(szTime) / sizeof(WCHAR)); if (Length) { szTime[Length-1] = L','; szTime[Length++] = L' '; } Length = GetTimeFormatW(LOCALE_SYSTEM_DEFAULT, TIME_FORCE24HOURFORMAT|LOCALE_NOUSEROVERRIDE, NULL, NULL, &szTime[Length], (sizeof(szTime) / sizeof(WCHAR))); szTime[199] = L'/0'; SendDlgItemMessageW(hwndDlg, IDC_STATIC_TIME, WM_SETTEXT, 0, (LPARAM)szTime); /* set computer name */ szTime[0] = L'/0'; Length = sizeof(szTime) / sizeof(WCHAR); if (GetComputerNameW(szTime, &Length)) SendDlgItemMessageW(hwndDlg, IDC_STATIC_COMPUTER, WM_SETTEXT, 0, (LPARAM)szTime); /* set product name */ if (GetOSVersion(szTime)) { SendDlgItemMessage(hwndDlg, IDC_STATIC_OS, WM_SETTEXT, 0, (LPARAM)szTime); } else { if (LoadStringW(hInst, IDS_VERSION_UNKNOWN, szTime, sizeof(szTime) / sizeof(WCHAR))) { szTime[(sizeof(szTime) / sizeof(WCHAR))-1] = L'/0'; SendDlgItemMessage(hwndDlg, IDC_STATIC_VERSION, WM_SETTEXT, 0, (LPARAM)szTime); } } /* FIXME set product language/local language */ if (GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SLANGUAGE , szTime, sizeof(szTime) / sizeof(WCHAR))) SendDlgItemMessageW(hwndDlg, IDC_STATIC_LANG, WM_SETTEXT, 0, (LPARAM)szTime); /* set system manufacturer */ szTime[0] = L'/0'; if (GetRegValue(HKEY_LOCAL_MACHINE, L"Hardware//Description//System//BIOS", L"SystemManufacturer", REG_SZ, szTime, sizeof(szTime))) { szTime[199] = L'/0'; SendDlgItemMessageW(hwndDlg, IDC_STATIC_MANU, WM_SETTEXT, 0, (LPARAM)szTime); } /* set motherboard model */ szTime[0] = L'/0'; if (GetRegValue(HKEY_LOCAL_MACHINE, L"Hardware//Description//System//BIOS", L"SystemProductName", REG_SZ, szTime, sizeof(szTime))) { SendDlgItemMessageW(hwndDlg, IDC_STATIC_MODEL, WM_SETTEXT, 0, (LPARAM)szTime); } /* set bios model */ szTime[0] = L'/0'; if (GetRegValue(HKEY_LOCAL_MACHINE, L"Hardware//Description//System//BIOS", L"BIOSVendor", REG_SZ, szTime, sizeof(szTime))) { DWORD Index; DWORD StrLength = (sizeof(szTime) / sizeof(WCHAR)); Index = wcslen(szTime); StrLength -= Index; if (GetRegValue(HKEY_LOCAL_MACHINE, L"Hardware//Description//System//BIOS", L"BIOSReleaseDate", REG_SZ, &szTime[Index], StrLength)) { if (Index + StrLength > (sizeof(szTime)/sizeof(WCHAR))- 15) { //FIXME retrieve BiosMajorRelease, BiosMinorRelease //StrLength = wcslen(&szTime[Index]); //szTime[Index+StrLength] = L' '; //wcscpy(&szTime[Index+StrLength], L"Ver: "); //FIXME NON-NLS //szTime[(sizeof(szTime)/sizeof(WCHAR))-1] = L'/0'; } SendDlgItemMessageW(hwndDlg, IDC_STATIC_BIOS, WM_SETTEXT, 0, (LPARAM)szTime); } } /* set processor string */ if (GetRegValue(HKEY_LOCAL_MACHINE, L"Hardware//Description//System//CentralProcessor//0", L"ProcessorNameString", REG_SZ, szDesc, sizeof(szDesc))) { /* FIXME retrieve current speed */ szFormat[0] = L'/0'; GetSystemInfo(&SysInfo); if (SysInfo.dwNumberOfProcessors > 1) LoadStringW(hInst, IDS_FORMAT_MPPROC, szFormat, sizeof(szFormat) / sizeof(WCHAR)); else LoadStringW(hInst, IDS_FORMAT_UNIPROC, szFormat, sizeof(szFormat) / sizeof(WCHAR)); szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'/0'; wsprintfW(szTime, szFormat, szDesc, SysInfo.dwNumberOfProcessors); SendDlgItemMessageW(hwndDlg, IDC_STATIC_PROC, WM_SETTEXT, 0, (LPARAM)szTime);//.........这里部分代码省略.........