I got it to work with a separate application, but so far only for the full map pane. As soon as I try to reduce the area, it stops detecting the maroon POI tack I use for the unique pixel.
I suspect it's double looping. It needs to search for the GPS then search for the maroon tack. I am thinking of having Keys write the coords to the ini file. The having the S&T Scanner.exe read the coords from the ini file, then search a cropped area. It might prevent the double looping.
Here's beta the code I've set up in S&T Scanner.exe (this is the name of the new application).
While 1
If WinActive($productname, "Map Control") Then
$pos_AfxWnd702 = ControlGetPos($productname, "", "AfxWnd702")
$left_MaroonTackScan = $pos_AfxWnd702[0]
$top_MaroonTackScan = $pos_AfxWnd702[1]
$right_MaroonTackScan = $pos_AfxWnd702[0] + $pos_AfxWnd702[2]
$bottom_MaroonTackScan = $pos_AfxWnd702[1] + $pos_AfxWnd702[3] + $titlebarhight
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 2 ) ;careful here, the html inserted a line break
If Not @error Then
Beep(500, 200)
Sleep(1000)
EndIf
EndIf
WEnd
---------------------------------------------------------------
Here's the beta code I use for the GPS search in Keys.exe
unc push_pin()
reset_hotkeys()
Sleep(250)
ControlClick($productname, "", $panbutton)
ControlClick($productname, "", $panbutton)
Sleep(250)
MouseMove(600, 400, 0 )
ControlClick($productname, "", $createpushpin)
Sleep(250)
$pos_AfxWnd702 = ControlGetPos($productname, "", "AfxWnd702")
$left_GPSsearch = $pos_AfxWnd702[0]
$top_GPSsearch = $pos_AfxWnd702[1]
$right_GPSsearch = $pos_AfxWnd702[0] + $pos_AfxWnd702[2]
$bottom_GPSsearch = $pos_AfxWnd702[1] + $pos_AfxWnd702[3] + $titlebarhight
$coord_GPS = PixelSearch($left_GPSsearch, $top_GPSsearch, $right_GPSsearch, $bottom_GPSsearch, 0x800000, 0, 1 )
If Not @error Then
$coord_xGPS = $coord_GPS[0] - $left_GPSsearch - 8
$coord_yGPS = $coord_GPS[1] - $top_GPSsearch - $titlebarhight + 12
ControlFocus($productname, "", "AfxWnd702")
Sleep(250)
ControlClick($productname, "", "AfxWnd702", "left", 1, $coord_xGPS, $coord_yGPS )
EndIf
ControlClick($productname, "", $selectbutton)
EndFunc