Helomotorola Posted September 5, 2007 Posted September 5, 2007 (edited) "Autoit windows Info" Programme can get many windows Info, I don't know how it does? Please help me get windows Title, Instance Control, Style, ExStyle info Thank! Edited September 5, 2007 by Helomotorola
Developers Jos Posted September 5, 2007 Developers Posted September 5, 2007 (edited) have you looked at the WIN* functions in the Helpfile ? Edited September 5, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Helomotorola Posted September 5, 2007 Author Posted September 5, 2007 I know WIN* functions, but I want get info underneath the mouse pointer? In "Autoit windows Info" Programme get Instance Control. Ex: button1, button2.
martin Posted September 5, 2007 Posted September 5, 2007 I know WIN* functions, but I want get info underneath the mouse pointer?In "Autoit windows Info" Programme get Instance Control. Ex: button1, button2.Not sure this is what you want but search for childwindowfrompoint Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Helomotorola Posted September 5, 2007 Author Posted September 5, 2007 Thanks, you can help me get get info underneath the mouse pointer. button1, button2.. not "buton" Windows Title ==> Windows underneath the mouse pointer Thank you!
PsaltyDS Posted September 5, 2007 Posted September 5, 2007 Thanks, you can help me get get info underneath the mouse pointer.button1, button2.. not "buton" Windows Title ==> Windows underneath the mouse pointerThank you!Given that the window under the mouse pointer might not be top of the Z-order (active), you have a couple options:1. Search the forum for a couple of function posted by SmOke_N that give window and control info under the mouse pointer.2. Code something yourself that runs WinList() then loops through the list checking each window for coordinates and size containing the mouse location. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
grham Posted October 4, 2007 Posted October 4, 2007 Given that the window under the mouse pointer might not be top of the Z-order (active), you have a couple options:1. Search the forum for a couple of function posted by SmOke_N that give window and control info under the mouse pointer.2. Code something yourself that runs WinList() then loops through the list checking each window for coordinates and size containing the mouse location. I have been searching for a solution of the same (or similar) problem.ad 1) I searched and found some functions that only give that informationof an active window but not of a window under mouse (non active).One function gives the info from the active window regardless the mousepointer position.Another one (with tooltips) retrieves "blanc" outside an active windowad 2) It's not possible to base it on window position and size on the screen becausethey may be two or more wins overlayed (for ex: explorer)I need it for (drag and) dropping an item (file) on a window explorer window (or another exporer)The Window Info Tools gives the info from any window on the screen (active andnon active) Thanks
Moderators SmOke_N Posted October 4, 2007 Moderators Posted October 4, 2007 I have been searching for a solution of the same (or similar) problem.ad 1) I searched and found some functions that only give that informationof an active window but not of a window under mouse (non active).One function gives the info from the active window regardless the mousepointer position.Another one (with tooltips) retrieves "blanc" outside an active windowad 2) It's not possible to base it on window position and size on the screen becausethey may be two or more wins overlayed (for ex: explorer)I need it for (drag and) dropping an item (file) on a window explorer window (or another exporer)The Window Info Tools gives the info from any window on the screen (active andnon active) ThanksMouseGetPosThenhttp://msdn2.microsoft.com/en-us/library/ms633558.aspxThenhttp://msdn2.microsoft.com/en-us/library/ms632676.aspxShould do what you are looking for. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
grham Posted October 4, 2007 Posted October 4, 2007 Thank you SmOke_N for your suggestion I read msdn and I see now that a non active window is considered a child window Ok I will try it out
grham Posted October 5, 2007 Posted October 5, 2007 Have It! The only obstacle was not to remember that WinList() retreaves the windows "in order" (visibles: first the active window, then the win "under" it, .........) PsaltyDS, you were right, naturely This script gets a control of a window in the screen (also inactive) - like AutoIt Windows Info Tool does It contains _MouseGetCtrlInfo() ----- slightly adapted function made by: SmOke_N ? ClientToScreen($hWnd) ---- made by smashly expandcollapse popup#include <misc.au3> #include <Array.au3> HotKeySet('{ESC}', '_Exit') Global $WinText, $OldMouse[2], $NewMouse[2], $Windows, $x, $MyWin, $MyCoords While 1 $NewMouse = MouseGetPos() If $NewMouse[0] <> $OldMouse[0] Or $NewMouse[1] <> $OldMouse[1] Then ToolTip(_GetWin()) Sleep(100) WEnd Func _GetWin() Local $Coords ToolTip("") $Mouse = MouseGetPos() $OldMouse = $Mouse $Windows = _WinList() ;_ArrayDisplay($Windows, "") For $x = 1 To UBound($Windows)-1 $Coords = WinGetPos($Windows[$x][0], "") If $Coords = -4 Then ExitLoop If IsArray($Coords) Then If $Mouse[0] >= $Coords[0] And $Mouse[0] <= ($Coords[0]+$Coords[2]) And $Mouse[1] >= $Coords[1] And $Mouse[1] <= ($Coords[1]+$Coords[3]) Then ExitLoop EndIf Next If $x = UBound($Windows) Then $x -= 1 $MyWin = $Windows[$x][0] $Control = _MouseGetCtrlInfo() $Return = $Windows[$x][0] & @CRLF & $Control Return $Return EndFunc Func _WinList() Local $WinListArray[1][2] $var = WinList() For $i = 1 to $var[0][0] If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then Redim $WinListArray[UBound($WinListArray) + 1][2] $WinListArray[UBound($WinListArray)-1][0] = $var[$i][0] $WinListArray[UBound($WinListArray)-1][1] = $var[$i][1] EndIf Next Return $WinListArray EndFunc Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Func _Exit() Exit EndFunc Func _MouseGetCtrlInfo() ; get ID, Classe and Text of a control Global $hWin = WinGetHandle($MyWin) Global $sClassList = WinGetClassList($hWin) Local $sSplitClass = StringSplit(StringTrimRight($sClassList, 1), @LF) Local $aMPos = MouseGetPos() ;_ArrayDisplay($sSplitClass, "") $MyCoords = ClientToScreen($hWin) For $iCount = UBound($sSplitClass) - 1 To 1 Step - 1 Local $nCount = 0 If $sSplitClass[$iCount] = "WorkerW" Then ContinueLoop While 1 $nCount += 1 $aCPos = ControlGetPos($hWin, '', $sSplitClass[$iCount] & $nCount) If @error Then ExitLoop $hCtrlWnd = ControlGetHandle ($hWin, "", $sSplitClass[$iCount] & $nCount) If IsArray($aCPos) Then If $aMPos[0] >= ($MyCoords[0]+$aCPos[0]) And $aMPos[0] <= ($MyCoords[0]+$aCPos[0] + $aCPos[2]) _ And $aMPos[1] >= ($MyCoords[1]+$aCPos[1]) And $aMPos[1] <= ($MyCoords[1]+$aCPos[1] + $aCPos[3]) Then $aReturn = DllCall('User32.dll', 'int', 'GetDlgCtrlID', 'hwnd', $hCtrlWnd) If @error Then Return "Err" $Text = ControlGetText($hWin, '', $sSplitClass[$iCount] & $nCount) If StringInStr($Text, @LF) Then $Text = "demasiado largo" If IsArray($aReturn) Then Return 'ControlID: ' & $aReturn[0] & @CRLF & 'ClassNameNN: ' & $sSplitClass[$iCount] & $nCount & @CRLF & "Text: " & $Text EndIf EndIf WEnd Next ;_ArrayDisplay($sSplitClass, "") Return "No Ctrl" EndFunc Func ClientToScreen($hWnd) ; get client area of a win relative to the screan Local $Point, $aRes[2] Local $cX, $cY $Point = DllStructCreate("int;int") DllStructSetData($Point, 1, $cX) DllStructSetData($Point, 1, $cY) DllCall("User32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($Point)) $aRes[0] = DllStructGetData($Point, 1) $aRes[1] = DllStructGetData($Point, 2) Return $aRes EndFunc
JBeef Posted October 6, 2007 Posted October 6, 2007 crazy - seehttp://www.autoitscript.com/forum/index.ph...st&p=349732there have HWNDUnderMouse and ClassNNOfHWND - another no Larry post - ~Jap
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