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

Giáo Trình How To Use AutoIt A Professional Manner part 97 ppt

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 (18.4 KB, 6 trang )


Return Value
Return the Handle of the splash window that can be used in ControlSetText.
Remarks
To skip an optional parameter, leaving it's default value intact, use:
"" for a string parameters
-1 for a numeric parameters

Only one SplashImage/Text window is allowed at one time; so if you wish to cycle
through multiple images/text, simply call SplashImageOn/SplashTextOn again
with the new information.

Even better is to use ControlSetText to update text without flicker
If the text is center and multiline, the ControlSetText will not override the number
of lines created by the SplashTextOn.

Splash with opt=1 cannot be moved and cannot be activated by click.

Standard font names include:
Arial, Comic Sans MS, Courier New, Lucida Console, Microsoft Sans Serif,
System, Tahoma, Times New Roman, and WingDings
See Appendix for a complete font list

Use @LF to display several lines.
Related
SplashOff, SplashImageOn, ControlSetText, ToolTip
Example

SplashTextOn("Title", "Message goes here.", -1, -1, -1, -1, 4, "", 24)
Sleep(3000)
SplashOff()



;; FLICKER
$message = ""
SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
For $x = 1 to 20
$message = $message & $x & @LF
SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
Sleep(100)
Next

;; SMOOTH
$message = ""
SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
For $x = 1 to 20
$message = $message & $x & @LF
ControlSetText("TitleFoo", "", "Static1", $message)
sleep(100)
Next




Function Reference
ToolTip
Creates a tooltip anywhere on the screen.
ToolTip ( "text" [, x [, y [, "title" [, icon [, options]]]]] )
Parameters
text The text of the tooltip. (An empty string clears a displaying tooltip)
x, y [optional] The x,y position of the tooltip.
title [optional] The title for the tooltip

Requires IE5+

icon
[optional] Pre-defined icon to show next to the title: Requires a title.
0 = No icon, 1 = Info icon, 2 = Warning icon, 3 = Error Icon
options
[optional] Sets different options for how the tooltip will be displayed
(Can be added together):
1 = Display as Balloon Tip
Requires IE5+

2 = Center the tip at the x,y coordinates instead of using them for the
upper left corner.
4 = Force the tooltip to always be visible confining it to monitor
borders if necessary. If multiple monitors are used, then the tooltip
will "snap-to" the nearest monitor.

Return Value
Success:

Returns 1.
Failure:

Returns 0 when title length is greater than 99.

Remarks
To skip an optional parameter, leaving it's default value intact, use the Default
keyword.

If the x and y coordinates are omitted the, tip is placed near the mouse cursor.

A Tooltip will appear until the script terminates or ToolTip("") is called.
You may use @CR or @LF to create multi-line tooltips.
To display an icon, you must specify a non-empty title. The icon appears on the
same row as the title and thus requires a title to be present.
If using the center flag, the center of the tooltip will be at the coordinates specified.
If using the center flag with a Balloon Tip, the stem will be centered on the balloon
and will point to the coordinates specified.
Related
TrayTip, Default
Example

; This will create a tooltip in the upper left of the screen
ToolTip("This is a tooltip", 0, 0)
Sleep(2000) ; Sleep to give tooltip time to display




Function Reference
AdlibDisable
Disables the adlib functionality.
AdlibDisable ( )
Parameters
None.
Return Value
None.
Remarks
None.
Related
AdlibEnable

Example

AdlibDisable()




Function Reference
AdlibEnable
Enables Adlib functionality.
AdlibEnable ( "function" [, time] )
Parameters
function The name of the adlib function to call.
time
[optional] how often in milliseconds to call the function. Default is
250 ms.

Return Value
None.
Remarks
Every 250 ms (or time ms) the specified "function" is called typically to check for
unforeseen errors. For example, you could use adlib in a script which causes an
error window to pop up unpredictably.
The adlib function should be kept simple as it is executed often and during this
time the main script is paused. Also, the time parameter should be used carefully to
avoid CPU load.
Related
AdlibDisable, Call
Example


AdlibEnable("myadlib")
;
Exit

Func myadlib()
If WinActive("Error") Then
;

×