我创建了一个宏来执行一系列鼠标单击和鼠标移动(击键宏),将重复的数据输入到Oracle (程序/数据库)中。
我以前使用过Dataload或Dataload(击键程序)将数据输入Oracle,但它缺乏“智能”,所以我用一些“智能”创建了自己的击键程序。
我使用睡眠命令/函数在每次鼠标移动和鼠标单击后等待几秒钟/毫秒。有时,Oracle会慢下来,“暂停”/“加载”/or“冻结”,冻结时间可能会超过睡眠命令的初始等待时间,并继续执行程序,从而使一切变得一团糟。
示例:
如果something_happens那么
睡眠2000
结束如果
在DataLoad经典/Dataloader经典中,有一些选项可以更改每次鼠标单击或鼠标移动的等待/暂停时间,等等。有“沙漏检查”。这表示,如果鼠标处于沙漏状态,并且用户可能输入毫秒或秒,则可以设置程序等待的时间。
是否有Excel代码来检查鼠标的沙漏状态?
发布于 2016-01-18 19:49:29
您可以尝试以下函数,该函数使用win函数LoadCursor和GetCursorInfo来确定当前游标是否等于等待游标。
函数首先加载win预定义的等待游标,然后获取当前游标并检查它们是否相同。HTH
Option Explicit
Private Const IDC_WAIT As Long = 32514
Private Type POINT
x As Long
y As Long
End Type
Private Type CURSORINFO
cbSize As Long
flags As Long
hCursor As Long
ptScreenPos As POINT
End Type
Private Declare Function GetCursorInfo _
Lib "user32" (ByRef pci As CURSORINFO) As Boolean
Private Declare Function LoadCursor _
Lib "user32" Alias "LoadCursorA" _
(ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Public Function IsWaitCursor() As Boolean
' Get handle to wait cursor
Dim handleWaitCursor As Long
handleWaitCursor = LoadCursor(ByVal 0&, IDC_WAIT)
Dim pci As CURSORINFO
pci.cbSize = Len(pci)
' Retrieve information about the current cursor
Dim ret As Boolean
ret = GetCursorInfo(pci)
If ret = False Then
MsgBox "GetCursorInfo failed", vbCritical
Exit Function
End If
' Returns true when current cursor equals to wait cursor
IsWaitCursor = (pci.hCursor = handleWaitCursor)
End Function发布于 2016-01-19 16:31:02
如果忙,试着检查screen.MousePointer属性(夏尔玻璃)
While screen.MousePointer = 11
Sleep(500)
Wendhttps://stackoverflow.com/questions/34799287
复制相似问题