I want to input some lines in win.in file.
for eg: I want to add 'Run =backup.exe' under [windows] braces.
Is there any code under in vf9. ? pls write with code

thanks in advance
Sameer

Re: To inpute lines in win.ini file by Eric

Eric
Wed May 11 07:30:28 CDT 2005

You can use the INI Access class that is part of the VFP Foundation Classes
to read and write INI files.
oOldinireg1=NEWOBJECT("oldinireg", HOME() + "ffc\registry.vcx")
For info on how to use this class, lookup "INI Access Foundation Class" in
VFP help.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8

"sameer" <sameer@discussions.microsoft.com> wrote in message
news:B51C2235-CC81-4B9C-837F-BBBCB3BF2E19@microsoft.com...
>I want to input some lines in win.in file.
> for eg: I want to add 'Run =backup.exe' under [windows] braces.
> Is there any code under in vf9. ? pls write with code
>
> thanks in advance
> Sameer



RE: To inpute lines in win.ini file by dirknerpin

dirknerpin
Wed May 11 16:15:38 CDT 2005

Below are two ruitines I've written for VFP9 that I qucikly made compatible
with VFP6, if that's what you're using. Left VFP9 stuff in, but commented
out.

*********************************************************************
* WriteINI - Writes an item to an INI file, pretty straight forward *
*********************************************************************
PROCEDURE WriteINI &&(cINIFile AS String, cTopic AS String, cItem AS String,
cValue AS String)
LPARAMETERS cINIFile, cTopic, cItem, cValue
DECLARE INTEGER WritePrivateProfileString IN Win32API ;
STRING cTopic, ;
STRING cItem, ;
STRING cValue, ;
STRING cINIFile
WritePrivateProfileString(m.cTopic, m.cItem, m.cValue, m.cINIFile)
ENDPROC

********************************************************************
* ReadINI - Reads values from an INI file, pretty straight forward *
********************************************************************
FUNCTION ReadINI &&(cINIFile As String, cTopic AS String, cItem AS String)
AS String
LPARAMETERS cINIFile, cTopic, cItem
DECLARE INTEGER GetPrivateProfileString IN Win32API ;
STRING cTopic, ;
STRING cItem, ;
STRING cDefault, ;
STRING cValueBuf, ;
INTEGER nValueBufSize, ;
STRING cINIFile

PRIVATE cValue, nBuf
m.cValue = REPLICATE(CHR(0), 255)
m.nBuf = GetPrivateProfileString(m.cTopic, m.cItem, '', @cValue, 255,
m.cINIFile)
RETURN LEFT(m.cValue, m.nBuf)
ENDFUNC