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/ ......
一。数据类型
Byte 1
字节 无符号
Interger 2
字节
Long 4
字节
Float 4
字节
Double 8
字节
String
Date
Boolean
Currency
Variant
2.
变长字符串和定长字符
系统默认初始值为空字符串;
变长字符串:di ......
帮朋友改的一小段关键词分析代码; 含两个单词复合计数
Private Function CollectWords() As Dictionary(Of String, Integer)
'Create a new dictionary
Dim table As New Dictionary(Of String, Integer)
'Prompt for the user
Console.WriteLine(
"Enter a line : ")
'Get the user's input
Dim input As St ......
内容提要摘要: 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 ......
Dim ReturnValue, I
ReturnValue = Shell("Calc.EXE", 1) ' 运行计算器。
AppActivate ReturnValue ' 激活计算器。
For I = 1 To 100 ' 设置计数循环。
SendKeys I & "{+}", True ' 按下按键给计算器
Next I ' 将所有 I 值相加。
SendKeys "=", True ' 取得总合。
SendKeys "%{F4}", True ' 按 ALT+F4 关 ......