lainline Posted February 19, 2010 Posted February 19, 2010 (edited) "Window Info Tool" have dll version? Edited February 19, 2010 by lainline
Kealper Posted February 19, 2010 Posted February 19, 2010 Anything you can do with the Window Info tool can all be done right from built-in AutoIt functions, what is it exactly that you are trying to use it for? We could help if we knew more about what you wanted to do.
Moderators Melba23 Posted February 19, 2010 Moderators Posted February 19, 2010 lainline,No direct DLL version that I know of, but you can do most of the same information-gathering using basic AutoIt commands such as _WinAPI_WindowFromPoint to get the handle of the window at that point on screen. Once you have a Windows handle, all sorts of possibilities are opened. It is just you writing the code rather than using the Info tool. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Kealper Posted February 19, 2010 Posted February 19, 2010 Lol Melba23 we posted almost the same answer at almost the same time
Moderators Melba23 Posted February 19, 2010 Moderators Posted February 19, 2010 Kealper, Not the first time that has happened....and it will not be the last either! Just as long as the answers are the same...... M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
lainline Posted February 19, 2010 Author Posted February 19, 2010 _WinAPI_WindowFromPoint run exp Exactly what I want
lainline Posted February 20, 2010 Author Posted February 20, 2010 (edited) a part of my work Thank youexpandcollapse popup#include <WinAPI.au3> HotKeySet("{ESC}", "_EXIT") _Main() Opt ("MustDeclareVars",1) Func _Main() While 1 ToolTip(_get_mouse_underclass()) Sleep(100) WEnd EndFunc Func _get_mouse_underclass();获取表示鼠标下控件详细信息的字符串 "@LF"分行 "|"分条目 Local $output,$ID,$ClassName,$Classtext,$winpos,$classpos,$hwin Local $classlist1 = _get_mouse_under() Local $classlist2 = StringSplit($classlist1,"|") $output="句柄|ID|类名|坐标|文本"& @LF For $c=1 To $classlist2[0]-1 $ID = _WinAPI_GetDlgCtrlID($classlist2[$c]);获取ID $hwin = WinGetHandle($classlist2[$classlist2[0]]) $ClassName = _WinGetClassName($classlist2[$c]);获取类名 $Classtext = ControlGetText ($hwin,"",$ClassName) ;文本 $classpos = ControlGetPos($hwin,"",$ClassName);位置 If Not @error Then $output = $output & $classlist2[$c] & "|" & $ID & "|" & $ClassName & "|" & _ $classpos[0] & "|" & $classpos[1]& "|" & $classpos[2]& _ "|" & $classpos[3] & "|" & StringLeft($Classtext,30) [email="&@LF"]&@LF[/email] EndIf Next $winpos = WinGetPos($hwin,"") $output = $output & $classlist2[$classlist2[0]] & "|0|0|" & _ $winpos[0] & "|" & $winpos[1]& "|" & $winpos[2]& "|" & _ $winpos[3] &"|" & WinGetTitle($hwin);主窗口 Return $output EndFunc Func _EXIT() Exit EndFunc Func _get_mouse_under();获取鼠标下控件句柄列表 "|"号分隔 Opt("MouseCoordMode",1) Local $Struct = DllStructCreate($tagPoint) DllStructSetData($Struct, "x", MouseGetPos(0)) DllStructSetData($Struct, "y", MouseGetPos(1)) Local $hWndp="" Local $hwnd = _WinAPI_WindowFromPoint($Struct) If @error Then SetError(1) Return 0 EndIf $hWndp = $hwnd While 1 $hwnd = _WinAPI_GetParent($hWnd) If $hwnd=0 Then Return $hWndp Else $hWndp = $hWndp & "|" & $hwnd EndIf WEnd EndFunc Func _WinGetClassName($hclass);由控件句柄查询类名 Local $hwnd = $hclass ,$hWin While 1 $hwnd = _WinAPI_GetParent($hwnd) If $hwnd=0 Then ExitLoop Else $hWin = $hwnd EndIf WEnd Local $sClassList = WinGetClassList($hWin) Local $aSplitClass = StringSplit(StringTrimRight($sClassList, 1), @LF) For $iCount = $aSplitClass[0] To 1 Step - 1 Local $nCount = 0 While 1 $nCount += 1 If ControlGetHandle($hWin,"", $aSplitClass[$iCount] & $nCount) = $hclass Then Return $aSplitClass[$iCount] & $nCount EndIf If ControlGetHandle($hWin, '', $aSplitClass[$iCount] & $nCount) = '' Then ExitLoop WEnd Next EndFunc Edited February 20, 2010 by lainline
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now