Kann ich per Vb die Mausposition auf dem Bildschirm bestimmen?
Oder kann ich, wenn die Maus auf ner bestimmten Position ist,
ein event ausführen? _________________
ja klar per api.
Folgender source bestimmt die maus position und verändert sie danach auf x und y achse um eine zufällige zahl. dadurch ensteht eine art von Vibrations Effekt des Cursors. hoffe es hilft dir.
Code:
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 X As Long
Private Y As Long
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Dim pT As POINTAPI
'Zwischenspeichern beim Laden, damit der Mauszeiger von dort startet,
'wo er momentan ist
GetCursorPos pT
MsgBox "Muuuuuuuhhh, Ich hoffe du hast an den möglichst großen exit button gedacht ^^"
Timer1.Interval = 1
Timer2.Interval = 1
Timer1.Enabled = True
Timer2.Enabled = True
End Sub