1. Trang chủ
  2. » Công Nghệ Thông Tin

AutoIT Help part 78 docx

5 272 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 69,09 KB

Nội dung

Opt("CaretCoordMode", 1) ;1=absolute, 0=relative, 2=client Opt("ExpandEnvStrings", 0) ;0=don't expand, 1=do expand Opt("ExpandVarStrings", 0) ;0=don't expand, 1=do expand Opt("FtpBinaryMode", 1) ;1=binary, 0=ASCII Opt("GUICloseOnESC", 1) ;1=ESC closes, 0=ESC won't close Opt("GUICoordMode", 1) ;1=absolute, 0=relative, 2=cell Opt("GUIDataSeparatorChar","|") ;"|" is the default Opt("GUIOnEventMode", 0) ;0=disabled, 1=OnEvent mode enabled Opt("GUIResizeMode", 0) ;0=no resizing, <1024 special resizing Opt("GUIEventOptions",0) ;0=default, 1=just notification, 2=GuiCtrlRead tab index Opt("MouseClickDelay", 10) ;10 milliseconds Opt("MouseClickDownDelay", 10) ;10 milliseconds Opt("MouseClickDragDelay", 250) ;250 milliseconds Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client Opt("MustDeclareVars", 0) ;0=no, 1=require pre-declare Opt("OnExitFunc","OnAutoItExit");"OnAutoItExit" called Opt("PixelCoordMode", 1) ;1=absolute, 0=relative, 2=client Opt("SendAttachMode", 0) ;0=don't attach, 1=do attach Opt("SendCapslockMode", 1) ;1=store and restore, 0=don't Opt("SendKeyDelay", 5) ;5 milliseconds Opt("SendKeyDownDelay", 1) ;1 millisecond Opt("TCPTimeout",100) ;100 milliseconds Opt("TrayAutoPause",1) ;0=no pause, 1=Pause Opt("TrayIconDebug", 0) ;0=no info, 1=debug line info Opt("TrayIconHide", 0) ;0=show, 1=hide tray icon Opt("TrayMenuMode",0) ;0=append, 1=no default menu, 2=no automatic check, 4=menuitemID not return Opt("TrayOnEventMode",0) ;0=disable, 1=enable Opt("WinDetectHiddenText", 0) ;0=don't detect, 1=do detect Opt("WinSearchChildren", 1) ;0=no, 1=search children also Opt("WinTextMatchMode", 1) ;1=complete, 2=quick Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to - 4=Nocase Opt("WinWaitDelay", 250) ;250 milliseconds Function Reference GUIGetCursorInfo trả lại vị trí và biểu tượng con trỏ chuột tương đối trên GUI GUIGetCursorInfo ( [winhandle] ) Parameters winhandle Windows handle đc trả lại bởi GUICreate (mặc định là GUI vừa được dùng). Return Value Success: trả lại mảng 5 phần tử: $array[0] = tọa độ X (ngang) của con trỏ (đang nhấp nháy này này) $array[1] = tọa độ Y (dọc) của con trỏ (đang nhấp nháy này này) $array[2] = 1 nếu chuột trái đc click, = 0 nếu ko click $array[3] = 1 nếu chuột phải đc click, = 0 nếu ko click $array[4] = controlID mà con chuột vừa chạy qua, = 0 nếu ko có Failure: 0 and set @error to 1 Remarks tọa độ x, y tính = pixel so với tọa độ của GUI The mouse cursor position is successful only on an window created by a GUICreate. When no winhandle it will be successful if the GUI Windows is active. ListViewItem or TreeViewItem controlID will never be returned, only the parent Listview or TreeView control ID is. Related GUICreate, GUIGetMsg Example #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Global $x, $y Example() Func Example() Local $msg HotKeySet("{Esc}", "GetPos") GUICreate("Press Esc to Get Pos", 400, 400) $x = GUICtrlCreateLabel("0", 10, 10, 50) $y = GUICtrlCreateLabel("0", 10, 30, 50) GUISetState() ; Run the GUI until the dialog is closed Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE EndFunc ;==>Example Func GetPos() Local $a $a = GUIGetCursorInfo() GUICtrlSetData($x, $a[0]) GUICtrlSetData($y, $a[1]) EndFunc ;==>GetPos Function Reference GUIGetMsg Polls the GUI to see if any events have occurred. GUIGetMsg ( [advanced] ) Parameters advanced [optional] return extended information in an array. 0 = (default) Returns a single event. 1 = returns an array containing the event and extended information. Return Value Returns an event, or an array depending on the "advanced" parameter. The "event" returned is the control ID of the control sending the message, or it is a special event (like the window is closing, minimizing). Or if there is no message, the event is 0. Event ID the ID of the control sending the message 0 No event $GUI_EVENT_CLOSE dialog box being closed (either by defined button or system menu). $GUI_EVENT_MINIMIZE dialog box minimized with Windows title bar button. $GUI_EVENT_RESTORE dialog box restored by click on task bar icon. $GUI_EVENT_MAXIMIZE dialog box maximized with Windows title bar button. $GUI_EVENT_MOUSEMOVE the mouse cursor has moved. $GUI_EVENT_PRIMARYDOWN the primary mouse button was pressed. $GUI_EVENT_PRIMARYUP the primary mouse button was released. $GUI_EVENT_SECONDARYDOWN the secondary mouse button was pressed. $GUI_EVENT_SECONDARYUP the secondary mouse button was released. $GUI_EVENT_RESIZED dialog box has been resized. $GUI_EVENT_DROPPED End of a Drag&Drop action @GUI_DRAGID, @GUI_DRAGFILE and @GUI_DROPID will be used to retrieve the ID's/file corresponding to the involve control. When using the "advanced" parameter the information is returned in an array with extended information: $array[0] = 0 or Event ID or Control ID $array[1] = The window handle the event is from $array[2] = The control handle the event is from (if applicable) $array[3] = The current X position of the mouse cursor (relative to the GUI window) $array[4] = The current Y position of the mouse cursor (relative to the GUI window) If the GUIOnEventMode option is set to 1 then the return from GUIGetMsg is always 0 and the @error is set to 1. If the option GUIEventOptions is set to 1 the minimize, restore and maximize button will not do any action on the window just a simple notification. Remarks This function automatically idles the CPU when required so that it can be safely used in tight loops without hogging all the CPU. Information about the mouse position and the hovering control can be retrieved with GUIGetCursorInfo. No event is fired when the mouse is over a control so GUIGetCursorInfo must be called to retrieve the ControlID. Related . Opt("MustDeclareVars", 0) ;0=no, 1=require pre-declare Opt("OnExitFunc","OnAutoItExit");"OnAutoItExit" called Opt("PixelCoordMode", 1) ;1=absolute, 0=relative,

Ngày đăng: 02/07/2014, 17:21

TỪ KHÓA LIÊN QUAN