home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 January / PCWELT_1_2006.ISO / pcwsoft / autoit-v3-setup.exe / Examples / GUIGetCursorInfo.au3 < prev    next >
Encoding:
Text File  |  2005-01-07  |  431 b   |  21 lines

  1. #include <GUIConstants.au3>
  2. $IDC = 0
  3. HotkeySet("{Esc}", "GetPos")
  4.  
  5. GUICreate("Press Esc to Get Pos", 400, 400)
  6. $x=GUICtrlCreateLabel ("0", 10, 10,50)
  7. $y=GUICtrlCreateLabel ("0", 10, 30,50)
  8. GUISetState()
  9.  
  10. ; Run the GUI until the dialog is closed
  11. Do
  12. $msg = GUIGetMsg()
  13. Until $msg = $GUI_EVENT_CLOSE
  14. Exit
  15.  
  16. Func GetPos()
  17.     $a=GUIGetCursorInfo()
  18.     GUIctrlSetData($x,$a[0]) 
  19.     GUIctrlSetData($y,$a[1]) 
  20. EndFunc
  21.