VB工程--百例94--屏幕保护
来源:互联网 发布:郑渊洁 知乎 编辑:程序博客网 时间:2024/06/05 06:52
敲此例题时出现了一个问题,就是程序运行后,鼠标找不到啦!经过不懈努力和高人指点,这才把问题解决啦!自己不懂的还很多,编程路任重而道远。下面红色字体是注释,认真读写。
Option Explicit
Dim x, r
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then '按escape键退出
x = ShowCursor(True) 'ShowCursor 函数功能:该函数显示或隐藏光标。
End If
End Sub
Private Sub Form_Load()
' x = ShowCursor(False) 此句话的意思是光标隐藏 把false改成true光标同样出现
Form1.Width = Screen.Width
Form1.Height = Screen.Height
Form1.BackColor = RGB(0, 0, 255)
Label1.Top = (Screen.Height - Label1.Height) / 2
Label1.Left = 0
Label1.Caption = "廊坊师范学院信息技术提高班"
Label1.ForeColor = RGB(255, 0, 0)
Label1.FontItalic = True
Label2.Caption = "九期学员邢金聪"
Label2.ForeColor = RGB(0, 255, 255)
Label2.FontItalic = True
Label2.Left = (Screen.Width - Label2.Width) / 2
Label2.Top = 0
End Sub
Private Sub Timer1_Timer()
r = SetWindowPos(Form1.hwnd, -1, 0, 0, 0, 0, 3)
' BOOL SetWindowPos(HWND hWnd,HWND hWndlnsertAfter,int X,int Y,int cx,int cy,UNIT.Flags)
' h 是类型描述,表示句柄, Wnd 是变量对象描述,表示窗口,所以hWnd 表示窗口句柄
' 通俗地说,如果把一个到处跑的人当作指针的话,那么HWND就是该人的身份证
'http://baike.baidu.com/view/4287577.htm
Label1.Left = Label1.Left + 60
If Label1.Left > Form1.Width Then
Label1.Left = -3000
End If
Label2.Top = Label2.Top + 60
If Label2.Top > Form1.Height Then
Label2.Top = -3000
End If
End Sub
Option Explicit
Public Declare Function SetWindowPos Lib "user32" (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
http://baike.baidu.com/view/1080349.htm
Public Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
http://baike.baidu.com/view/1079919.htm
- VB工程--百例94--屏幕保护
- VB做的屏幕保护
- VB编程破解Windows屏幕保护密码
- VB编程破解Windows屏幕保护密码
- [VB.NET源码]文件系统及屏幕保护程式
- VB工程---百例45--同心圆.
- VB工程--百例47--球体.
- VB工程---百例75--状态栏
- VB工程--百例76--工具栏
- VB双进程保护
- 调用系统屏幕保护
- 调用屏幕保护
- 异类的屏幕保护
- 关闭屏幕保护
- 异类的屏幕保护
- 调用屏幕保护
- 字幕显示屏幕保护
- 禁用屏幕保护
- request_mem_region __request_region(&iomem_resource,(start),(n),(name))
- Oracle expdp/impdp 使用示例
- Processes and Threads 准备翻译敬请期待
- 猛然惊醒
- 单例模式
- VB工程--百例94--屏幕保护
- [转]Android Make脚本简记
- 如何去掉去掉VC++的安全警告提示
- Spring学习一之IOC工作原理 3
- lucene 3.5 例子
- Oracle 数据文件 实际使用量 计算说明
- JS打印相关内容
- 缓存+SqlCacheDependency(一)
- 2012最炙手可热的10项IT技术——相对应的技术书