-
October 1st, 2002, 10:37 PM
#1
Disable mouse
hi all
i am developing an application to control the RSLogix
Vb program will start and do all the required commands.
in meantime i do not want the user to access the application by mouse or keyboard by interventing the controlling process.
how can i do this i am unable to find a solution?
Any suggestion will be of great help
thanks
roopa
-
October 1st, 2002, 11:03 PM
#2
Dim x0 As Long
Dim y0 As Long
Dim b As Boolean
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub Command1_Click()
b = True
Dim pt As POINTAPI
GetCursorPos pt
x0 = pt.X
y0 = pt.Y
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If b Then SetCursorPos x0, y0
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If b Then SetCursorPos x0, y0
End Sub
or you can also Hide the mouse cursor using ShowCursor API
Public Declare Function ShowCursor Lib "user32" (ByVal lShow As Long) As Long
-
October 1st, 2002, 11:06 PM
#3
Show cursor works only within the Vb application.
my vb application will be running in the taskbar it is just a controller the main application is the RSLogix software which i am controlling
thanks
roopa
Originally posted by dinesh123
Dim x0 As Long
Dim y0 As Long
Dim b As Boolean
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub Command1_Click()
b = True
Dim pt As POINTAPI
GetCursorPos pt
x0 = pt.X
y0 = pt.Y
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If b Then SetCursorPos x0, y0
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If b Then SetCursorPos x0, y0
End Sub
or you can also Hide the mouse cursor using ShowCursor API
Public Declare Function ShowCursor Lib "user32" (ByVal lShow As Long) As Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|