#include <ImageSearch.au3>
MsgBox(0,"MSG","You need to have the should have recycle bin, and preferably, an IE icon, a PDF icon and folder icon for the demo to go nicely. All of them should be visible on the desktop")
$x1=0
$y1=0
$result = _ImageSearch("recycle2.bmp",1,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a empty recycle bin here...")
EndIf
$result = _ImageSearch("recycle2.bmp",0,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a empty recycle bin here... cursor move to top left of image")
EndIf
$result = _ImageSearch("recycle.bmp",1,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a recycle bin with stuff here...")
EndIf
$result = _ImageSearch("recycle.bmp",0,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a recycle bin with stuff here... cursor move to top left of image")
EndIf
MsgBox(0,"MSG","Search for a recycle bin in the top left corner in a 200x200 box")
$result = _ImageSearchArea("recycle2.bmp",1,0,0,200,200,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a empty recycle bin in top left corner")
EndIf
$result = _ImageSearchArea("recycle.bmp",1,0,0,200,200,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a recycle bin with stuff in top left corner")
EndIf
$result = _ImageSearch("ie7Desktop.bmp",0,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found an IE icon here")
EndIf
$result = _ImageSearch("pdf.bmp",0,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a PDF icon here")
EndIf
$result = _ImageSearch("folder.bmp",0,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Found a Folder icon here")
EndIf
MsgBox(0,"MSG","Empty your recycle bin and then click OK. Then throw something in the bin within 15s")
$result = _WaitForImageSearch("recycle.bmp",15,1,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Hey... your recycle bin now has stuff")
EndIf
MsgBox(0,"MSG","Using WaitForImages to see whether you have a full or empty bin")
Dim $anArray[10]
$anArray[0]=2
$anArray[1]="recycle.bmp"
$anArray[2]="recycle2.bmp"
$result = _WaitForImagesSearch($anArray,15,1,$x1,$y1,0)
if $result=1 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Hey... your recycle bin has stuff")
EndIf
if $result=2 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Hey... your recycle bin is empty")
EndIf
if $result=0 Then
MouseMove($x1,$y1,3)
MsgBox(0,"Found","Hey... cannot find your recycle bin")
EndIf