Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to retrieve list of system DSNs (Data Source Name) with parameters
Pocket PC: creating backup for the System Registry
Retrieving the System Time adjustment
Accessing the list of Windows Recent Documents
Dynamic strings implemented through VFP Custom class
Pocket PC: enumerating mounted database volumes and databases in the Object Store
Retrieving geometrical parameters of the system desktop window
Saying "Hello World!" with VFP and WinAPI
Using LoadLibrary
List of ODBC drivers installed (read from the [ODBC Drivers] section)
Power capabilities of the system: battery, UPS, sleep and hibernation modes, processor throttling
How to retrieve information about a cache entry (Internet Explorer)
Managing Cookies
Setting the Window Region for a form
Terminating VFP application using the FatalAppExit
Displaying all TCP connections for the local system
Finding the application, icon and friendly names associated with a file name
Obtaining window class name for the main VFP window
Creating two-byte hashes for a list of URLs
GetFileOwner - Get the owner of an NTFS file
How to create a service object
Open and close a Simple MAPI Session
Retrieving a handle to DLL and address of an exported function in it
Retrieving list of supported paper names (for example, Letter or Legal) for a given printer
Retrieving the names of all sections in an initialization file

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
 
LOCAL lnBufferSize, lcBuffer, lnReturn
lnBufferSize = 16384
lcBuffer = Repli(Chr(0), lnBufferSize)
 
*lnBufferSize = GetPrivateProfileSectionNames(@lcBuffer,;
                lnBufferSize, "c:\winnt\win.ini")
 
*lnBufferSize = GetPrivateProfileSectionNames(@lcBuffer,;
                lnBufferSize, "win.ini")
 
lnBufferSize = GetPrivateProfileSectionNames(@lcBuffer,;
                lnBufferSize, "c:\windows\desktop.ini")
 
*lnBufferSize = GetPrivateProfileSectionNames(@lcBuffer,;
                lnBufferSize, "c:\i386\display\disk_01\setup.ini")
 
lcBuffer = Left(lcBuffer, lnBufferSize) + Chr(0)
 
LOCAL ii, lcSubstr, ch
lcSubstr = ""
CREATE CURSOR csResult (section C(50))
 
FOR ii=1 TO lnBufferSize
    ch = SUBSTR(lcBuffer, ii,1)
    IF ch = Chr(0)
        IF Not Empty(lcSubstr)
            INSERT INTO csResult VALUES (m.lcSubstr)
            lcSubstr = ""
        ENDIF
    ELSE
        lcSubstr = lcSubstr + ch
    ENDIF
ENDFOR
 
SELECT csResult
GO TOP
BROWSE NORMAL NOWAIT
 
PROCEDURE  decl
    DECLARE INTEGER GetPrivateProfileSectionNames IN kernel32;
        STRING @lpszReturnBuffer, INTEGER nSize, STRING lpFileName
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1074 bytes  
Created: 2002-01-15 20:07:44  
Modified: 2002-01-15 20:10:02  
Visits in 7 days: 52  
Listed functions:
GetPrivateProfileSectionNames
Printer friendly API declarations
My comment:
Calls to profile functions might be mapped to the registry instead of to the initialization files. That means when reading the Win.INI with this function, you may actually read the Windows Registry 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 (50.16.132.180)
2.09 hrs.Function: 'RasPhonebookDlg'
 Function: 'SetEvent'
Function group: 'Synchronization'
2.63 hrs.Example: 'Adding supplementary data to AVI files'
3.37 hrs.Function: 'DrawText'
Function group: 'Font and Text'
 Function: 'AVIStreamGetFrame'
Function group: 'Windows Multimedia'
 Example: 'Using the NetMessageBufferSend to send messages on the network'
4.86 hrs.Example: 'DiskFreeSpace class'
4.95 hrs.Function: 'GdipGetPageScale'
7.55 hrs.Example: 'Loading a string resource from an executable file'
 Example: 'Retrieving the name of the network resource associated with a local device'
Google
Advertise here!