View Full Version : حرکات ماوس
  
na30mbarnameh
پنج شنبه 04 بهمن 1386, 09:04 صبح
چطوری می توانم باتوابع Api کاری کنم که ماوس روی دکمه یStart  نتواند برود؟:ناراحت:
ftmotlagh
پنج شنبه 04 بهمن 1386, 18:23 عصر
شما باید از تابع  GetCursorPos SetCursorPos
برای مثال در یک فرم یک تایمر قرار دهید و Interval را مساوی 10 یا کمتر قرار دهید و کد زیر را بزنید...
Private Type POINTAPI
  x As Long
  y As Long
End Type
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 Sub Timer1_Timer()
  Dim Pt As POINTAPI
    GetCursorPos Pt
    If Pt.y < 730 Then
    If Pt.x < 90 Then
    SetCursorPos 1000, 0
    End If
    End If
End Sub
Mbt925
شنبه 06 بهمن 1386, 01:02 صبح
شما باید از تابع  GetCursorPos SetCursorPos
برای مثال در یک فرم یک تایمر قرار دهید و Interval را مساوی 10 یا کمتر قرار دهید و کد زیر را بزنید...
Private Type POINTAPI
  x As Long
  y As Long
End Type
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 Sub Timer1_Timer()
  Dim Pt As POINTAPI
    GetCursorPos Pt
       If Pt.y > 760 And Pt.x < 100 Then
    
        SetCursorPos 100, 760
        
    End If
End Sub
اینطوری بهتره.
 
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.