Article ID: 149487
Article Last Modified on 6/30/2004
#If Win32 Then
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) _
As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
#Else
Private Declare Sub GetWindowRect Lib "user" _
(ByVal hWnd As Integer,lpRect As RECT)
Private Declare Sub ClipCursor Lib "user" (lpRect As Any)
Private Declare Function GetDesktopHwnd Lib "user" () As Integer
Private Type RECT
left As Integer
top As Integer
right As Integer
bottom As Integer
End Type
Dim winrect As RECT
#If Win32 Then
Dim dskhwnd As Long
Dim suc As Long
dskhwnd = GetDesktopWindow()
suc = GetWindowRect(dskhwnd, winrect)
suc = ClipCursor(winrect)
#Else
Dim dskhwnd As Integer
Dim suc As Integer
dskhwnd = GetDesktopHwnd()
Call GetWindowRect(dskhwnd, winrect)
Call ClipCursor(winrect)
#End If
'Stop and/or all other code goes here
Private Sub DBGrid1_Click()
Stop
End Sub
Keywords: kbbug KB149487