home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / Chip_2002-05_cd1.bin / chplus / cpp / 3 / RichEdit.exe / richabt.cpp next >
C/C++ Source or Header  |  1998-02-09  |  1KB  |  33 lines

  1. //----------------------------------------------------------------------------
  2. //Borland C++Builder
  3. //Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. //---------------------------------------------------------------------
  6. #include <vcl.h>
  7. #pragma hdrstop
  8.  
  9. #include "RichAbt.h"
  10. #include <stdio.h>
  11. //----------------------------------------------------------------------------
  12. #pragma resource "*.dfm"
  13. TForm2 *Form2;
  14. //----------------------------------------------------------------------------
  15. __fastcall TForm2::TForm2(TComponent *Owner)
  16.   : TForm(Owner)
  17. {
  18. }
  19. //----------------------------------------------------------------------------
  20.  void __fastcall TForm2::FormShow(TObject* /*Sender*/)
  21. {
  22.      TMemoryStatus MS;
  23.      MS.dwLength = sizeof(MS);
  24.      GlobalMemoryStatus(&MS);
  25.      PhysMem->Caption = FormatFloat((AnsiString)"#,###' KB'", MS.dwTotalPhys / 1024);
  26.      LPSTR lpMemLoad = new char[5];
  27.      sprintf(lpMemLoad,"%d %%",MS.dwMemoryLoad);
  28.      FreeRes->Caption = (AnsiString)lpMemLoad;
  29.      delete [] lpMemLoad;
  30. }
  31. //----------------------------------------------------------------------------
  32.  
  33.