⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 w.html

📁 windowsAPI介绍。很详细的
💻 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 &quot;kernel32.dll&quot; 
Alias &quot;WritePrivateProfileStringA&quot; (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>&nbsp;&nbsp;'Edit the &quot;scrnsave.exe&quot; setting in the [boot] section of 
SYSTEM.INI<br>
&nbsp;&nbsp;'(This assumes your Windows directory is C:\Windows)<br>
&nbsp;&nbsp;'(NOTE: this is an example. It is best not to edit system files like this)<br>
&nbsp;&nbsp;x = WritePrivateProfileString(&quot;boot&quot;, &quot;scrnsave.exe&quot;, 
&quot;C:\WINDOWS\SYSTEM\SCROLL~1.SCR&quot;, &quot;c:\windows\system.ini&quot;)<br>
&nbsp;&nbsp;Form1.Print &quot;Screen saver set to Scrolling Marquee.&quot;</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 &quot;kernel32.dll&quot; Alias 
&quot;WriteProfileStringA&quot; (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>&nbsp;&nbsp;'Edit the &quot;Wallpaper&quot; setting in the [Desktop] section of 
WIN.INI<br>
&nbsp;&nbsp;'(NOTE: this is an example. It is best not to edit system files like this)<br>
&nbsp;&nbsp;x = WriteProfileString(&quot;Desktop&quot;, &quot;Wallpaper&quot;, 
&quot;C:\WINDOWS\CLOUDS.BMP&quot;)<br>
&nbsp;&nbsp;Form1.Print &quot;Wallpaper set to CLOUDS.BMP&quot;</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 + -