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

📄 c.html

📁 windowsAPI介绍。很详细的
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//Netscape Comm. Corp.//DTD HTML//EN">
<html>

<head>
<title>Windows 95 API Dictionary: C</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">- C -</h1>

<hr ALIGN="center" WIDTH="85%" SIZE="5">

<p ALIGN="left"><a NAME="charlower"></a></p>

<h3 ALIGN="center">CharLower Function</h3>
<code>

<p align="center">Declare Function CharLower Lib &quot;user32.dll&quot; Alias 
&quot;CharLowerA&quot; (ByVal lpsz As String) As String</code><br>
CharLower converts the letters in a string to their lower-case equivalents. This function 
has the exact same purpose as Visual Basic's intrinsic LCase function. In fact, LCase is 
slightly faster and easier to use than CharLower, so use that instead. CharLower is in the 
API for programming languages that have no intrinsic function to do this. The converted 
string is returned.<br>
</p>

<table WIDTH="95%" BORDER="2" CELLSPACING="0">
  <tr>
    <td WIDTH="20%"><code>lpsz</code></td>
    <td WIDTH="80%">The string to convert. </td>
  </tr>
</table>
<b>

<p>Example:</b><br>
<code>&nbsp;&nbsp;'Both lines do the same thing.<br>
&nbsp;&nbsp;Debug.Print LCase$(&quot;Hello, world!&quot;)<br>
&nbsp;&nbsp;Debug.Print CharLower(&quot;Hello, world!&quot;)</code><br>
<br>
<b>Related Call:</b> <a HREF="#charupper">CharUpper</a><br>
<b>Category:</b> <a HREF="index.html#stringmanipulation" REL="Index">String Manipulation</a><br>
<a HREF="#top">返回到索引</a><a HREF="index.html" REL="Index">.</a> </p>

<hr ALIGN="center" WIDTH="85%" SIZE="5">

<p ALIGN="left"><a NAME="charupper"></a></p>

<h3 ALIGN="center">CharUpper Function</h3>
<code>

<p align="center">Declare Function CharUpper Lib &quot;user32.dll&quot; Alias 
&quot;CharUpperA&quot; (ByVal lpsz As String) As String</code><br>
CharUpper converts the letters in a string to their upper-case equivalents. This function 
has the exact same purpose as Visual Basic's intrinsic UCase function. In fact, UCase is 
slightly faster and easier to use than CharUpper, so use that instead. CharUpper is in the 
API for programming languages that have no intrinsic function to do this. The converted 
string is returned.<br>
</p>

<table WIDTH="95%" BORDER="2" CELLSPACING="0">
  <tr>
    <td WIDTH="20%"><code>lpsz</code></td>
    <td WIDTH="80%">The string to convert. </td>
  </tr>
</table>
<b>

<p>Example:</b><br>
<code>&nbsp;&nbsp;'Both lines do the same thing.<br>
&nbsp;&nbsp;Debug.Print UCase$(&quot;Hello, world!&quot;)<br>
&nbsp;&nbsp;Debug.Print CharUpper(&quot;Hello, world!&quot;)</code><br>
<br>
<b>Related Call:</b> <a HREF="#charlower">CharLower</a><br>
<b>Category:</b> <a HREF="index.html#stringmanipulation" REL="Index">String Manipulation</a><br>
<a HREF="#top">返回到索引</a><a HREF="index.html" REL="Index">.</a> </p>

<hr ALIGN="center" WIDTH="85%" SIZE="5">

<p ALIGN="left"><a NAME="choosecolor"></a></p>

<h3 ALIGN="center">ChooseColor Function</h3>
<code>

<p align="center">Declare Function ChooseColor Lib &quot;comdlg32.dll&quot; Alias 
&quot;ChooseColorA&quot; (pChoosecolor As <a HREF="appa.html#choosecolors">CHOOSECOLORS</a>) 
As Long</code><br>
ChooseColor displays the choose a color dialog box. While you can use the common dialog 
custom control to do this, you then have to include the large control file with your 
programs. This API call is both faster and uses fewer resources. All of the data you pass 
the function is a part of <code>pChoosecolor</code>, as well as the values chosen. The 
custom colors of the box are stored in a Byte-sized array in your code, although it must 
be converted into a Unicode string via the StrConv function before it's passed (see the 
example for a better idea of how this is done). The function returns 0 if the user chooses 
Cancel.<br>
</p>

<table WIDTH="95%" BORDER="2" CELLSPACING="0">
  <tr>
    <td WIDTH="20%"><code>pChoosecolor</code></td>
    <td WIDTH="80%">Contains all of the arguments passed to the function. Also holds the 
    chosen color and list of custom colors after the function is called. </td>
  </tr>
</table>
<b>

<p>Example:</b><br>
<code>&nbsp;&nbsp;'**Place this code in the (declarations) section of your code.**<br>
&nbsp;&nbsp;Dim customcolors() As Byte 'dynamic (resizable) array<br>
&nbsp;&nbsp;'**Place this code in the Form_Load Sub or other similar section.**<br>
&nbsp;&nbsp;ReDim customcolors(0 To 16 * 4 - 1) As Byte<br>
&nbsp;&nbsp;Dim i As Integer<br>
&nbsp;&nbsp;For i = LBound(customcolors) To UBound(customcolors)<br>
&nbsp;&nbsp;&nbsp;&nbsp;customcolors(i) = 0 'RGB value of a custom color<br>
&nbsp;&nbsp;Next i<br>
&nbsp;&nbsp;'**Code to actually create and use the dialog box.**<br>
&nbsp;&nbsp;Dim cc As CHOOSECOLORS, x As Long<br>
&nbsp;&nbsp;cc.hwndOwner = Form1.hWnd 'handle of calling form<br>
&nbsp;&nbsp;cc.lpCustColors = StrConv(customcolors, vbUnicode) 'convert array to string<br>
&nbsp;&nbsp;cc.flags = CC_ANYCOLOR 'allow any color to be chosen<br>
&nbsp;&nbsp;cc.lStructSize = Len(cc) 'size of variable<br>
&nbsp;&nbsp;x = ChooseColor(cc) 'call the dialog box<br>
&nbsp;&nbsp;If x = 0 Then Exit Sub 'if user chose Cancel<br>
&nbsp;&nbsp;Form1.BackColor = cc.rgbResult 'set form background to chosen color<br>
&nbsp;&nbsp;customcolors = StrConv(cc.lpCustColors, vbFromUnicode) 'restore array</code><br>
<br>
<b>Category:</b> <a HREF="index.html#commondialog" REV="Index">Common Dialog</a><br>
<a HREF="#top">返回到索引</a><a HREF="index.html" REL="Index">.</a> </p>

<hr ALIGN="center" WIDTH="85%" SIZE="5">

<p ALIGN="left"><a NAME="clipcursor"></a></p>

<h3 ALIGN="center">ClipCursor Function</h3>
<code>

<p align="center">Declare Function ClipCursor Lib &quot;user32.dll&quot; (lpRect As <a
HREF="appa.html#rect">RECT</a>) As Long</code><br>
ClipCursor confines the mouse cursor to a rectangular area of the screen. If the mouse 
starts outside of this rectangle or SetCursorPos tells it to go outside the area, the 
cursor will immediately be put back in. Nothing can get it out. The cursor will remain in 
the rectangle no matter what program you switch to, or even if you close the one that 
confined it. The only way to release it back into full-screen range is to confine it to a 
rectange the size of the screen (see example). It isn't usually a good idea to confine the 
cursor, because the user will expect to be able to move the cursor anywhere. The function 
returns a value which can be safely ignored.<br>
</p>

<table WIDTH="95%" BORDER="2" CELLSPACING="0">
  <tr>
    <td WIDTH="20%"><code>lpRect</code></td>
    <td WIDTH="80%">A RECT variable containing the upper-left and lower-right coordinates of 
    the confinement rectangle. </td>
  </tr>
</table>
<b>

<p>Example:</b><br>
<code>&nbsp;&nbsp;Dim r As RECT<br>
&nbsp;&nbsp;'This code confines the cursor to inside of Form1<br>
&nbsp;&nbsp;x = GetWindowRect(Form1.hWnd, r) 'API call puts a window size into a RECT<br>
&nbsp;&nbsp;x = ClipCursor(r) 'Confine the cursor<br>
&nbsp;&nbsp;'This code releases the cursor<br>
&nbsp;&nbsp;deskhWnd = GetDesktopWindow() 'API call gets the handle of the screen window<br>
&nbsp;&nbsp;x = GetWindowRect(deskhWnd, r) 'API call puts a window size into a RECT<br>
&nbsp;&nbsp;x = ClipCursor(r) 'Confine the cursor to the entire screen</code><br>
<br>
<b>Related Call:</b> <a HREF="g.html#getclipcursor">GetClipCursor</a><br>
<b>Category:</b> <a HREF="index.html#mouse" REL="Index">Mouse</a><br>
<a HREF="#top">返回到索引</a><a HREF="index.html" REL="Index">.</a> </p>

<hr ALIGN="center" WIDTH="85%" SIZE="5">

<p ALIGN="left"><a NAME="copyrect"></a></p>

<h3 ALIGN="center">CopyRect Function</h3>
<code>

<p align="center">Declare Function CopyRect Lib &quot;user32.dll&quot; (lpDestRect As <a
HREF="appa.html#rect">RECT</a>, lpSourceRect As <a HREF="appa.html#rect">RECT</a>) As Long</code><br>
CopyRect sets one RECT-type variable equal to another. This is done by duplicating all of 
the member values in the source rectangle to the corresponding values in the target 
rectangle. While you could do this manually in four commands setting each value equal, 
this is shorter to write and quicker to understand. You can safely ignore the value 
returned.<br>
</p>

<table WIDTH="95%" BORDER="2" CELLSPACING="0">
  <tr>
    <td WIDTH="20%"><code>lpDestRect</code></td>
    <td WIDTH="80%">The RECT to set the member values of. </td>
  </tr>
  <tr>
    <td><code>lpSourceRect</code></td>
    <td>The RECT to set the member values as. </td>
  </tr>
</table>
<b>

<p>Example:</b><br>
<code>&nbsp;&nbsp;'Set RECT target equal to RECT source<br>
&nbsp;&nbsp;Dim target As RECT, source As RECT<br>
&nbsp;&nbsp;x = GetWindowRect(Form1.hWnd, source) 'set source to size and shape of Form1<br>
&nbsp;&nbsp;x = CopyRect(target, source) 'now target.Left = source.Left etc.</code><br>
<br>
<b>Related Call:</b> <a HREF="e.html#equalrect">EqualRect</a><br>
<b>Category:</b> <a HREF="index.html#rectmanipulation" REL="Index">RECT Manipulation</a><br>
<a HREF="#top">返回到索引</a><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 + -