|
向本站高手,如: afan、pusofalse、顽固不化、水木子、叁恨居士 。。。。。。等等求助!
09年11月,在官方论坛搜得一个类似 Au3Info 脚本,但存在BUG , 效果如下图:
上面两图属软件的同一画面.我曾将这两图上传到脚本作者发布的贴中:
http://www.autoitscript.com/foru ... 0522444e7f0d422618f
1.存在BUG. 捕捉"Static"控件时会破坏图片控件
2.不能捕捉控件的 CLASSNN - 控件类名+枚举值
很有可能是语言翻译的原因,作者最终回答:
Ok. Good to see thats working. I do not know how to make it work with an input then.
似乎是不知原因,一直等到现在,也未见作者修改.
附上脚本及包含文件代码,请求修改以解决上述2个问题!谢谢!!!
示例脚本:#Include "GUIFinder.au3"
$hGUI = GUICreate ("Test")
$hFinder = GUICtrlCreateFinder (2, 2)
GUICtrlCreateLabel ( "控件句柄", 20, 42, 50, 20 )
GUICtrlCreateLabel ( " 类", 20, 64, 50, 20 )
GUICtrlCreateLabel ( "窗口句柄", 20, 86, 50, 20 )
GUICtrlCreateLabel ( "控件文本", 20, 108, 50, 20 )
$hHwndInp = GUICtrlCreateInput ("", 80, 40, 200, 20)
$hClassInp = GUICtrlCreateInput ("", 80, 62, 200, 20)
$hParInp = GUICtrlCreateInput ("", 80, 84, 200, 20)
$hTitleInp = GUICtrlCreateInput ("", 80, 106, 200, 20)
GUISetState ()
While 1
Switch GUIGetMsg ()
Case -3
Exit
EndSwitch
If $FINDER_OPEN And (String ($FINDER_HWND) <> GUICtrlRead ($hHwndInp)) Then
GUICtrlSetData ($hHwndInp, $FINDER_HWND)
GUICtrlSetData ($hClassInp, $FINDER_CLASS)
GUICtrlSetData ($hParInp, $FINDER_PARENT)
GUICtrlSetData ($hTitleInp, $FINDER_TITLE)
EndIf
WEnd
包含文件: GUIFinder.au3; #INDEX# ========================================================================================================================
; 标题 .........: GUIFinder.au3
; AutoIt 版本 : 3.3.0.0 - 3.3.1.5
; 语言 ......: English
; 说明 ...: 用更简单的方法实现窗口探测的工具.
; 设计者(s) .....: Mat, based on original code by Lazycat.
; ================================================================================================================================
; #CURRENT# ======================================================================================================================
; GUICtrlCreateFinder
; GUICtrlDeleteFinder
; ================================================================================================================================
; #INTERNAL# =====================================================================================================================
; _GUI_FINDER_WM_COMMAND
; _GUI_FINDER_WM_MOUSEMOVE
; _GUI_FINDER_WM_LBUTTONUP
; _GUI_FINDER_START_SEARCH
; _GUI_FINDER_GET_PARENT
; _GUI_FINDER_GET_CLASS
; _GUI_FINDER_RESOURCE_WRITE
; _GUI_FINDER_RESOURCE_CLEAR
; ================================================================================================================================
; #RESOURCES# ====================================================================================================================
; 设计者 .: LazyCat
; 当前 .......: $CURSOR_TARGET - "target" (目标)光标, 使用 "SetCursor"
; $ICON_TARGET_FULL - 不激活时的图标
; $ICON_TARGET_EMPTY - 激活时没有 "target" (目标)时的图标.
Global $CURSOR_TARGET = _GUI_FINDER_RESOURCE_WRITE( _
"0x000002000100202000000F001000300100001600000028000000200000004000000001000100000000008000" & _
"00000000000000000000020000000200000000000000FFFFFF0000000000000000000000000000000000000000" & _
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" & _
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" & _
"00000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" & _
"FFFFFFF83FFFFFE6CFFFFFD837FFFFBEFBFFFF783DFFFF7EFDFFFEAC6AFFFEABAAFFFE0280FFFEABAAFFFEAC6A" & _
"FFFF7EFDFFFF783DFFFFBEFBFFFFD837FFFFE6CFFFFFF83FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" & _
"FFFFFFFFFFFFFFFFFFFFFFFF")
Global $ICON_TARGET_FULL = _GUI_FINDER_RESOURCE_WRITE( _
"0x0000010001002020080000000000E80200001600000028000000200000004000000001000400000000000002" & _
"000000000000000000001000000010000000000000000000800000800000008080008000000080008000808000" & _
"00C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000000000000000" & _
"00000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFF" & _
"FFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFF00000FFFFFFFFFFFF000FFFFFFFFFF00FF0FF00FFFFFFFFFF000FF" & _
"FFFFFFF0FF00000FF0FFFFFFFFF000FFFFFFFF0FFFFF0FFFFF0FFFFFFFF000FFFFFFF0FFFF00000FFFF0FFFFFF" & _
"F000FFFFFFF0FFFFFF0FFFFFF0FFFFFFF000FFFFFF0F0F0FF000FF0F0F0FFFFFF000FFFFFF0F0F0F0FFF0F0F0F" & _
"0FFFFFF000FFFFFF0000000F0F0000000FFFFFF000FFFFFF0F0F0F0FFF0F0F0F0FFFFFF000FFFFFF0F0F0FF000" & _
"FF0F0F0FFFFFF000FFFFFFF0FFFFFF0FFFFFF0FFFFFFF000FFFFFFF0FFFF00000FFFF0FFFFFFF000FFFFFFFF0F" & _
"FFFF0FFFFF0FFFFFFFF000FFFFFFFFF0FF00000FF0FFFFFFFFF000FFFFFFFFFF00FF0FF00FFFFFFFFFF000FFFF" & _
"FFFFFFFF00000FFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF0" & _
"00FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000007770CCCCCCCCCCCCCCCCCCCC" & _
"C07770007070CCCCCCCCCCCCCCCCCCCCC07070007770CCCCCCCCCCCCCCCCCCCCC0777000000000000000000000" & _
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" & _
"000000000000000000FFFFFFFF8000000080000000800000008000000080000000800000008000000080000000" & _
"800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080" & _
"0000008000000080000000800000008000000080000000800000008000000080000000FFFFFFFFFFFFFFFFFFFF" & _
"FFFF")
Global $ICON_TARGET_EMPTY = _GUI_FINDER_RESOURCE_WRITE( _
"0x0000010001002020080000000000E80200001600000028000000200000004000000001000400000000000002" & _
"000000000000000000001000000010000000000000000000800000800000008080008000000080008000808000" & _
"00C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000000000000000" & _
"00000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFF" & _
"FFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FF" & _
"FFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFF" & _
"F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFF" & _
"FFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFF" & _
"FFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFF" & _
"FFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFF" & _
"FFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF0" & _
"00FFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000007770CCCCCCCCCCCCCCCCCCCC" & _
"C07770007070CCCCCCCCCCCCCCCCCCCCC07070007770CCCCCCCCCCCCCCCCCCCCC0777000000000000000000000" & _
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" & _
"000000000000000000FFFFFFFF8000000080000000800000008000000080000000800000008000000080000000" & _
"800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080" & _
"0000008000000080000000800000008000000080000000800000008000000080000000FFFFFFFFFFFFFFFFFFFF" & _
"FFFF")
; Beta + Release safe :)
If Execute ("AutoitOnExitRegister (""_GUI_FINDER_RESOURCE_CLEAR"")") = "" Then _
Execute ("Opt (""OnAutoitExit"", ""_GUI_FINDER_RESOURCE_CLEAR"")")
; ================================================================================================================================
; #VARIABLES# ====================================================================================================================
Global $INTERNAL_USER32_DLL = DllOpen ("user32.dll");打开 user32.dll 文件以供 DllCall 函数使用
#include<WinApi.au3>
; 从文件中载入光标
Global $INTERNAL_TARGET_CURSOR = DllCall($INTERNAL_USER32_DLL, "int", "LoadCursorFromFile", "str", $CURSOR_TARGET)
$INTERNAL_TARGET_CURSOR = $INTERNAL_TARGET_CURSOR[0]
; 内部变量
Global $INTERNAL_TARGET_PIC = 0, $INTERNAL_BACKUP_CURSOR = 0, $INTERNAL_TARGET_DUMMY = 0, $INTERNAL_TARGET_PARENT = 0
; 用户变量
Global $FINDER_HWND = 0, $FINDER_PARENT = 0, $FINDER_CLASS = 0, $FINDER_TITLE = "", $FINDER_OPEN = False
; 选项
Global $FINDER_FRAME_DRAW = True
Global $FINDER_NOTIFY = 2
; 0 = 无 None
; 1 = 启动 Start
; 2 = 结束 End
; 3 = 启动+结束 both
; GDI+
#include <gdiplus.au3>
_GDIPlus_Startup();初始化微软 Windows 的 GDI +
Global $INTERNAL_PEN = _GDIPlus_PenCreate ( 0xB0000000, 5);创建围栏对象
; ================================================================================================================================
; #FUNCTION# =====================================================================================================================
; 名称....: GUICtrlCreateFinder
; 说明 ...: 创建一个有探测图标的窗口 并注册事件
; 语法....: GUICtrlCreateFinder ($x, $y)
; 参数 ...: $x - 左边距离
; $y - 顶端距离
; 返回值 .: 成功 - 触发事件句柄.
; 失败 - 0 ,为 GUICtrlCreateIcon 设置 @Error + @Extended 结果. Then
; 如果 @Error = -1 则控件已经存在. 多控件处理尚未内置.
; 设计者 .: Mat
; 修改....:
; 备注 ...: 宽度和高度不应改变,所以我并不包括这些参数.
; 重要说明:返回的处理,不能以同样的方式作为对照!诸如移动任务,
; 使用 $INTERNAL_TARGET_PIC 代替. 它不理想,但可用.
; 相关 ...:
; 连接 ...:
; 示例 ...: 有
; ================================================================================================================================
Func GUICtrlCreateFinder ($x, $y)
If $INTERNAL_TARGET_PIC <> 0 Then Return SetError (-1, 0, 0)
$INTERNAL_TARGET_PIC = GUICtrlCreateIcon ($ICON_TARGET_FULL, 0, $x, $y, 32, 32, 131328);创建一个图标控件
If @Error Then Return SetError (@Error, @Extended, $INTERNAL_TARGET_PIC)
Local $Label = GUICtrlCreateLabel('', 0, 0, 0, 0), $hWnd = DllCall($INTERNAL_USER32_DLL, "hwnd", "GetParent", "hwnd", GUICtrlGetHandle($Label))
GUICtrlDelete($Label)
$INTERNAL_TARGET_PARENT = $hWnd[0]
$INTERNAL_TARGET_DUMMY = GUICtrlCreateDummy ()
GUIRegisterMsg (0x0111, "_GUI_FINDER_WM_COMMAND")
Return $INTERNAL_TARGET_DUMMY
EndFunc ; ==> GUICtrlCreateFinder
; #FUNCTION# =====================================================================================================================
; 名称....: GUICtrlDeleteFinder
; 说明 ...: 删除当前的探测工具.
; 语法....: GUICtrlDeleteFinder ()
; 参数 ...: 无
; 返回值 .: 成功 - 1
; 失败 - 0 ,设置 @Error 为 1 (没有探测工具运行)
; 设计者 .: Mat
; 修改.......:
; 备注 .......: 从 GUICtrlCreateFinder 调用 GUICtrlDelete 函数将没有任何效果。必须使用 此函数:)
; 相关 .......:
; 连接 ..........:
; 示例 .......: 无
; ================================================================================================================================
Func GUICtrlDeleteFinder ()
If $INTERNAL_TARGET_PIC = 0 Then Return SetError (1, 0, 0)
GUIRegisterMsg (0x0111, "") ; WM_COMMAND
GUICtrlDelete ($INTERNAL_TARGET_PIC)
GUICtrlDelete ($INTERNAL_TARGET_DUMMY)
$FINDER_HWND = 0
$FINDER_PARENT = 0
$FINDER_CLASS = 0
$FINDER_TITLE = ""
$FINDER_OPEN = False
$INTERNAL_TARGET_PIC = 0
$INTERNAL_BACKUP_CURSOR = 0
$INTERNAL_TARGET_DUMMY = 0
$INTERNAL_TARGET_PARENT = 0
Return 1
EndFunc ; ==> GUICtrlDeleteFinder
; #FUNCTION# =====================================================================================================================
; 名称....: _FinderSetOpt
; 说明 ...: 为探测器设置一个选项.
; 语法....: _FinderSetOpt ($sOpt [, $vNewVal] )
; 参数 ...: $sOpt - 字符串的表示法
; $vNewVal - 新值. 如设置为 "" (默认) 将只返回当前值.
; 返回值 .: 成功 - 以前的值.
; 失败 - 0 ,设置 @Error 为:
; 1 - $sOpt 参数无效
; 2 - $vNewVal 参数无效
; 设计者 .: Mat
; 修改.......:
; 备注 .......: 在这里删除该控件不更改设置
; 相关 .......:
; 连接 ..........:
; 示例 .......: No
; ================================================================================================================================
Func _FinderSetOpt ($sOpt, $vNewVal = "")
Local $vRet
Switch StringLower ($sOpt);转换字符串为小写字母
Case "framedisplay"
If $vNewVal = "" Then Return $FINDER_FRAME_DRAW
If Not IsBool ($vNewVal) Then Return SetError (2, 0, 0)
$vRet = $FINDER_FRAME_DRAW
$FINDER_FRAME_DRAW = $vNewVal
Case "framecolour", "framecolor" ; 导致这些美国人不能拼写 :P
$vRet = _GDIPlus_PenGetColor ($INTERNAL_PEN);得到画笔颜色
_GDIPlus_PenSetColor ($INTERNAL_PEN, $vNewVal);设置画笔颜色
Case "notifyon"
If $vNewVal = "" Then Return $FINDER_NOTIFY
If (Not IsInt ($vNewVal)) Or ($vNewVal < 0) Or ($vNewVal > 3) Then Return SetError (2, 0, 0)
$vRet = $FINDER_NOTIFY
$FINDER_NOTIFY = $vNewVal
Case Else
Return SetError (2, 0, 0)
EndSwitch
Return $vRet
EndFunc ; ==> _FinderSetOpr
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_WM_COMMAND
; 说明 ...: WM_COMMAND 命令信息处理
; 语法....: _GUI_FINDER_WM_COMMAND ($hWnd, $nMsg, $wParam, $lParam)
; 参数 ...: $hWnd - 窗口句柄
; $nMsg - 消息 ID
; $wParam - The wParam
; $lParam - The lParam
; 返回值 .: "GUI_RUNDEFMSG"
; 设计者 .: Mat
; 修改.......:
; 备注 .......: 内部使用
; 相关 .......:
; 连接 ..........:
; ================================================================================================================================
Func _GUI_FINDER_WM_COMMAND ($hWnd, $nMsg, $wParam, $lParam)
If ($nMsg = 273) And (BitAND ($wParam, 0xFFFF) = $INTERNAL_TARGET_PIC) Then _GUI_FINDER_START_SEARCH ()
EndFunc ; ==> _GUI_FINDER_WM_COMMAND
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_START_SEARCH
; 说明 ...: 开始探测.
; 语法....:_GUI_FINDER_START_SEARCH ()
; 参数 ...: 无
; 返回值 .: 无
; 设计者 .: Mat
; 修改.......:
; 备注 .......: 内部使用
; 相关 .......:
; 连接 ..........:
; ================================================================================================================================
Func _GUI_FINDER_START_SEARCH ()
DllCall($INTERNAL_USER32_DLL, "hwnd", "SetCapture", "hwnd", $INTERNAL_TARGET_PARENT)
$INTERNAL_BACKUP_CURSOR = DllCall($INTERNAL_USER32_DLL, "int", "SetCursor", "int", $INTERNAL_TARGET_CURSOR)
If not @error Then $INTERNAL_BACKUP_CURSOR = $INTERNAL_BACKUP_CURSOR[0]
GUICtrlSetImage($INTERNAL_TARGET_PIC, $ICON_TARGET_EMPTY)
GUIRegisterMsg (512, "_GUI_FINDER_WM_MOUSEMOVE")
GUIRegisterMsg (514, "_GUI_FINDER_WM_LBUTTONUP")
If BitAnd ($FINDER_NOTIFY, 1) Then GUICtrlSendToDummy ($INTERNAL_TARGET_DUMMY)
$FINDER_OPEN = True
Endfunc ; ==> _GUI_FINDER_START_SEARCH
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_WM_MOUSEMOVE
; 说明 ...: WM_MOUSEMOVE 鼠标移动消息处理
; 语法....: _GUI_FINDER_WM_MOUSEMOVE ($hWnd, $nMsg, $wParam, $lParam)
; 参数 ...: $hWnd - 窗口句柄
; $nMsg - 消息 ID
; $wParam - The wParam
; $lParam - The lParam
; 返回值 .: "GUI_RUNDEFMSG"
; 设计者 .: Mat
; 修改.......:
; 备注 .......: 内部使用, 仅在运行探测时,才有反应. 如果探测取消,则 $FINDER_OPEN 为 False
; 相关 .......:
; 连接 ..........:
; ================================================================================================================================
Func _GUI_FINDER_WM_MOUSEMOVE ($hWnd, $nMsg, $wParam, $lParam)
If Not $FINDER_OPEN Then Return _GUI_FINDER_WM_LBUTTONUP ("", "", "", "")
Local $mPos = MouseGetPos (), $hWndUnder = DllCall($INTERNAL_USER32_DLL, "hwnd", "WindowFromPoint", "long", $mPos[0], "long", $mPos[1])
If @error Then Return
$hWndUnder = $hWndUnder[0]
If $FINDER_HWND = $hWndUnder Then Return 1
_GUI_FINDER_REFRESH_WINDOW ($FINDER_HWND)
$FINDER_HWND = $hWndUnder
$FINDER_PARENT = _GUI_FINDER_GET_PARENT ($hWndUnder)
$FINDER_CLASS = _GUI_FINDER_GET_CLASS ($hWndUnder)
$FINDER_TITLE = WinGetTitle ($hWndUnder)
If $FINDER_FRAME_DRAW Then
Local $DC = _WinAPI_GetWindowDC ($FINDER_HWND)
If Not $DC Then Return 0
Local $RECT = _WinAPI_GetWindowRect ($FINDER_HWND)
Local $hGraphics = _GDIPlus_GraphicsCreateFromHDC ($DC)
_GDIPlus_GraphicsDrawRect ($hGraphics, 0, 0, DllStructGetData($RECT, 3) - DllStructGetData($RECT, 1) - 1, _
DllStructGetData($RECT, 4) - DllStructGetData($RECT, 2) - 1, $INTERNAL_PEN)
_GDIPlus_GraphicsDispose ($hGraphics)
_WinAPI_ReleaseDC ($FINDER_HWND, $DC)
EndIf
Return 1
EndFunc ; ==> _GUI_FINDER_WM_MOUSEMOVE
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_WM_LBUTTONUP
; 说明 ...: WM_LBUTTONUP 按钮信息处理
; 语法....: _GUI_FINDER_WM_LBUTTONUP ($hWnd, $nMsg, $wParam, $lParam)
; 参数 ...: $hWnd - 窗口句柄
; $nMsg - 消息 ID
; $wParam - The wParam
; $lParam - The lParam
; 返回值 .: 1
; 设计者 .: Mat
; 修改.......:
; 备注 .......: 内部使用, 取消探测.
; 相关 .......:
; 连接 ..........:
; ================================================================================================================================
Func _GUI_FINDER_WM_LBUTTONUP ($hWnd, $nMsg, $wParam, $lParam)
DllCall ($INTERNAL_USER32_DLL, "int", "ReleaseCapture") ; 释放捕捉光标
DllCall ($INTERNAL_USER32_DLL, "int", "SetCursor", "int", $INTERNAL_BACKUP_CURSOR)
_GUI_FINDER_REFRESH_WINDOW ($FINDER_HWND)
GUICtrlSetImage ($INTERNAL_TARGET_PIC, $ICON_TARGET_FULL)
GUIRegisterMsg (512, "")
GUIRegisterMsg (514, "")
If BitAnd ($FINDER_NOTIFY, 2) Then GUICtrlSendToDummy ($INTERNAL_TARGET_DUMMY)
$FINDER_OPEN = False
Return 1
EndFunc ; ==> _GUI_FINDER_WM_LBUTTONUP
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_REFRESH_WINDOW
; 说明 ...: 刷新窗口 to remove any outstanding GDI+ elements
; 语法....: _GUI_FINDER_REFRESH_WINDOW ($hWnd)
; 参数 ...: $hWnd - 窗口句柄
; 返回值 .: 无
; 设计者 .: Wraithdu
; 修改.......: Mat
; 备注 .......: 内部使用.
; 相关 .......:
; 连接 ..........:
; ================================================================================================================================
Func _GUI_FINDER_REFRESH_WINDOW ($hWnd)
_WinAPI_InvalidateRect ($hWnd, 0, True);添加一个矩形到指定窗口的更新区域
_WinAPI_UpdateWindow ($hWnd);发送一个 WM_PAINT 消息到目标窗口,用于更新目标窗口客户区
;Local $RDW_FRAME = 0x0400
;Local $RDW_INVALIDATE = 0x0001
;Local $RDW_UPDATENOW = 0x0100
;Local $RDW_ALLCHILDREN = 0x0080
_WinAPI_RedrawWindow ($hWnd, 0, 0, BitOR (0x0400, 0x0001, 0x0100, 0x0080));更新指定的矩形或在窗口的客户区区域
EndFunc ; ==> _GUI_FINDER_REFRESH_WINDOW
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_GET_PARENT
; 说明 ...: 检索指定子窗的父窗口句柄
; 语法....: _GUI_FINDER_GET_PARENT ($hWnd)
; 参数 ...: $hWnd - 子窗口句柄
; 返回值 .: 成功 - 父窗口疾病
; 失败 - 0
; 设计者 .: Paul Campbell (PaulIA)
; 修改.......:
; 备注 .......: 摘自 WinApi.au3
; 相关 .......:
; 连接 ..........: @@MsdnLink@@ GetParent
; ================================================================================================================================
Func _GUI_FINDER_GET_PARENT ($hWnd)
Local $aResult = DllCall ($INTERNAL_USER32_DLL, "hwnd", "GetParent", "hwnd", $hWnd)
If @error Then Return SetError (@error, @extended, 0)
Return $aResult[0]
EndFunc ; ==> _GUI_FINDER_GET_PARENT
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_GET_CLASS
; 说明 ...: 检索指定的窗口所属哪一等级的名称
; 语法....: _GUI_FINDER_GET_CLASS ($hWnd)
; 参数 ...: $hWnd - 窗口句柄
; 返回值 .: 成功 - 窗口类名
; 设计者 .: Paul Campbell (PaulIA)
; 修改.......: jpm
; 备注 .......:
; 相关 .......:
; 连接 ..........: @@MsdnLink@@ GetClassName
; ================================================================================================================================
Func _GUI_FINDER_GET_CLASS ($hWnd)
Local $pClassName = DllStructCreate ("char[256]")
DllCall ($INTERNAL_USER32_DLL, "int", "GetClassName", "hwnd", $hWnd, "ptr", DllStructGetPtr ($pClassName), "int", 255)
Return DllStructGetData ($pClassName, 1)
EndFunc ; ==> _GUI_FINDER_GET_CLASS
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_RESOURCE_WRITE
; 说明 ...: 写入给定的资源到文件.
; 语法....: _GUI_FINDER_RESOURCE_WRITE ($sbStringRes)
; 参数 ...: $sbStringRes - 二进制字符串资源
; 返回值 .: 成功 - 新的文件路径.
; 设计者 .: LazyCat
; 修改.......:
; 备注 .......:
; 相关 .......: _GUI_FINDER_RESOURCE_CLEAR
; 连接 ..........:
; ================================================================================================================================
Func _GUI_FINDER_RESOURCE_WRITE ($sbStringRes)
Local $sTempFile = @TempDir & "\temp" & Hex (Random (0, 65535), 4)
Do
$sTempFile = @TempDir & "\temp" & Hex (Random (0, 65535), 4)
Until not FileExists ($sTempFile)
Local $hFile = FileOpen ($sTempFile, 2+16)
FileWrite ($hFile, $sbStringRes)
FileClose ($hFile)
Return $sTempFile
EndFunc ; ==> _GUI_FINDER_RESOURCE_WRITE
; #INTERNAL_USE_ONLY# ============================================================================================================
; 名称....: _GUI_FINDER_RESOURCE_CLEAR
; 说明 ...: 清除使用的资源。AutoIt退出.
; 语法....: _GUI_FINDER_RESOURCE_CLEAR ()
; 参数 ...: none
; 返回值 .: none
; 设计者 .: LazyCat
; 修改.......: Mat
; 备注 .......:
; 相关 .......: _GUI_FINDER_RESOURCE_WRITE
; 连接 ..........:
; ================================================================================================================================
Func _GUI_FINDER_RESOURCE_CLEAR ()
If $FINDER_OPEN Then
DllCall ($INTERNAL_USER32_DLL, "int", "ReleaseCapture")
DllCall ($INTERNAL_USER32_DLL, "int", "SetCursor", "int", $INTERNAL_BACKUP_CURSOR)
If $FINDER_HWND Then _GUI_FINDER_REFRESH_WINDOW ($FINDER_HWND)
EndIf
_GDIPlus_PenDispose ($INTERNAL_PEN)
_GDIPlus_Shutdown ()
FileDelete ($ICON_TARGET_FULL)
FileDelete ($ICON_TARGET_EMPTY)
FileDelete ($CURSOR_TARGET)
EndFunc ; ==> _GUI_FINDER_RESOURCE_CLEAR
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|