📄 s.html
字号:
<!DOCTYPE html PUBLIC "-//Netscape Comm. Corp.//DTD HTML//EN">
<html>
<head>
<title>Windows 95 API Dictionary: S</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">- S -</h1>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="setcursorpos"></a></p>
<h3 ALIGN="center">SetCursorPos Function</h3>
<code>
<p align="center">Declare Function SetCursorPos Lib "user32.dll" (ByVal x As
Long, ByVal y As Long) As Long</code><br>
SetCursorPos moves the position of the mouse cursor. The coordinates are measured in
pixels. If you try to put the mouse outside of the screen area (for example, 700,40 on a
640x480 display), it will simply go to the edge of the screen. You can safely ignore the
returned value.<br>
</p>
<table WIDTH="95%" CELLSPACING="0" BORDER="2">
<tr>
<td WIDTH="20%"><code>x</code></td>
<td>The x coordinate to move the cursor to. </td>
</tr>
<tr>
<td><code>y</code></td>
<td>The y coordinate to move the cursor to. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> x = SetCursorPos(320, 240) 'Center of a 640x480 display</code><br>
<br>
<b>Related Call:</b> <a HREF="g.html#getcursorpos">GetCursorPos</a><br>
<b>Category:</b> <a HREF="index.html#mouse" REL="Index">Mouse</a><br>
<a HREF="index.html" REL="Index">返回到索引.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="setfileattributes"></a></p>
<h3 ALIGN="center">SetFileAttributes</h3>
<code>
<p align="center">Declare Function SetFileAttributes Lib "kernel32.dll" Alias
"SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As
Long) As Long</code><br>
SetFileAttributes changes the attributes of a file or directory. The file attributes you
can change are archive, read-only, hidden, and system (other attributes are fixed, such as
compressed). Each of these four attributes can be turned on or off. You can safely ignore
the error code returned.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH="20%"><code>lpFileName</code></td>
<td WIDTH="80%">The filename or directory, including its full path, you want to change the
attributes of. </td>
</tr>
<tr>
<td><code>dwFileAttributes</code></td>
<td>One or more of the <a HREF="appb.html#fileattributeflags">file attribute flags</a>.
FILE_ATTRIBUTE_COMPRESSED and FILE_ATTRIBUTE_DIRECTORY cannot be set. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> 'Hide file c:\apps\data.dat from the user<br>
x = SetFileAttributes("C:\Apps\data.dat", FILE_ATTRIBUTE_ARCHIVE Or
FILE_ATTRIBUTE_HIDDEN)<br>
'Keep it an archive file to retain its normal access status.</code><br>
<br>
<b>Related Call:</b> <a HREF="g.html#getfileattributes">GetFileAttributes</a><br>
<b>Category:</b> <a HREF="index.html#fileio" REL="Index">File I/O</a><br>
<a HREF="index.html" REL="Index">返回到索引.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="setparent"></a></p>
<h3 ALIGN="center">SetParent Function</h3>
<code>
<p align="center">Declare Function SetParent Lib "user32.dll" (ByVal hWndChild
As Long, ByVal hWndNewParent As Long) As Long</code><br>
SetParent moves a control from one parent object to another. That's right -- the object
itself moves from its original parent to another one. Its relative position is the same
(if it was 40 pixels to the right and 50 down from the upper-left corner in the original
control, it will be 40 pixels right and 50 down from the upper-left corner in the new
control). If successful, the function returns the handle of the parent control from which
the control was moved.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH="20%"><code>hWndChild</code></td>
<td WIDTH="80%">The handle of the control you wish to move. </td>
</tr>
<tr>
<td><code>hWndNewParent</code></td>
<td>The handle of the control to be the new parent of the object. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> 'Moves a button from Frame1 to Frame2<br>
oldhwnd = SetParent(Command1.hWnd, Frame2.hWnd)<br>
Form1.Print Frame1.hWnd; oldhwnd 'should be the same</code><br>
<br>
<b>Related Call:</b> <a HREF="g.html#getparent">GetParent</a><br>
<b>Category:</b> <a HREF="index.html#windows" REL="Index">Windows</a><br>
<a HREF="index.html" REL="Index">返回到索引.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="setrect"></a></p>
<h3 ALIGN="center">SetRect Function</h3>
<code>
<p align="center">Declare Function SetRect Lib "user32.dll" (lpRect As <a
HREF="appa.html#rect">RECT</a>, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long,
ByVal Y2 As Long) As Long</code><br>
SetRect sets the four member values of a RECT-type variable. This has the same effect as
manually setting the .Left, .Top, .Right, and .Bottom settings equal to what you want, but
the function takes one line instead of four to do so. You can safely ignore the value
returned.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH="20%"><code>lpRect</code></td>
<td WIDTH="80%">The RECT-type variable to set the values of. </td>
</tr>
<tr>
<td><code>X1</code></td>
<td>The value to set the .Left property as. </td>
</tr>
<tr>
<td><code>Y1</code></td>
<td>The value to set the .Top property as. </td>
</tr>
<tr>
<td><code>X2</code></td>
<td>The value to set the .Right property as. </td>
</tr>
<tr>
<td><code>Y2</code></td>
<td>The value to set the .Bottom property as. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> Dim r As RECT 'How to set a RECT-type variable without
SetRect:<br>
r.Left = 50<br>
r.Top = 20<br>
r.Right = 100<br>
r.Bottom = 70<br>
'How to do the same using the function<br>
x = SetRect(r, 50, 20, 100, 70)</code><br>
<br>
<b>Related Call:</b> <a HREF="#setrectempty">SetRectEmpty</a><br>
<b>Category:</b> <a HREF="index.html#rectmanipulation" REL="Index">RECT Manipulation</a><br>
<a HREF="index.html" REL="Index">返回到索引.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="setrectempty"></a></p>
<h3 ALIGN="center">SetRectEmpty Function</h3>
<code>
<p align="center">Declare Function SetRectEmpty Lib "user32.dll" (lpRect As <a
HREF="appa.html#rect">RECT</a>) As Long</code><br>
SetRectEmpty sets a RECT-type variable to an empty state. This function sets all of the
member values of a rectangle to 0. This type of rectangle is considered empty because it
has no width nor height. You can safely ignore the value returned.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH="20%"><code>lpRect</code></td>
<td WIDTH="80%">The rectange to set as being empty. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> 'Set rectangle r to an empty state<br>
Dim r As RECT<br>
x = SetRectEmpty(r) 'now r.Left = 0 etc.</code><br>
<br>
<b>Related Calls:</b> <a HREF="i.html#isrectempty">IsRectEmpty</a>, <a HREF="#setrect">SetRect</a><br>
<b>Category:</b> <a HREF="index.html#rectmanipulation" REL="Index">RECT Manipulation</a><br>
<a HREF="index.html" REL="Index">返回到索引.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="setwindowpos"></a></p>
<h3 ALIGN="center">SetWindowPos Function</h3>
<code>
<p align="center">Declare Function SetWindowPos Lib "user32.dll" (ByVal hwnd As
Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long,
ByVal cy As Long, ByVal wFlags As Long) As Long</code><br>
SetWindowPos moves a window to a new location in all three dimensions. You can change its
coordinate position as well as its Z-order position (the Z-order says which windows are on
top of others). You can also resize the window. This is similar, but much more powerful,
to setting a window's .Left, .Top, .Right, .Bottom, and other properties manually. You can
safely ignore the value returned.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH="20%"><code>hwnd</code></td>
<td WIDTH="80%">The handle of the window to move. </td>
</tr>
<tr>
<td><code>hWndInsertAfter</code></td>
<td>Either the handle of the window to position this window behind, or one of the <a
HREF="appb.html#insertafterflags">insert after flags</a> stating where in the Z-order to
put the window. </td>
</tr>
<tr>
<td><code>x</code></td>
<td>The x coordinate of the upper-left corner of the window (the window's .Left property).
</td>
</tr>
<tr>
<td><code>y</code></td>
<td>The y coordinate of the upper-left corner of the window (the window's .Top property). </td>
</tr>
<tr>
<td><code>cx</code></td>
<td>The x coordinate of the lower-right corner of the window (the window's .Right
property). </td>
</tr>
<tr>
<td><code>cy</code></td>
<td>The y coordinate of the lower-right corner of the window (the window's .Bottom
property). </td>
</tr>
<tr>
<td><code>wFlags</code></td>
<td>Zero, one, or more of the <a HREF="appb.html#setwindowposflags">SetWindowPos flags</a>
stating how to move the window. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> 'Move Form1 to the upper-left corner of the screen, above any other
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -