CompuServe Thread

#Mod .INI's w/WriteProf..

4 messages in this thread
#2499From: Brightwork DevelopmentOct 10, 1991 4:25 PM
I'd like to modify SYSTEM.INI strings with VB, and I understand that I can make API calls to do this, however, I haven't been able to find any documentation on exactly how to do this. What I'm looking to do is to modify the keyboard= and mouse= line, and also to add a device= line in the SYSTEM.INI file. Any ideas? Tom Sollas [BDI] There are 2 Replies.
#2527From: Dennis L. HarringtonOct 10, 1991 7:36 PM
Tom, WritePrivateProfileString is exactly what the doctor ordered for changing string key values and WritePrivateProfileINT for changing integer key values. Both of these calls can be used to change, add or delete lines or entire sections from an .ini file. WriteProfileString and WriteProfileINT are two more that can be used exclusively with with WIN.INI. In addition to making the desired changes in the win.ini disk file, they also force windows to re-read and update its internal copy of win.ini after each use. I'm not sure, but my guess would be that you'll have to restart windows for any changes in system.ini to become effective. –dennis
#2530From: Don E WanlessOct 10, 1991 7:40 PM
Try "GetProfileString" and "WriteProfileString" Defined in Windows Programming ref. Good Luck Don There is 1 Reply.
#2561From: Rick Sands/OROct 10, 1991 11:13 PM
Be aware that WriteProfileInt does not seem to support neg values. I write boolean values as -FLAG since that makes -1 = 1 and 0 = 0. This way when you read them, you can just -FLAG to get a decent bool out of it. – Ricks