vb 模拟鼠标按键
把鼠标移到屏幕指定位置 如(111.111) 单击一下
再移到屏幕另一指定位置指定位置 如(222.222)单击一下
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Sub Command1_Click()
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer2.Interval = 1000
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub Timer1_Timer()
Call SetCursorPos(111, 111) '让鼠标移动到(111,111)
mouse_event MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Private Sub Timer2_Timer()
Call SetCursorPos(2222, 2222) '让鼠标移动到(2222,2222)
mouse_event MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
http://zhidao.baidu.com/question/60142923.html?fr=qrl&cid=93&index=1
相关文档:
在Asp.net中实现文件的上传功能,是非常简单的一件事情,只需要利用微软提供的FileUpload控件即可轻松实现。
LargeFileUpload.aspx代码如下
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="LargeFileUpload.aspx.vb"
Inherits="LargeFileUpload" %>
<!DOCTYPE html PUBLIC "-//W3C/ ......
目的掌握一个简单的VB程序的建立、编辑、调试、运行和保存的方法。
操作步骤 ⑴进入VB环境,新建工程。方法是:如果出现“新建工程”对话框,则选择“标准.EXE”并点击[打开]按纽;或者直接点击菜单[文件]-[新建工程]。都会出现一个名为“Form1”的新窗体。
⑵从标准控件工具栏中向窗体加 ......
Option Explicit
Private Type UNICODE_STRING
Length As Integer
MaximumLength As Integer
Buffer As Long
End Type
Private Type OBJECT_ATTRIBUTES
Length As Long
RootDirectory As Long
  ......
内容提要摘要: The software of visual basic developed by Microsoft corporation is becoming one of the main develop tools at today。 As it's remarkable peculiarity, the Grid control has very great practical and active use。 This topic discusses how to use the grid control of VB to develop prati ......
Visual Basic有着强大的数据库存取能力,不仅能够直接支持Ms Access数据库,而且通过其内部安装的ISAM驱动程序使它能间接支持FoxPro、dBASE等外来数据库。本文不仅从VB数据库体系结构的角度探索了VB对这些外来数据库的支持,还结合了一些实例具体阐述了使用数据库存取对象变量的方法实现这些外来数据库的新建、库结构修改、 ......