WriteProfileString

此頁沒有內(nèi)容條目
內(nèi)容

WriteProfileString

VB聲明

Declare Function WriteProfileString Lib "kernel32" Alias "WriteProfileStringA" (ByVal lpszSection As String, ByVal lpszKeyName As String, ByVal lpszString As String) As Long

說明

在Win.ini初始化文件指定小節(jié)內(nèi)設(shè)置一個字串

返回值

Long,非零表示成功,零表示失敗。會設(shè)置GetLastError

參數(shù)表

參數(shù)

類型及說明

lpszSection

String,指定要在其中寫入新串的小節(jié)。如尚不存在,會創(chuàng)建這個小節(jié)。這個字串不區(qū)分大小寫

lpszKeyName

String,要設(shè)置的項名或條目名。這個字串不區(qū)分大小寫。用vbNullString可刪除這個小節(jié)的所有設(shè)置項

lpszString

String,指定為這個項寫入的字串值。用vbNullString表示刪除這個項現(xiàn)有的字串

注解

注意對Win.ini文件的改動可能影響其他應(yīng)用程序。如修改了正由其他應(yīng)用程序使用的小節(jié),一定要向所有窗口都發(fā)送一條WM_WININICHANGE消息

Top