初始化对话框:

    TCHAR cBuffer[256];
    DWORD nSize = sizeof(cBuffer);
    ZeroMemory(cBuffer, nSize);
    GetUserName(cBuffer, &nSize);//获取用户信息
    MessageBox(NULL, cBuffer, TEXT("用户信息"), MB_OK);
    GetOsVersion();//获取系统版本信息
    DWORD nSeconds = GetTickCount();
    ZeroMemory(cBuffer, nSize);
    wsprintf(cBuffer, "系统已启动%d秒", nSeconds/1000);//获取系统启动时间
    MessageBox(NULL, cBuffer, TEXT("系统信息"), MB_OK);
 GetDiskType("C:"); //获取磁盘C类型
    GetDiskFreeSpaceInfo("C:");//获取磁盘C空间信息

自定义函数:

void GetOsVersion()
{
    OSVERSIONINFO osvi;
    TCHAR* strOSVersion;
    ZeroMemory(&osvi, sizeof(osvi));
    osvi.dwOSVersionInfoSize = sizeof(osvi);
    GetVersionEx(&osvi);
    //首先判断是NT架构的还是旧架构
    switch(osvi.dwPlatformId)
    {
    case VER_PLATFORM_WIN32_NT:
        if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
        {
            strOSVersion = TEXT("Windows 2000");
        }
        else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
        {
            strOSVersion = TEXT("Windows XP");
        }
        else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)   
        {
         strOSVersion = TEXT("Windows Vista");  
        }
        else if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
        {
            strOSVersion = TEXT("Windows NT");
        }
        break;
    case  VER_PLATFORM_WIN32_WINDOWS:
        if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
        {
            strOSVersion = TEXT("Windows 98");
        }
        else if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
        {
            strOSVersion = TEXT("Windows ME");
        }
        else
        {
            strOSVersion = TEXT("Windows 95");
        }
        break;
    default:
        break;
 }
 MessageBox(NULL,strOSVersion, TEXT("系统信息"), MB_OK);
}

void GetDiskType(LPCTSTR lpRootPathName)
{
 UINT uType = GetDriveType(lpRootPathName);               
  switch(uType)
 {
  case DRIVE_UNKNOWN:
   MessageBox(NULL,TEXT("未知磁盘类型"),"",MB_OK);
   break;
  case DRIVE_NO_ROOT_DIR:
   MessageBox(NULL,TEXT("磁盘名无效"),"",MB_OK);
   break;
     case DRIVE_REMOVABLE:
            MessageBox(NULL,TEXT("可移动磁盘"),"",MB_OK);
   break;
  case DRIVE_FIXED:
   MessageBox(NULL,TEXT("固定磁盘"),"",MB_OK);
     break;
  case DRIVE_REMOTE:
   MessageBox(NULL,TEXT("网络磁盘"),"",MB_OK);
    break;
  case DRIVE_CDROM:
   MessageBox(NULL,TEXT("光驱"),"",MB_OK);
   break;
  case DRIVE_RAMDISK:
   MessageBox(NULL,TEXT("RAM"),"",MB_OK);
   break;
  default:
   MessageBox(NULL,TEXT("GetDriveType的非法返回值"),"",MB_OK);
 }
}

void GetDiskFreeSpaceInfo(LPCSTR lpDirectoryName)
{
    ULARGE_INTEGER nFreeBytesAvailableToCaller;
    ULARGE_INTEGER nTotalNumberOfBytes;
    ULARGE_INTEGER nTotalNumberOfFreeBytes;
    if(GetDiskFreeSpaceEx(lpDirectoryName, &nFreeBytesAvailableToCaller, &nTotalNumberOfBytes, &nTotalNumberOfFreeBytes))
    { 
     TCHAR cInfo[256];
     wsprintf(cInfo, "磁盘%s总大小:%I64dG 空闲空间:%I64dG 可用空间:%I64dG", lpDirectoryName, nTotalNumberOfBytes.QuadPart/1024/1024/1024, nTotalNumberOfFreeBytes.QuadPart/1024/1024/1024, nFreeBytesAvailableToCaller.QuadPart/1024/1024/1024);
     MessageBox(NULL, cInfo, TEXT("磁盘信息"), MB_OK);
    }
    else
    {
     MessageBox(NULL, TEXT("获取磁盘信息失败"), TEXT("错误"), MB_OK | MB_ICONASTERISK);
    }
}

关于ULARGE_INTEGER:

http://www.rupeng.com/forum/thread-409-1-1.html

http://blog.csdn.net/feilong0519/archive/2008/10/26/3153010.aspx