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

Giáo Trình How To Use AutoIt A Professional Manner part 81 docx

6 249 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 6
Dung lượng 18,27 KB

Nội dung

DllStructGetPtr($stRect), "int", $nType, "int", $nState) $stRect = 0 EndFunc ;==>DrawFrameControl Func DrawFocusRect($hDC, $nLeft, $nTop, $nRight, $nBottom) Local $stRect = DllStructCreate("int;int;int;int") DllStructSetData($stRect, 1, $nLeft) DllStructSetData($stRect, 2, $nTop) DllStructSetData($stRect, 3, $nRight) DllStructSetData($stRect, 4, $nBottom) DllCall("user32.dll", "int", "DrawFocusRect", "hwnd", $hDC, "ptr", DllStructGetPtr($stRect)) $stRect = 0 EndFunc ;==>DrawFocusRect Func DrawText($hDC, $sText, $nLeft, $nTop, $nRight, $nBottom, $nFormat) Local $nLen = StringLen($sText) Local $stRect = DllStructCreate("int;int;int;int") DllStructSetData($stRect, 1, $nLeft) DllStructSetData($stRect, 2, $nTop) DllStructSetData($stRect, 3, $nRight) DllStructSetData($stRect, 4, $nBottom) Local $stText = DllStructCreate("char[260]") DllStructSetData($stText, 1, $sText) DllCall("user32.dll", "int", "DrawText", "hwnd", $hDC, "ptr", DllStructGetPtr($stText), "int", $nLen, "ptr", DllStructGetPtr($stRect), "int", $nFormat) $stRect = 0 $stText = 0 EndFunc ;==>DrawText Func FillRect($hDC, $nLeft, $nTop, $nRight, $nBottom, $hBrush) Local $stRect = DllStructCreate("int;int;int;int") DllStructSetData($stRect, 1, $nLeft) DllStructSetData($stRect, 2, $nTop) DllStructSetData($stRect, 3, $nRight) DllStructSetData($stRect, 4, $nBottom) DllCall("user32.dll", "int", "FillRect", "hwnd", $hDC, "ptr", DllStructGetPtr($stRect), "hwnd", $hBrush) $stRect = 0 EndFunc ;==>FillRect Func FrameRect($hDC, $nLeft, $nTop, $nRight, $nBottom, $hBrush) Local $stRect = DllStructCreate("int;int;int;int") DllStructSetData($stRect, 1, $nLeft) DllStructSetData($stRect, 2, $nTop) DllStructSetData($stRect, 3, $nRight) DllStructSetData($stRect, 4, $nBottom) DllCall("user32.dll", "int", "FrameRect", "hwnd", $hDC, "ptr", DllStructGetPtr($stRect), "hwnd", $hBrush) $stRect = 0 EndFunc ;==>FrameRect Func InflateRect(ByRef $nLeft, ByRef $nTop, ByRef $nRight, ByRef $nBottom, $nX, $nY) Local $stRect = DllStructCreate("int;int;int;int") DllStructSetData($stRect, 1, $nLeft) DllStructSetData($stRect, 2, $nTop) DllStructSetData($stRect, 3, $nRight) DllStructSetData($stRect, 4, $nBottom) DllCall("user32.dll", "int", "InflateRect", "ptr", DllStructGetPtr($stRect), "int", $nX, "int", $nY) $nLeft = DllStructGetData($stRect, 1) $nTop = DllStructGetData($stRect, 2) $nRight = DllStructGetData($stRect, 3) $nBottom = DllStructGetData($stRect, 4) $stRect = 0 EndFunc ;==>InflateRect Func SetBkColor($hDC, $nColor) Local $nOldColor = DllCall("gdi32.dll", "int", "SetBkColor", "hwnd", $hDC, "int", $nColor) Return $nOldColor[0] EndFunc ;==>SetBkColor Func SetTextColor($hDC, $nColor) Local $nOldColor = DllCall("gdi32.dll", "int", "SetTextColor", "hwnd", $hDC, "int", $nColor) Return $nOldColor[0] EndFunc ;==>SetTextColor Func SelectObject($hDC, $hObj) Local $hOldObj = DllCall("gdi32.dll", "hwnd", "SelectObject", "hwnd", $hDC, "hwnd", $hObj) Return $hOldObj[0] EndFunc ;==>SelectObject Func DeleteObject($hObj) Local $nResult = DllCall("gdi32.dll", "hwnd", "DeleteObject", "hwnd", $hObj) EndFunc ;==>DeleteObject Func GetWindowLong($hWnd, $nIndex) Local $nVal = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hWnd, "int", $nIndex) Return $nVal[0] EndFunc ;==>GetWindowLong Function Reference AutoItSetOption Changes the operation of various AutoIt functions/parameters. AutoItSetOption ( "option" [, param] ) Parameters option The option to change. See Remarks. param [optional] The value to assign to the option. The type and meaning vary by option. See remarks below. If the param is not provided, then the function just returns the value already assigned to the option. The keyword Default can be used for the parameter to reset the option to its default value. Return Value Returns the value of the previous setting for the option. Remarks You may use Opt() as an alternative to AutoItSetOption(). AutoIt will halt with an error message if the requested option is unknown. Options are as follows: Option Param CaretCoordMode Sets the way coords are used in the caret functions, either absolute coords or coords relative to the current active window: 0 = relative coords to the active window 1 = absolute screen coordinates (default) 2 = relative coords to the client area of the active window ExpandEnvStrings Changes how literal strings and % symbols are interpreted. By default strings are treated literally, this option allows you to use %environment% variables inside strings, e.g., "The temp directory is: %temp%". 1 = expand environment variables (similar to AutoIt v2) 0 = do not expand environment variables (default) Without this option the usual way would be: "The temp directory is: " & EnvGet("temp") ExpandVarStrings Changes how literal strings and variable/macro ($ and @) symbols are interpreted. By default strings are treated literally, this option allows you to use variables and macros inside strings, e.g., "The value of var1 is $var1$". 1 = expand variables (when in this mode and you want to use a literal $ or @ then double it up: "This is a single dollar $$ sign". 0 = do not expand variables (default) FtpBinaryMode Changes how FTP files are transferred. 1 = Binary (default) 0 = ASCII GUICloseOnESC When ESC is pressed on a GUI the $GUI_EVENT_CLOSE message is sent. This option toggles this behavior on and off. 1 = Send the $GUI_EVENT_CLOSE message when ESC is pressed (default). 0 = Don't send the $GUI_EVENT_CLOSE message when ESC is pressed. GUICoordMode Alters the position of a control defined by GUICtrlSetPos. 1 = absolute coordinates (default) still relative to the dialog box. 0 = relative position to the start of the last control (upper left corner). 2 = cell positionining relative to current cell. A -1 for left or top parameter don't increment the start. So next line is -1,offset; next cell is offset,-1; current cell is -1,- 1. . AutoItSetOption Changes the operation of various AutoIt functions/parameters. AutoItSetOption ( "option" [, param] ) Parameters option The option to change. See Remarks. param. alternative to AutoItSetOption(). AutoIt will halt with an error message if the requested option is unknown. Options are as follows: Option Param CaretCoordMode Sets the way coords are. Default can be used for the parameter to reset the option to its default value. Return Value Returns the value of the previous setting for the option. Remarks You may use Opt() as an alternative

Ngày đăng: 08/07/2014, 21:20

TỪ KHÓA LIÊN QUAN