Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
GDI+: how to make VFP controls visually shake and shudder
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
How to find which fonts Windows uses for drawing captions, menus and message boxes
Obtaining provider name for a specific type of network
Retrieving file information for the VFP executable running
Storing screen shot of a form to enhanced metafile (*.emf)
Using the SetErrorMode for determining if a floppy drive is ready
System Image List Viewer
The DetectAutoProxyUrl function identifies the auto-config script location
Displaying standard progress dialog box when copying files
WAV file player
Accessing examples contained in this reference from a VFP application
Displaying OS Memory Status
Displaying printer-properties Property Sheet for the specified printer
Drawing Windows frame controls using the DrawFrameControl function
GDI+: Creating thumbnails to preview images in a directory
Locking the workstation
Current keyboard type
How to create transparent areas inside a form -- punching holes in the form
Obtaining information about all user accounts on a server (WinNT only)
Reading security permissions for NTFS files and folders
Winsock: creating a socket that is bound to a specific service provider
Another way to go online (it is not about choosing an ISP)
CryptoAPI: Collection of Providers class
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
 
PARAMETERS  lcFilename
 
#DEFINE OF_READ                0
#DEFINE OF_SHARE_DENY_NONE    64
#DEFINE HFILE_ERROR           -1
#DEFINE dwordPlus 0xffffffff + 1
 
LOCAL lpReOpenBuff, hFile, lnSizeLo, lnSizeHi
 
lpReOpenBuff = REPLI (Chr(0), 250)
hFile = OpenFile (lcFilename, @lpReOpenBuff, OF_SHARE_DENY_NONE)
 
IF hFile <> HFILE_ERROR
    lnSizeHi = 0
    lnSizeLo = GetFileSize (hFile, @lnSizeHi)
    RETURN lnSizeHi * dwordPlus + lnSizeLo
    = CloseHandle (hFile)
ELSE
    RETURN 0
ENDIF
 
PROCEDURE  decl
    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:
  • ~
776 bytes  
Created: 2001-08-23 12:00:00  
Modified: 2005-12-27 10:31:24  
Visits in 7 days: 95  
Listed functions:
CloseHandle
GetFileSize
OpenFile
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  
FreeTranslation.com 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-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 (184.73.74.47)
4.09 hrs.Function: 'ChooseColor'
 Example: 'Obtaining list of tables stored in an ODBC Data Source'
4.91 hrs.Example: 'A procedure for setting file times'
8.97 hrs.Function: 'GetHandleInformation'
 Example: 'GDI+: Scrolling through large image using the mouse'
8.98 hrs.Example: 'Changing pitch and speed of a wave file'
11.16 hrs.Function: 'RevertToSelf'
Function group: 'Security'
 Function: 'GetACP'
11.28 hrs.Example: 'How to print FoxPro form'
14.17 hrs.Function: 'GetLastError'
Function group: 'Error Handling'
Google
Advertise here!