home *** CD-ROM | disk | FTP | other *** search
/ distrib.akp.su/Programming/Vb-6+Rus/ / distrib.akp.su.tar / distrib.akp.su / Programming / Vb-6+Rus / COMMON / MSDEV98 / BIN / IDE / SYSINFO.DLL / TEMPLATE / 134
Text File  |  1998-06-18  |  1KB  |  45 lines

  1. $$IF:NewFunc$$
  2.     CDialog::OnInitDialog();    // CG:  This was added by System Info Component.
  3.  
  4. $$ENDIF$$
  5.     // CG: Following block was added by System Info Component.
  6.     {
  7.         CString strFreeDiskSpace;
  8.         CString strFreeMemory;
  9.         CString strFmt;
  10.  
  11.         // Fill available memory
  12.         MEMORYSTATUS MemStat;
  13.         MemStat.dwLength = sizeof(MEMORYSTATUS);
  14.         GlobalMemoryStatus(&MemStat);
  15.         strFmt.LoadString($$VAL:PhysicalMemory$$);
  16.         strFreeMemory.Format(strFmt, MemStat.dwTotalPhys / 1024L);
  17.  
  18.         //TODO: Add a static control to your About Box to receive the memory
  19.         //      information.  Initialize the control with code like this:
  20.         // SetDlgItemText(IDC_PHYSICAL_MEM, strFreeMemory);
  21.  
  22.         // Fill disk free information
  23.         struct _diskfree_t diskfree;
  24.         int nDrive = _getdrive(); // use current default drive
  25.         if (_getdiskfree(nDrive, &diskfree) == 0)
  26.         {
  27.             strFmt.LoadString($$VAL:DiskSpace$$);
  28.             strFreeDiskSpace.Format(strFmt,
  29.                 (DWORD)diskfree.avail_clusters *
  30.                 (DWORD)diskfree.sectors_per_cluster *
  31.                 (DWORD)diskfree.bytes_per_sector / (DWORD)1024L,
  32.                 nDrive-1 + _T('A'));
  33.         }
  34.         else
  35.             strFreeDiskSpace.LoadString($$VAL:SpaceUnavailable$$);
  36.  
  37.         //TODO: Add a static control to your About Box to receive the memory
  38.         //      information.  Initialize the control with code like this:
  39.         // SetDlgItemText(IDC_DISK_SPACE, strFreeDiskSpace);
  40.     }
  41. $$IF:NewFunc$$
  42.  
  43.     return TRUE;    // CG:  This was added by System Info Component.
  44. $$ENDIF$$
  45.