faustf Posted November 22, 2019 Share Posted November 22, 2019 hi guys , how is possible find a colour in all window-form , that specif program ?? , explain my scenario : i have a program for accounting , it connect in internet and in db , sometime the program disconnect to db and appear in window-form (in down) , over the status bar a red rectangle with tip: Disconnected to db . i want create a program , when only in accounting windows form appear a red pixel , send some controlsend to reconnect i have creted a program like this #include <Array.au3> #include <Color.au3> #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <GuiStatusBar.au3> #include <Date.au3> _CtrlConnDB() Func _CtrlConnDB() $hWnd = WinList ("Control Center - Untitled1","") For $i = 1 to $hWnd[0][0] $Coord = PixelSearch(200, 200, 10, 10, 0xFF0000 ,"","",$hWnd[$i][1]) If Not @error Then MsgBox(64, "", "X and Y are: " & $Coord[0] & "," & $Coord[1]) EndIf Next EndFunc but for pixelsearch i must give a dimension , is possible tell at pixel search find in handel of window-form , without insert a dimension?? or exist somthing similar?? thankz Link to comment Share on other sites More sharing options...
faustf Posted November 22, 2019 Author Share Posted November 22, 2019 i answer me thANkz at all i used Local $aPos = WinGetPos("Control Center - Untitled1") PixelSearch($aPos[0], $aPos[1], $aPos[0] + $aPos[2], $aPos[1] + $aPos[3], thankz again Link to comment Share on other sites More sharing options...
Musashi Posted November 22, 2019 Share Posted November 22, 2019 25 minutes ago, faustf said: $hWnd = WinList ("Control Center - Untitled1","") Even if AutoIt doesn't care, you should use correct prefixes for variables, see : Best_coding_practices Otherwise you will only confuse yourself . A look at the Help will not hurt either, there are good reasons why people have spent thousands of hours creating it. WinList returns an array - not a handle, so use e.g. : Local $aWindowsList = WinList() faustf 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
faustf Posted November 23, 2019 Author Share Posted November 23, 2019 ups yea sorry Link to comment Share on other sites More sharing options...
junkew Posted November 26, 2019 Share Posted November 26, 2019 So for boolean $bCar or $isCar😀 for a boolean? best coding practices have changed due to better IDE that tells you the type when you hover over them or new coding practices. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
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