Using Win32 functions in Visual FoxPro Image Gallery
Registry
..msdn
GetPrivateProfileSectionNames
GetPrivateProfileString
GetProfileString
RegCloseKey
RegCreateKeyEx
RegDeleteKey
RegDeleteValue
RegEnumKey
RegEnumKeyEx
RegEnumValue
RegOpenKeyEx
RegQueryInfoKey
RegQueryValueEx
RegSaveKey
RegSetValueEx
SHEnumKeyEx
SHRegCloseUSKey
SHRegEnumUSKey
SHRegOpenUSKey
WritePrivateProfileSection
WritePrivateProfileString
Code examples:
Retrieving the names of all sections in an initialization file
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: 42  
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-2014 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.68), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (23.20.112.161)
12 sec.Example: 'How to convert a bitmap file to monochrome format (1 bpp)'
Language: 'Visual FoxPro'
Google
Advertise here!