Asaf_Ank Posted March 19, 2021 Posted March 19, 2021 How can I get from mouse position the button advice mode if exist?
Developers Jos Posted March 19, 2021 Developers Posted March 19, 2021 Welcome, but I have no idea what you are asking. Could you try to explain what you are trying to do again? 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.
Asaf_Ank Posted March 21, 2021 Author Posted March 21, 2021 Is it possible to get the information about "Advanced mode" from mouse location x,y ?
Nine Posted March 21, 2021 Posted March 21, 2021 Yes : expandcollapse popup#include <Constants.au3> #include <WindowsConstants.au3> #include <StructureConstants.au3> #include <WinAPISysWin.au3> #include <APISysConstants.au3> Opt("MustDeclareVars", 1) HotKeySet("{ESC}", _Exit) Example() Func Example() Local $hWnd, $tPoint = DllStructCreate($tagPOINT) Local $hTarget, $sClass, $sClassList, $iInstance, $hCtrl While 1 $tPoint.X = MouseGetPos(0) $tPoint.Y = MouseGetPos(1) $hTarget = _WinAPI_WindowFromPoint($tPoint) $sClass = _WinAPI_GetClassName($hTarget) $hWnd = _WinAPI_GetAncestor($hTarget, $GA_ROOT) ConsoleWrite($hWnd & "/" & $hTarget & "/" & $sClass) If $hWnd <> $hTarget And $sClass <> "" Then $sClassList = WinGetClassList($hWnd) StringReplace($sClassList, $sClass, $sClass) $iInstance = @extended ConsoleWrite("(" & $iInstance & ") ") For $i = 1 To $iInstance $hCtrl = ControlGetHandle($hWnd, "", $sClass & $i) If $hCtrl = $hTarget Then ConsoleWrite(" [CLASS:" & $sClass & "; INSTANCE:" & $i & "]") ExitLoop EndIf Next EndIf ConsoleWrite(@CRLF) Sleep(500) WEnd EndFunc ;==>Example Func _Exit() Exit EndFunc ;==>_Exit pixelsearch and Asaf_Ank 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Nine Posted March 21, 2021 Posted March 21, 2021 Let me review my previous post. After playing with it, I noticed that it was not able to detect disabled controls. So here a new version : expandcollapse popup#include <Constants.au3> #include <WindowsConstants.au3> #include <StructureConstants.au3> #include <WinAPISysWin.au3> #include <APISysConstants.au3> #include <WinAPIConv.au3> Opt("MustDeclareVars", 1) HotKeySet("{ESC}", _Exit) Example() Func Example() Local $hWnd, $tPoint = DllStructCreate($tagPOINT) Local $hTarget, $sClass, $sClassList, $iInstance, $hCtrl While 1 $tPoint.X = MouseGetPos(0) $tPoint.Y = MouseGetPos(1) $hTarget = _WinAPI_WindowFromPoint($tPoint) $hWnd = _WinAPI_GetAncestor($hTarget, $GA_ROOT) If $hTarget = $hWnd Then _WinAPI_ScreenToClient($hWnd, $tPoint) $hTarget = _WinAPI_ChildWindowFromPointEx ($hWnd, $tPOINT) EndIf $sClass = _WinAPI_GetClassName($hTarget) ConsoleWrite ($hWnd & "/" & $hTarget & "/" & $sClass) If $hWnd <> $hTarget And $sClass <> "" Then $sClassList = WinGetClassList($hWnd) StringReplace($sClassList, $sClass, $sClass) $iInstance = @extended ConsoleWrite ("(" & $iInstance & ") ") For $i = 1 To $iInstance $hCtrl = ControlGetHandle($hWnd, "", $sClass & $i) If $hCtrl = $hTarget Then ConsoleWrite (" [CLASS:" & $sClass & "; INSTANCE:" & $i & "]") ExitLoop EndIf Next EndIf ConsoleWrite (@CRLF) Sleep(500) WEnd EndFunc ;==>Example Func _Exit() Exit EndFunc ;==>_Exit I could have modified the previous post, but I thought you would prefer a new snippet so you can compare and study the changes made. Asaf_Ank 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Nine Posted March 22, 2021 Posted March 22, 2021 Just now, Asaf_Ank said: Is it possible to do it in C#? Meh ? It is an AutoIt forum here not a C# ! But to answer your question : yes. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Asaf_Ank Posted March 22, 2021 Author Posted March 22, 2021 (edited) Yes.. In AutoIt DLL import to C#. I asking that is because some of the functions you used do not exist in the DLL. AutoItX3.Assembly.xml AutoItX3.Assembly.dll Edited March 22, 2021 by Asaf_Ank
Nine Posted March 22, 2021 Posted March 22, 2021 I see. But most of the functions are WinAPI which are available in C#. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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