[ Nikolas_bg @ 23.04.2008. 10:20 ] @
Kako da saznam trenutne koordinate kursora (X,Y) ? |
[ Nikolas_bg @ 23.04.2008. 10:20 ] @
[ Aleksandar Ružičić @ 23.04.2008. 10:59 ] @
stavi na formu jedan tajmer (Timer1, podesi mu interval koji oces i stavi Enabled = True) i prekopiraj ovaj kod:
Code: Private Type Point X As Long Y As Long End Type Private Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As Point) As Long Private Sub Timer1_Timer Dim pt As Point GetCursorPos pt Debug.Print pt.x, pt.y End Sub [ dava @ 23.04.2008. 11:18 ] @
Ako pitas za polozaj kursora na datoj formi onda stavi ovo na tu formu pa probaj:
Code: Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Debug.Print X Debug.Print Y End Sub Ako zelis da dobije polozaj kursora na ekranu onda: Code: Option Explicit Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Type POINTAPI X As Long Y As Long End Type Private Sub Form_Load() Timer1.Interval = 1000 End Sub Private Sub Timer1_Timer() Dim Point As POINTAPI GetCursorPos Point Debug.Print Point.X Debug.Print Point.Y End Sub E pretekao si me :) Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|