Raveendra M Pai
Raveendra M Pai

Reputation: 445

How to remove a section from an INI file using Win32 API?

I would like to remove a section and also key values under the section from an INI file using Win32 API.

Can somebody tell me how can I do that?

Upvotes: 1

Views: 3790

Answers (1)

user1593881
user1593881

Reputation:

To delete the section and all the entries you will use the somewhat counter-intuitive function named WritePrivateProfileString with the lpKeyName parameter set to NULL. This will delete the entire section stored in the lpAppName field, including all the entries.

Upvotes: 9

Related Questions