rosaage

Untitled

Aug 15th, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.68 KB | None | 0 0
  1. Public Class Form1
  2.     Declare Sub mouse_event Lib "user32.dll" Alias "mouse_event" (ByVal dwFlags As Int32, ByVal dx As Int32, ByVal dy As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As Int32)
  3.  
  4.     Private Sub frmWinSamAppMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
  5.         Select Case e.KeyCode
  6.             Case Keys.F1
  7.                 Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position)
  8.                 mouse_event(&H2, 0, 0, 0, 1) 'Cursor will go down (like a click)
  9.                 mouse_event(&H4, 0, 0, 0, 1) 'Cursor goes up again End Sub
  10.         End Select
  11.     End Sub
  12. End Class
Advertisement
Add Comment
Please, Sign In to add comment