Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Winsock: sending email messages (SMTP, port 25)
Custom GDI+ class
Using EnumPrinters function to enumerate locally installed printers
Semi-transparent Form
Custom HttpRequest class (WinHTTP)
Custom HttpRequest class (WinINet)
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
How to convert a bitmap file to monochrome format (1 bpp)
Compressing and decompressing files with Windows API Runtime Library routines
Printing Image File, programmatically set print page orientation to landscape
Custom FTP Class for Visual FoxPro application
How to create MD-5 and SHA-1 hash values from a string
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Extended MessageBox Class
Transparent Menu Class (requires VFP9)
Creating irregularly shaped FoxPro form using transparency color key
Adding icon to the systray (requires VFP9)
How to ping a remote site using ICMP API calls
How to create non-blocking Winsock server
Using Month Calendar Control (VFP9, Comctl32.dll)
How to print FoxPro form
How to detect if additional monitor is connected and active
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
Obtaining memory performance information for the system

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
Memory performance information is available from the memory manager through the system performance counters and through functions such as GetPerformanceInfo, GetProcessMemoryInfo, and GlobalMemoryStatusEx.

See also:
  • Memory usage info for current VFP session
  • Enumerating processes

  •  
    *!*    typedef struct _PERFORMANCE_INFORMATION {
    *!*      DWORD  cb;                 0:4
    *!*      SIZE_T CommitTotal;        4:4
    *!*      SIZE_T CommitLimit;        8:4
    *!*      SIZE_T CommitPeak;        12:4
    *!*      SIZE_T PhysicalTotal;     16:4
    *!*      SIZE_T PhysicalAvailable; 20:4
    *!*      SIZE_T SystemCache;       24:4
    *!*      SIZE_T KernelTotal;       28:4
    *!*      SIZE_T KernelPaged;       32:4
    *!*      SIZE_T KernelNonpaged;    36:4
    *!*      SIZE_T PageSize;          40:4
    *!*      DWORD  HandleCount;       44:4
    *!*      DWORD  ProcessCount;      48:4
    *!*      DWORD  ThreadCount;       52:4
    *!*    } PERFORMANCE_INFORMATION,
    *!*        *PPERFORMANCE_INFORMATION;
     
    #DEFINE PERFORMANCE_INFORMATION_SIZE 56
     
    DECLARE INTEGER GetPerformanceInfo in psapi;
        STRING @pPerfInfo, INTEGER cb
     
    LOCAL cBuffer, nPageSize
    cBuffer = PADR(CHR(PERFORMANCE_INFORMATION_SIZE),;
        PERFORMANCE_INFORMATION_SIZE, CHR(0))
     
    = GetPerformanceInfo(@cBuffer,;
        PERFORMANCE_INFORMATION_SIZE)
     
    nPageSize = buf2dword(SUBSTR(cBuffer, 41, 4))
     
    ? "Physical Total (Bytes):",;
        TRANSFORM(buf2dword(SUBSTR(cBuffer, 17, 4)) *;
        nPageSize, "999,999,999,999")
     
    ? "Physical Available (Bytes):",;
        TRANSFORM(buf2dword(SUBSTR(cBuffer, 21, 4)) *;
        nPageSize, "999,999,999,999")
     
    ? "Handle Count:",;
        buf2dword(SUBSTR(cBuffer, 45, 4))
     
    ? "Process Count:",;
        buf2dword(SUBSTR(cBuffer, 49, 4))
     
    ? "Thread Count:",;
        buf2dword(SUBSTR(cBuffer, 53, 4))
     
    FUNCTION buf2dword(cBuffer)
    RETURN Asc(SUBSTR(cBuffer, 1,1)) + ;
        BitLShift(Asc(SUBSTR(cBuffer, 2,1)),  8) +;
        BitLShift(Asc(SUBSTR(cBuffer, 3,1)), 16) +;
        BitLShift(Asc(SUBSTR(cBuffer, 4,1)), 24)
     

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    1618 bytes  
    Created: 2010-07-12 02:45:58  
    Modified: 2010-07-14 01:44:24  
    Visits in 7 days: 38  
    Listed functions:
    GetPerformanceInfo
    Printer friendly API declarations
    My comment:
    System information obtained through call to GetPerformanceInfo, includes counts for running processes and threads, handles, amount of available and allocated memory.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright © 2001-2010 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.0.85), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (38.107.191.106)
    7.28 min.
    Function group: 'File System'
    39.75 min.
    Function group: 'Error Handling'
    44.47 min.Function: 'mixerClose'
    Function group: 'Windows Multimedia'
    46.43 min.Function: 'waveInGetErrorText'
    Function group: 'Windows Multimedia'
    51.82 min.Function: 'SetHandleInformation'
    5 day(s)Solution: 'Extended MessageBox library (assembly) for .NET'
    Google
    Advertise here!