Sign in to follow this  
Followers 0
lainline

how can I use "Window Info Tool" like #include ***

7 posts in this topic

#1 ·  Posted (edited)

"Window Info Tool" have dll version? Edited by lainline

Share this post


Link to post
Share on other sites



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.


Share this post


Link to post
Share on other sites

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. :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Lol Melba23 we posted almost the same answer at almost the same time :mellow:


Share this post


Link to post
Share on other sites

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...... :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Posted Image_WinAPI_WindowFromPoint run exp

Exactly what I want

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

a part of my work

Thank you

#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 by lainline

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0