Tải bản đầy đủ (.pdf) (6 trang)

Giáo Trình How To Use AutoIt A Professional Manner part 99 ppsx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (22.74 KB, 6 trang )

WinDetectHiddenText

Specifies if hidden window text can be "seen" by the
window matching functions.
0 = Do not detect hidden text (default)
1 = Detect hidden text
WinSearchChildren
Allows the window search routines to search child
windows as well as top-level windows.
0 = Only search top-level windows (default)
1 = Search top-level and child windows
WinTextMatchMode
Alters the method that is used to match window text
during search operations.
1 = Complete / Slow mode (default)
2 = Quick mode
In quick mode AutoIt can usually only "see" dialog text,
button text and the captions of some controls. In the
default mode much more text can be seen (for instance
the contents of the Notepad window).
If you are having performance problems when
performing many window searches then changing to the
"quick" mode may help.
WinTitleMatchMode
Alters the method that is used to match window titles
during search operations.
1 = Match the title from the start (default)
2 = Match any substring in the title
3 = Exact title match
4 = Advanced mode, see Window Titles & Text
(Advanced)


-1 to -4 = force lower case match according to other type
of match.
WinWaitDelay
Alters how long a script should briefly pause after a
successful window-related operation.
Time in milliseconds to pause (default=250).

Related
Many!
Example

; copy any you want to change ;default value is listed first

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
AutoItWinGetTitle
Retrieves the title of the AutoIt window.
AutoItWinGetTitle ( )
Parameters
None.
Return Value
Returns a string containing the title of the AutoIt window.

Remarks
None.
Related
AutoItWinSetTitle, WinGetTitle
Example

$a = AutoItWinGetTitle()




Function Reference
AutoItWinSetTitle
Changes the title of the AutoIt window.
AutoItWinSetTitle ( "newtitle" )
Parameters
newtitle The new title to give to the window.

Return Value
None.
Remarks
The AutoIt window is usually hidden. The purpose of changing the title is to allow
other programs (or other AutoIt scripts) to interact with AutoIt.
Related
AutoItWinGetTitle, WinSetTitle
Example

AutoItWinSetTitle("My AutoIt Window")





Function Reference
BlockInput
Disable/enable the mouse and keyboard.
BlockInput ( flag )
Parameters
flag
1 = Disable user input
0 = Enable user input

Return Value
Success:

Returns 1.
Failure:

Returns 0. Already Enable or #requireAdmin not used.

Remarks
If BlockInput is enabled, the Alt keypress cannot be sent!
The table below shows how BlockInput behavior depends on the Windows
version; however, pressing Ctrl+Alt+Del on any platform will re-enable input due
to a Windows API feature.

Operating
System

"BlockInput" Results
Windows

2000
User input is blocked and AutoIt can simulate most input.
Windows
XP
User input is blocked and AutoIt can simulate most input. See
exceptions below.
Windows
Vista
User input is blocked and AutoIt can simulate most input if
#requireAdmin is used. See exceptions below.

If you are using Windows XP then you should be aware that a hotfix released in
between SP1 and SP2 limited Blockinput so that the ALT key could NOT be sent.
This was fixed in XP SP2.

Note that functions such as WinMove() or Send() will still work when BlockInput
is enabled because BlockInput just affects user interaction with the keyboard or
the mouse not what is done with AutoIt functions (aside from the exceptions in the
table above).
Related
Send
Example

BlockInput(1)

Run("notepad")
WinWaitActive("[CLASS:Notepad]")
Send("{F5}") ;pastes time and date

BlockInput(0)





Function Reference
Break
Enables or disables the users' ability to exit a script from the tray icon menu.
Break ( mode )
Parameters
mode
Sets the script break mode:
1 = Break is enabled (user can quit) (default)
0 = Break is disabled (user cannot quit)

Return Value

×