The following code works perfectly in Vista - only if you are in Windows Classic Mode.
If you are using the defualt Vista theme, it locks up tight. Any ideas how to solve this issue?
Please excuse the messy code, it was the only way I could get it to reproduce the issue.
Code:
Start:
ControlGetPos, X13, Y13, W, H
EnvAdd, X13, 1
EnvAdd, Y13, 1
ControlGetPos, X14, Y14, W, H
EnvAdd, X14, 2
EnvAdd, Y14, 2
PixelSearch, , , %X13%, %Y13%, %X14%, %Y14%, 0FFFFFF, 255, Fast
If ErrorLevel = 0
{
Random, num, 1, 2
Goto, Spot%num%
}
Sleep, 1000
Goto, Start
Spot1:
MsgBox, Spot 1
ControlGetPos, X1, Y1, W, H
EnvAdd, X1, 100
EnvAdd, Y1, 100
ControlGetPos, X2, Y2, W, H
EnvAdd, X2, 200
EnvAdd, Y2, 200
PixelSearch, x30, y30, %X1%, %Y1%, %X2%, %Y2%, 0x200000
If ErrorLevel = 0
{
MsgBox, Match 1
Sleep, 1000
}
MsgBox, Leaving Spot 1
Goto, Start
Spot2:
MsgBox, Spot 2
ControlGetPos, X1, Y1, W, H
EnvAdd, X1, 100
EnvAdd, Y1, 100
ControlGetPos, X2, Y2, W, H
EnvAdd, X2, 200
EnvAdd, Y2, 200
PixelSearch, x30, y30, %X1%, %Y1%, %X2%, %Y2%, 0x200000
If ErrorLevel = 0
{
MsgBox, Match 2
Sleep, 1000
}
MsgBox, Leaving Spot 2
Goto, Start
[Title edited. Please write descriptive titles for your topics. ~jaco0646]