Jump to content

pixelserch color find in window form


faustf
 Share

Recommended Posts

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

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()

Musashi-C64.png

"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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...