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

📄 990125

📁 一套经典的asp教程 本人受益颇多 特推荐之 直接解压无密码
💻
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" content="KJ Wang">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>如何让屏幕保护程序在“小屏幕”上面跑?</title>
</head>

<body bgcolor="#FFFFFF" link="#FF0000" vlink="#000080"
alink="#FF0000">

<h2 align="center"><font color="#FF0000">新概念的 Visual
Basic 6.0 教程 - </font><font color="#FF0000" size="5"><b>补充教材</b></font></h2>

<hr>

<h2>如何让屏幕保护程序在“小屏幕”上面跑?(99/01/25)</h2>

<hr>

<p align="center"><img src="preview.gif" width="422" height="448"></p>

<p align="left"><font color="#0000FF">以书本 16-3 节的
Saver03.vbp 为基础</font>, 首先在 Saver03.frm
窗体的最上面增加以下提示:</p>

<blockquote>
    <p align="left">Private Type RECT<br>
    Left As Long<br>
    Top As Long<br>
    Right As Long<br>
    Bottom As Long<br>
    End Type<br>
    <br>
    Const WS_CHILD = &amp;H40000000<br>
    Const GWL_HWNDPARENT = (-8)<br>
    Const GWL_STYLE = (-16)<br>
    Const HWND_TOPMOST = -1&amp;<br>
    Const HWND_TOP = 0&amp;<br>
    Const HWND_BOTTOM = 1&amp;<br>
    <br>
    Const SWP_NOSIZE = &amp;H1&amp;<br>
    Const SWP_NOMOVE = &amp;H2<br>
    Const SWP_NOZORDER = &amp;H4<br>
    Const SWP_NOREDRAW = &amp;H8<br>
    Const SWP_NOACTIVATE = &amp;H10<br>
    Const SWP_FRAMECHANGED = &amp;H20<br>
    Const SWP_SHOWWINDOW = &amp;H40<br>
    Const SWP_HIDEWINDOW = &amp;H80<br>
    Const SWP_NOCOPYBITS = &amp;H100<br>
    Const SWP_NOOWNERZORDER = &amp;H200<br>
    Const SWP_DRAWFRAME = SWP_FRAMECHANGED<br>
    Const SWP_NOREPOSITION = SWP_NOOWNERZORDER<br>
    <br>
    Private Declare Function GetClientRect Lib &quot;user32&quot;
    (ByVal hwnd As Long, lpRect As RECT) As Long<br>
    Private Declare Function GetWindowLong Lib &quot;user32&quot;
    Alias &quot;GetWindowLongA&quot; (ByVal hwnd As Long, ByVal
    nIndex As Long) As Long<br>
    Private Declare Function SetWindowLong Lib &quot;user32&quot;
    Alias &quot;SetWindowLongA&quot; (ByVal hwnd As Long, ByVal
    nIndex As Long, ByVal dwNewLong As Long) As Long<br>
    Private Declare Function SetParent Lib &quot;user32&quot;
    (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As
    Long<br>
    Private Declare Sub SetWindowPos Lib &quot;user32&quot;
    (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)</p>
</blockquote>

<p align="left">接着将 Saver03.frm 窗体以下的语句:</p>

<blockquote>
    <div align="left"><pre><font size="4">If UCase(Left(Command, 2)) = &quot;/P&quot; Then ' 小屏幕
    Unload Me: End
End If</font></pre>
    </div>
</blockquote>

<p align="left">修改成:</p>

<blockquote>
    <div align="left"><pre><font size="4">If UCase(Left(Command, 2)) = &quot;/P&quot; Then ' 小屏幕
    Dim hwndDsp As Long
    Dim r As RECT

    hwndDsp = Val(Mid(Command, 3))
    GetClientRect hwndDsp, r
    Me.Caption = &quot;Preview&quot;
    Style = GetWindowLong(Me.hwnd, GWL_STYLE)
    Style = Style Or WS_CHILD
    SetWindowLong Me.hwnd, GWL_STYLE, Style

    SetParent Me.hwnd, hwndDsp
    SetWindowLong Me.hwnd, GWL_HWNDPARENT, hwndDsp
    SetWindowPos Me.hwnd, HWND_TOP, 0&amp;, 0&amp;, r.Right, r.Bottom, SWP_NOZORDER Or SWP_NOACTIVATE Or SWP_SHOWWINDOW

End If</font></pre>
    </div>
</blockquote>

<p align="left">或者直接<a href="saver03.frm">下载笔者所修改之后的
saver03.frm</a> 以取代原有的 saver03.frm 文件。</p>

<hr>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -