Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Converting path to original case
Converting strings between ANSI and OEM
Enhanced GetFont dialog
GDI+: Using Scale and Shear transformations
How to test file attributes (key method for FileExists and DirectoryExists routines)
Testing Transparent Menu Class with top-level form (requires VFP9)
Using the Semaphore object to allow only one instance of VFP application running
Basic Volume information
Enumerating the subkeys of a user-specific key
Retrieving graphic capabilities of default printer
Retrieving various system metrics
Using GetBinaryType (WinNT only) to determine the type of an executable file
Enumerating ODBC drivers available on the local computer
Finding parameters for the region specified
Searching for the specified file using the SearchPath
An alternative way of setting Form.Closable to False
Displaying the main Dial-Up Networking dialog box
One more way to retrieve environment strings
Pocket PC: creating backup for the System Registry
Reading STARTUPINFO structure for the current VFP session
Setting and retrieving the double-click time for the mouse
How to check whether the system is 32-bit or 64-bit
Power capabilities of the system: battery, UPS, sleep and hibernation modes, processor throttling
Retrieving the System Time adjustment
Using LoadLibrary

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:
  • Loading a string resource from an executable file
  • How to extract icon resources from EXE or DLL and save them in .ICO files
  •  
    DO declare
     
    lpLibFileName = GetSystemDir() + "\mapi32.dll"
    hLibModule = LoadLibrary(lpLibFileName)
     
    IF hLibModule <> 0
        ? "Library handle:", hLibModule
        = FreeLibrary(hLibModule)
    ELSE
        * 1157 = ERROR_DLL_NOT_FOUND
        ? "Error code returned:", GetLastError()
    ENDIF
    * end of main
     
    FUNCTION GetSystemDir
        LOCAL lpBuffer, nSizeRet
        lpBuffer = SPACE(250) 
        nSizeRet = GetSystemDirectory(@lpBuffer, Len(lpBuffer)) 
    RETURN Iif(nSizeRet<>0, Left(lpBuffer, nSizeRet), "")
     
    PROCEDURE declare
        DECLARE INTEGER LoadLibrary IN kernel32;
            STRING lpLibFileName
     
        DECLARE INTEGER FreeLibrary IN kernel32;
            INTEGER hLibModule
     
        DECLARE INTEGER GetSystemDirectory IN kernel32;
            STRING @ lpBuffer, INTEGER nSize
     
        DECLARE INTEGER GetLastError IN kernel32
     
     
     

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    770 bytes  
    Created: 2001-07-12 12:00:00  
    Modified: 2011-12-10 09:20:22  
    Visits in 7 days: 45  
    Listed functions:
    FreeLibrary
    GetLastError
    GetSystemDirectory
    LoadLibrary
    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.16.132.180)
    39.68 min.Example: 'Displaying the color palette stored in an image file'
    39.75 min.Example: 'How to obtain Content-Type value for a file type from the System Registry'
    52.23 min.Example: 'GetFocus returns a HWND value'
    52.3 min.Example: 'Obtaining names and positions for shortcuts located on the Windows Desktop'
    Language: 'C++'
    1.22 hrs.Function: 'CeRapiFreeBuffer'
    Function group: 'Remote Application Programming (RAPI)'
     Example: 'How to create a desktop shortcut (shell link)'
    1.79 hrs.Example: 'Winsock: retrieving Web pages using sockets (HTTP, port 80)'
     Example: 'Retrieving graphic capabilities of your display'
     Function: 'CloseEventLog'
    Function group: 'Event Logging'
    2.56 hrs.Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
    Google
    Advertise here!