Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using the ChooseColor function
Adding a background image to VFP report (VFP9, ReportListener)
Encapsulating access to the Windows Services in a class
How to print a bitmap file
Disabling mouse and keyboard input for the main VFP window (with the app still running)
How to ping a remote site using IP Helper API calls
Placing a button on the VFP form as a new child window
Bitmap Class for Visual FoxPro application
Sending email messages with Simple MAPI
Simple printer queue monitor: deletes, pauses, resumes print jobs for local printer
Accessing Adobe Reader 7.0 main menu from VFP application
Subclassing CommandButton control to create BackColor property
Using Change Notification Objects to monitor changes to the printer or print server
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
How to adjust monitor brightness (Vista, monitor with DDC support)
The original LoadPicture() function in VFP returns valid handles to bitmaps, icons, cursors, and metafiles
Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)
How to set Creation Date/Time for a folder (WinNT)
Adding user-defined items to the Control Menu of VFP form (requires VFP9)
How to suspend or hibernate your system
Using the DrawText function
Displaying the main Dial-Up Networking dialog box
Class for sound recording
Displaying icons in the system tray (VFP9)
Displaying OS Memory Status

User rating: 8.5/10 (2 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
 
*|typedef struct _MEMORYSTATUS {  
*| DWORD dwLength;           0:4
*| DWORD dwMemoryLoad;       4:4
*| SIZE_T dwTotalPhys;       8:4
*| SIZE_T dwAvailPhys;      12:4
*| SIZE_T dwTotalPageFile;  16:4
*| SIZE_T dwAvailPageFile;  20:4
*| SIZE_T dwTotalVirtual;   24:4
*| SIZE_T dwAvailVirtual;   28:4
*| } MEMORYSTATUS, *LPMEMORYSTATUS; total 32 bytes
#DEFINE MEMORYSTATUS_SIZE  32
 
DECLARE GlobalMemoryStatus IN kernel32;
    STRING @lpBuffer
 
PRIVATE cBuffer
cBuffer = REPLI(Chr(0), MEMORYSTATUS_SIZE)
= GlobalMemoryStatus(@cBuffer)
 
= Writeln("Memory in use, % ...................",  5)
= Writeln("Physical memory, in bytes ..........",  9)
= Writeln("Physical memory available, bytes ...", 13)
= Writeln("Committed memory limit, bytes ......", 17)
= Writeln("Available memory to commit, bytes ..", 21)
= Writeln("User mode portion..., bytes ........", 25)
= Writeln("Unreserved/uncommitted memory ......", 29)
 
PROCEDURE Writeln(cCaption, nOffs)
    LOCAL nSize
    nSize = buf2dword(SUBSTR(cBuffer,nOffs,4))
    ? cCaption + " " + ALLTRIM(TRANS(nSize, "999,999,999,999,999,999"))
 
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: 8.5/10 (2 votes)
Rate this code sample:
  • ~
1310 bytes  
Created: 2001-07-12 12:00:00  
Modified: 2005-04-29 10:13:48  
Visits in 7 days: 109  
Listed functions:
GlobalMemoryStatus
Printer friendly API declarations
My comment:
MEMORYSTATUS reflects the state of memory at the time of the call. It reflects the size of the paging file at that time.

Memory in use -- for WinNT this value can be zero.

On computers with more than 4 GB of memory, the MEMORYSTATUS structure may return incorrect information. If your application is at risk for this behavior, use the GlobalMemoryStatusEx function instead.
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-2013 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.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.242.188.217)
3 sec.Example: 'Who is the first in viewing the Clipboard'
1.66 hrs.Function: 'GdipCreateFromHWND'
3.97 hrs.Function: 'BroadcastSystemMessage'
 Example: 'Converting long file names to the short format and vice versa'
6.64 hrs.Example: 'How to retrieve information about a cache entry (Internet Explorer)'
 Function: 'MonitorFromWindow'
11.49 hrs.Example: 'Playing WAV sounds simultaneously'
13.8 hrs.Example: 'GDI+: how to make VFP controls visually shake and shudder'
 Example: 'How to get Special Folders paths'
15.18 hrs.Example: 'Using an Event Object. Part B: running an application responding to events'
Google
Advertise here!