Advertisement
Guest User

Пример работы с курсором на Auto it 3

a guest
Feb 19th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. #include <GUIConstantsEx.au3>
  2. #include <StaticConstants.au3>
  3. #include <WindowsConstants.au3>
  4. #Region ### START Koda GUI section ### Form=C:\Users\abcdef\Desktop\Новая папка\Form1.kxf
  5. $Form1 = GUICreate("Form1", 433, 242, 298, 172)
  6. $Label1 = GUICtrlCreateLabel(" ", 32, 120, 271, 136)
  7. GUICtrlSetFont(-1, 20, 400, 0, "Arial")
  8. GUICtrlSetColor(-1, 0x000000)
  9. $tYCoord = GUICtrlCreateLabel("Y", 216, 24, 62, 31)
  10. GUICtrlSetFont(-1, 18, 400, 0, "Arial")
  11. $tXCoord = GUICtrlCreateLabel("X", 32, 24, 21, 31)
  12. GUICtrlSetFont(-1, 18, 400, 0, "Arial")
  13. $Label2 = GUICtrlCreateLabel("Label2", 72, 24, 100, 31)
  14. GUICtrlSetFont(-1, 18, 400, 0, "Arial")
  15. $Label3 = GUICtrlCreateLabel("Label3", 280, 24, 100, 31)
  16. GUICtrlSetFont(-1, 18, 400, 0, "Arial")
  17. GUISetState(@SW_SHOW)
  18.  
  19.  
  20. #EndRegion ### END Koda GUI section ###
  21.  
  22. $ixCoord = MouseGetPos()[0]
  23. $iyCoord = MouseGetPos()[1]
  24.  
  25. While 1
  26. $nMsg = GUIGetMsg()
  27. $xCoord = MouseGetPos()[0]
  28. $yCoord = MouseGetPos()[1]
  29. GUICtrlSetData($Label2, $xCoord)
  30. GUICtrlSetData($Label3, $yCoord & "_" & @SEC)
  31.  
  32. time()
  33. Switch $nMsg
  34. Case $GUI_EVENT_CLOSE
  35. Exit
  36.  
  37. EndSwitch
  38. WEnd
  39.  
  40.  
  41. Func time()
  42. If @SEC < 1 Then
  43. ;GUICtrlSetData($hLabel, "The current time is " & @HOUR & ":" & @MIN & ":" & @SEC & ".")
  44. ;$nCheck = @SEC
  45. If (($ixCoord = $xCoord) And ($iyCoord = $yCoord)) Then
  46. GUICtrlSetData($Label1, "Нихуя")
  47. Else
  48. GUICtrlSetData($Label1, "Вы за компом")
  49.  
  50. $ixCoord = MouseGetPos()[0]
  51. $iyCoord = MouseGetPos()[1]
  52. EndIf
  53.  
  54. EndIf
  55. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement