程序: 点击浏览程序
'Change The Mouse Pointer (taken from the AccWebFAQ MDB
'Copyright from Douglas J. Taylor
Private Const IDC_APPSTARTING = 32650&
Private Const IDC_ARROW = 32512&
Private Const IDC_CROSS = 32515&
Private Const IDC_IBEAM = 32513&
Private Const IDC_ICON = 32641&
Private Const IDC_NO = 32648&
Private Const IDC_SIZE = 32640&
Private Const IDC_SIZEALL = 32646&
Private Const IDC_SIZENESW = 32643&
Private Const IDC_SIZENS = 32645&
Private Const IDC_SIZENWSE = 32642&
Private Const IDC_SIZEWE = 32644&
Private Const IDC_UPARROW = 32516&
Private Const IDC_WAIT = 32514&
Private Declare Function apiLoadCursorBynum Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) _
As Long
Private Declare Function apiLoadCursorFromFile Lib "user32" _
Alias "LoadCursorFromFileA" _
(ByVal lpFileName As String) _
As Long
Private Declare Function apiSetCursor Lib "user32" _
Alias "SetCursor" _
(ByVal hCursor As Long) _
As Long
Public Function InsideCircle(img As Image, X As Single, Y As Single) As Boolean
'assume you are outside the circle
InsideCircle = False
If (X - (img.Width / 2)) ^ 2 + (Y - (img.Height / 2)) ^ 2 <= (img.Height / 2) ^ 2 Then
'Inside the circle
InsideCircle = True
End If
End Function
Public Sub ChangeCursor()
'based on the AccWebFAQ by Douglas Taylor
Dim strDBPath As String
Dim lngRet As Long
Const curNAME = "Cursor1.CUR"
strDBPath = CurrentDb.Name
strDBPath = Left(strDBPath, InStr(strDBPath, Dir(strDBPath)) - 1)
If Len(Dir(strDBPath & curNAME)) > 0 Then
lngRet = apiLoadCursorFromFile(strDBPath & curNAME)
lngRet = apiSetCursor(lngRet)
'PointM (strDBPath & curNAME)
End If
End Sub
[此贴子已经被作者于2002-10-16 23:32:30编辑过]
|