Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Simple Window Viewer
Comparing dimensions of the VFP main window with _SCREEN properties
Converting a hexadecimal string to an integer
Converting path to original case
Enumerating network interfaces on the local computer
Peer-to-peer LAN messenger built with Mailslot API functions
String representation for disk or memory capacity
Testing Transparent Menu Class with top-level form (requires VFP9)
Winsock: creating a socket that is bound to a specific service provider
Extracting the name and extension parts of a path string
How to download this reference`s archive through WinInet functions using InternetOpenUrl
How to obtain the number of rows affected by remote UPDATE, INSERT or DELETE statement
How to retrieve information about a cache entry (Internet Explorer)
Memory usage info for current VFP session (WinNT only)
Scanning a hierarchy of child windows down from the Windows Desktop
Scanning the hierarchy of child windows down from the main VFP window
Setting properties of the window: caption and user-defined value
Drawing standard Windows icons
How to make a VFP form fading out when released (GDI version)
Retrieving the state of your Internet connection
Using FrameRgn for displaying system colors
GDI+: Creating thumbnails to preview images in a directory
Using an Event Object. Part A: running an application that creates an Event object
Using InternetGoOnline function
Using the heap of the calling process to allocate memory blocks

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
 
DO decl
#DEFINE HEAP_ZERO_MEMORY 8
 
LOCAL lnAlloc0, lnAlloc1, hProcHeap, hMem
 
* retrieving a handle to the heap of the calling process
hProcHeap = GetProcessHeap()
 
? "Retrieving the handle of the calling process heap:", hProcHeap
?
 
* three number of bytes values to allocate
lnAlloc0 = 4096
lnAlloc1 = 0x20000
lnAlloc2 = 0xffff
 
? "Allocating and resizing a memory block from the process heap:"
hMem = HeapAlloc (hProcHeap, HEAP_ZERO_MEMORY, lnAlloc0)
? "   - allocated:",;
    HeapSize(hProcHeap, 0, hMem), ", handle: ", hMem
 
* resizing the memory block - the first try
hMem = HeapReAlloc (hProcHeap, HEAP_ZERO_MEMORY, hMem, lnAlloc1)
? "   - reallocated:",;
    HeapSize(hProcHeap, 0, hMem), ", handle: ", hMem
 
* resizing the memory block - the second try
hMem = HeapReAlloc (hProcHeap, HEAP_ZERO_MEMORY, hMem, lnAlloc2)
? "   - reallocated:",;
    HeapSize(hProcHeap, 0, hMem), ", handle: ", hMem
 
?
? "Releasing allocated memory block:",;
    Iif (HeapFree(hProcHeap, 0,hMem)=0, "failed", "Ok")
 
PROCEDURE  decl
    DECLARE INTEGER GetProcessHeap IN kernel32
 
    DECLARE INTEGER HeapAlloc IN kernel32;
        INTEGER hHeap, INTEGER dwFlags, INTEGER dwBytes
 
    DECLARE INTEGER HeapSize IN kernel32;
        INTEGER hHeap, INTEGER dwFlags, INTEGER lpMem
 
    DECLARE INTEGER HeapFree IN kernel32;
        INTEGER hHeap, INTEGER dwFlags, INTEGER lpMem
 
    DECLARE INTEGER HeapReAlloc IN kernel32;
        INTEGER hHeap, INTEGER dwFlags, INTEGER lpMem,;
        INTEGER dwBytes
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1481 bytes  
Created: 2001-12-01 08:12:27  
Modified: 2005-12-27 10:42:16  
Visits in 7 days: 93  
Listed functions:
GetProcessHeap
HeapAlloc
HeapFree
HeapReAlloc
HeapSize
Printer friendly API declarations
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 (50.17.109.248)
2.29 hrs.Example: 'Enumerating network resources'
 Function: 'GetDiskFreeSpace'
Function group: 'File System'
10.28 hrs.Example: 'How to create MD-5 and SHA-1 hash values from a string'
Language: 'C#'
 Function: 'CloseEnhMetaFile'
Function group: 'Metafile'
14.89 hrs.Example: 'How to block the ALT+TAB shortcut (WinXP)'
 Example: 'Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera'
15.23 hrs.All Functions
 Example: 'Browsing Windows Known Folders (Special Folders)'
 Function: 'GdipSetTextRenderingHint'
Function group: 'GDI+ Graphics'
16.93 hrs.Function: 'LoadLibrary'
Function group: 'Dynamic-Link Library'
Google
Advertise here!