Programming
Using APIs to program the cursor in VB6:
Option explicitprivate Type pointapi X as long Y as Longend typeprivate Declare Functi On GetCursorPos Lib "user32" (Lppoint as Pointapi) as Longprivate Declare Function showcursor Lib "user32" (ByVal bshow as Long) as Longpublic Function Getxcursorpos () as long Dim pt as pointapi GetCursorPos Pt &nbs P Getxcursorpos = Pt. Xend functionpublic Function Getycursorpos () as long Dim pt as pointapi GetCursorPos Pt &nbs P Getycursorpos = Pt. Yend Function ' Gets the position of the cursor in the screen private Sub form_mousemove (Button As Integer, Shift As Integer, X as single, Y as single) & nbsp; Label1.Caption = "X screen Position =" & getxcursorpos label2.caption = "Y screen posit Ion = "& Getycursorposend Sub ' hidden cursor private Sub Command1_Click () showcursor FalseEnd Sub ' show cursor private Sub Command2_Click () showcursor TrueEnd sub
' Hide cursor Private Sub button1_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Button1.Click Cursor.hide () End Sub ' Gets the position of the cursor in the screen Private Sub form2_mousemove (ByVal sender as Object, ByVal e as System.window S.forms.mouseeventargs) Handles Mybase.mousemove Me.Label1.Text = "X screen Position =" & cursor.position.x Me.Label2.Text = "Y screen Position =" & Cursor.position.y End Sub "displays cursor Private Sub button2_click (Byva L sender as System.Object ByVal e as System.EventArgs) Handles Button2.click cursor.show () End Sub
Very simple things, more examples, can refer to API manuals and framework documentation.