Hi all. I'm testing this tool and i'm doing a little script with the Minesweeper of windows but i have a little problem [img]images/icons/frown.gif[/img] .

I have this code :


x_casillas = 9 'number of x cells
y_casillas = 9 'number of y cells

x_offset = 16 'size of the test3.bmp, a cell
y_offset = 16 'size of the test3.bmp, a cell

Window("Minesweeper Window").Attach
nom = Window.AttachName

For x_ = 0 To 170 'size of the window
For y_ = 0 To 259 'size of the window
Dim b As TBitmapCheck
nomCheck = "bitmapcheck" & x_ & y_
Set b = BitmapCheck(nomCheck)
b.Bitmap = "c:\test3.bmp"
b.AttachName = nom
'b.PixelThreshold = 2000
b.WindowClient = False
b.WindowTakeFocus = False
b.Region x_, y_, x_offset, y_offset
res = b.Execute
If res = True Then
MsgBox ("x: " & x_ & " - y: " & y_)
End If
Next y_
Next x_

-I have captured the minesweeper (alt+prtScr) and I have pasted it in the windows paint. I have saved it as a 24 bit BMP. It size is 170x259
-The test3.bmp is the screenshot of one cell of the the game board. Using the capture of the game in the paint, i have selected a cell and i have pasted it in another 24 bit paint BMP. The size of the cell is 16x16
-I'm trying to catch a region of the window with the next command: b.Region x_, y_, x_offset, y_offset, where x_ goes from 0 to 170 and y_ goes from 0 to 259, so TP will try to search the cell (test3.bmp) in all possible places of the window.
-I have removed the pause mode in the playback option because with the default settings, TP ran very slow

The result of this script is that the cell doesn't appear in the game window. So, What am I doing wrong?, Is the problem the image format? (I have tried with a 24 bit, 256 & 16 colors with the same result), Does TP support what i'm pretending to do? (I understand that yes)

Change the PixelThreshold doen't do anything, but I'm not sure why. The help says that only works with 2 bitmaps with the same size and here i'm comparing a 16x16 bitmap (test3.bmp) and a 16x16 region of the game window.

Thanks in advance!