Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Custom GDI+ class
Storing content of the Clipboard to a bitmap file
Storing screen shot of a form to bitmap file
How to print FoxPro form
How to print a bitmap file
Vertical Label control
Capturing keyboard activity of another application with the Raw Input API (VFP9)
GDI+: Implementing image scrolling with inertia
Splash Screen for the VFP application
Displaying icons in the system tray (VFP9)
Displaying dimmed window behind VFP top-level form
Pocket PC: custom RAPI class for operating with files and folders on mobile device
Copying picture of the active form to the Clipboard using Enhanced Metafile API functions
Monitoring clipboard content changes (VFP9)
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Obtaining names and positions for shortcuts located on the Windows Desktop
Extensible Storage Engine class library
Loading a string resource from an executable file
Attaching menu to a top-level form
How to ping a remote site using IP Helper API calls
Enumerating Processes -- WinNT
Custom HttpRequest class (WinINet)
GDI+: sending image of FoxPro form to printer
How to put a horizontal text scrolling on the form (a news line, marquee)
Using GetFileSize

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
Before you begin:
See also:
  • How to retrieve the size of a remote file (FTP)
  • Basic volume information
  • Using GetCompressedFileSize
  • DO declare
    ? GetFileSizeAPI(_vfp.ServerName)
    FUNCTION GetFileSizeAPI(lcFilename)
    #DEFINE MAX_DWORD 0xffffffff
        LOCAL lpReOpenBuff, hFile, lnSizeLo, lnSizeHi
        lpReOpenBuff = REPLICATE(Chr(0), 250)
        hFile = OpenFile(lcFilename, @lpReOpenBuff, OF_SHARE_DENY_NONE)
        IF hFile <> HFILE_ERROR
            lnSizeHi = 0
            lnSizeLo = GetFileSize(hFile, @lnSizeHi)
            = CloseHandle(hFile)
            RETURN lnSizeHi * (MAX_DWORD + 1) + lnSizeLo
            RETURN 0
    PROCEDURE declare
        DECLARE INTEGER GetFileSize IN kernel32;
            INTEGER hFile, INTEGER @lpFileSizeHigh
        DECLARE INTEGER OpenFile IN kernel32;
            STRING lpFileName,;
            STRING @lpReOpenBuff,;
            INTEGER wStyle
        DECLARE INTEGER CloseHandle IN kernel32;
            INTEGER hObject

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    793 bytes  
    Created: 2001-08-23 12:00:00  
    Modified: 2013-09-13 08:09:55  
    Visits in 7 days: 80  
    Listed functions:
    Printer friendly API declarations
    My comment:
    The GetFileSize returns the result stored in two 32-bit unsigned integers. This is quite a size for any file or device.

    Had it return only one 32-bit value -- the maximum of 4,294,967,296 Bytes is not a high-end capacity these days.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
    User Contributed Notes:
    jeff9000 | 2005-08-07 15:50:58
    The line:
     RETURN lnSizeHi * dwordPlus + lnSizeLo
    Needs to be:
    Return lnSizeHi * DWORDPLUS + VAL(TRANSFORM(lnSizeLo, "@0"))

    In order to work with files over 15GB or something like that. See Universal Thread Message ID:  1039133

    Copyright 2001-2017 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.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (
    2 sec.Function: 'SQLGetInstalledDrivers'
    Function group: 'ODBC API'
    3 sec.Gallery
    5 sec.Function: 'NetLocalGroupEnum'
    Function group: 'Network Management'
    6 sec.Function: 'Beep'
    Function group: 'Error Handling'
    8 sec.Examples
    10 sec.Function: 'AddPort'
    Function group: 'Printing and Print Spooler'
    11 sec.Function: 'AVIFileGetStream'
    Function group: 'Windows Multimedia'
    12 sec.Links
    14 sec.Function: 'SQLNativeSql'
    Function group: 'ODBC API'
    16 sec.
    Advertise here!