📄 w.html
字号:
<!DOCTYPE html PUBLIC "-//Netscape Comm. Corp.//DTD HTML//EN">
<html>
<head>
<title>Windows 95 API Dictionary: W</title>
<base TARGET="_self">
<script LANGUAGE="JavaScript">
<!--Cloak
function statbar(txt) {
window.status = txt;
setTimeout("erase()",3000);
}
function erase() {
window.status = "";
}
//Decloak-->
</script>
</head>
<body BGCOLOR="#004000" TEXT="#FFFFFF" LINK="#FFFF00" VLINK="#FF8000" ALINK="#80FF80">
<p><a NAME="top"></a></p>
<h1 ALIGN="center">- W -</h1>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="writeprivateprofilestring"></a></p>
<h3 ALIGN="center">WritePrivateProfileString Function</h3>
<code>
<p align="center">Declare Function WritePrivateProfileString Lib "kernel32.dll"
Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal
lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long</code><br>
WritePrivateProfileString sets a value inside of any INI file. Although the function name
seems to say otherwise, this works with integer values as well as strings. If the INI file
you try to write to does not exist, it will be created. If the section or value you try to
set does not exist, it will also be created. It is safe to ignore the value returned.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH-20%><code>lpApplicationName</code></td>
<td WIDTH="80%">The section of the INI file to write to. This is the name inside of
brackets, but do not include the brackets in the parameter. </td>
</tr>
<tr>
<td><code>lpKeyName</code></td>
<td>The name of the value to set. This is the name on the left side of the = sign. </td>
</tr>
<tr>
<td><code>lpString</code></td>
<td>The string or integer value to write. This is what will appear on the right side of
the = sign. </td>
</tr>
<tr>
<td><code>lpFileName</code></td>
<td>The filename of the INI file to write to. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> 'Edit the "scrnsave.exe" setting in the [boot] section of
SYSTEM.INI<br>
'(This assumes your Windows directory is C:\Windows)<br>
'(NOTE: this is an example. It is best not to edit system files like this)<br>
x = WritePrivateProfileString("boot", "scrnsave.exe",
"C:\WINDOWS\SYSTEM\SCROLL~1.SCR", "c:\windows\system.ini")<br>
Form1.Print "Screen saver set to Scrolling Marquee."</code><br>
<br>
<b>Related Calls:</b> <a HREF="g.html#getprivateprofilestring">GetPrivateProfileString</a>,
<a HREF="#writeprofilestring">WriteProfileString</a><br>
<b>Category:</b> <a HREF="index.html#inifiles" REL="Index">INI Files</a><br>
<a HREF="index.html" REL="Index">返回到索引.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="writeprofilestring"></a></p>
<h3 ALIGN="center">WriteProfileString Function</h3>
<code>
<p align="center">Declare Function WriteProfileString Lib "kernel32.dll" Alias
"WriteProfileStringA" (ByVal lpszSection As String, ByVal lpszKeyName As String,
ByVal lpszString As String) As Long</code><br>
WriteProfileString sets a string value inside of the WIN.INI file. Although the function
name seems to say otherwise, you can write numbers to the file if you encase them in
quotes. If the section or value you try to set does not exist, it will also be created. It
is safe to ignore the value returned. This is basically a watered-down version of
WritePrivateProfileString because, unlike that, WriteProfileString only works with
WIN.INI.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH-20%><code>lpszSection</code></td>
<td WIDTH="80%">The section of WIN.INI to write to. This is the name inside of brackets,
but do not include the brackets in the parameter. </td>
</tr>
<tr>
<td><code>lpszKeyName</code></td>
<td>The name of the value to set. This is the name on the left side of the = sign. </td>
</tr>
<tr>
<td><code>lpszString</code></td>
<td>The string or integer value to write. This is what will appear on the right side of
the = sign. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> 'Edit the "Wallpaper" setting in the [Desktop] section of
WIN.INI<br>
'(NOTE: this is an example. It is best not to edit system files like this)<br>
x = WriteProfileString("Desktop", "Wallpaper",
"C:\WINDOWS\CLOUDS.BMP")<br>
Form1.Print "Wallpaper set to CLOUDS.BMP"</code><br>
<br>
<b>Related Calls:</b> <a HREF="g.html#getprofilestring">GetProfileString</a>, <a
HREF="#writeprivateprofilestring">WritePrivateProfileString</a><br>
<b>Category:</b> <a HREF="index.html#inifiles" REL="Index">INI Files</a><br>
<a HREF="index.html" REL="Index">返回到索引.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -