HomeMicrosoftFree add-ons


POI Scanner 1.1 Beta for S&T and Autoroute 2006-2008
toyfountain
[EDIT] New version available at: http://www.laptopgpsworld.com/216-poi-scanner-microsoft-streets-trips

I've just finished a POI Scanner for Microsoft Streets and Trips. This Scanner functions by determining the zoom level range by locating the zoom level in the tracker bar. Then it locates the first dark burgundy pixels in the GPS icon. Once this is known it searches for a pink pixel located in the maroon tack or maroon flag.

If it detects the POI within approximately 500 meters when scanning, it will beep quickly 5 times, then beep once every 20 seconds until you have cleared the POI by 500 meters. The beep is independent of the volume control. Even when the volume is muted the beep will function.

To use this tracker:
1) You must NOT use the red tack, it contains the same colour of burgundy pixels of the GPS icon.
2) You must use the maroon tack or maroon flag for the POI.
3) Avoid using custom made POI which contains pixels of the same colour as the burgundy or pink pixels used in search.
4) Hide places that use the purple icons in Find Nearby Places to avoid false positives recognitions of the maroon tack.

Settings used in testing:
Windows XP normal colours.
This POI was made on a resolution of 1280X800 pixels. It is set to scan for a distance of approximately 500 meters. Using a larger resolution should result in reducing the distance of 500 meters since there will be more pixels.

Download POI SCanner for S&T 2008: POI Scanner for Microsoft Streets & Trips

Download POI Scanner for S&T and Autoroute 2006-2007: POI Scanner for Microsoft Streets & Trips

I do not expect it to work completely in other resolutions yet. I've tested lower resolutions and the zoom track bar appears to remain functional in all resolutions. That's good news. What changes is the scan distance. As the resolution lowers, the distance increases. I expect it to decrease as the resolution increases. I've included the source code if you are interested in modifying the scan distance settings as you wish for your personal use.
Zoom pixel are to set the distance to search for:
$Zoom_pixel_1 = 310
$Zoom_pixel_2 = 109
$Zoom_pixel_3 = 37
$Zoom_pixel_4 = 15

I made a short video of the POI Scanner to help in visualizing how it operates. It's uploaded it on Youtube.
Be sure to raise the volume on your system. It is somewhat low on this video clip. YouTube - POI Scanner for Streets & Trips 2006-2008 beta

It lasts one minute and eight seconds. In it I inserted a maroon flag to indicate a POI on the highway. I used the red tack to simulate the moving GPS icon. When it reaches a distance less than 500 meters, it beeps five times. I then approach the red tack nearer and 20 seconds after the initial quick 5 beeps, it beeps again once. I move back the tack farther than 500 meters for 20 seconds. The Beep counters resets. The next time it detects the POI, it sounds off 5 times again.

I'm sorry for the poor focus, the camera is of the cheap kind sold at Canadian Tire. It does not have a manual focus.
Attached Images
File Type: jpg maroon_tack2.jpg (20.0 KB)
File Type: gif gps_arrow.gif (10.7 KB)
toyfountain
Will be posting modified files in the future as soon as I can. These files contain both the .exe and source (.au3) files.

Bugs to figure out so far:

1) On exit with S&T 2008, S&T 2008 creates an error report when S&T 2008 is closed before the POI Scanner.
2) On exit with S&T 2006, an AutoIt error is made if S&T 2006 is closed if the POI Scanner has not detected a POI.
Marvin Hlavac
I was sooo excited to try it , but Windows Vista doesn't have the green on the zoom slider . Also, my resolution is different.
toyfountain
Can you post a bmp of the slider? I'll try to see if a colour is unique in there. Might as well post a full screenshot too in the resolution you are using. I can try and see what it does to the set scan distance.

Another workaround could be to create a new user account if you can use the Windows XP parameters with Vista. I know in the user account I created for the night mode I talked about earlier, it modified the green colour pixels too.

edit: I just viewed an image with Vista, looks like all grey. I checked using the classic Windows 98 colours. It is a three tone grey. None of which are unique. Your best bet is with a second user account if you can select the Win XP colours on it.
toyfountain
Subject of this post moved to the first post. (video)
Marvin Hlavac
Nice demo on YouTube. And yes, the Vista slider is just a couple of shades of grey. Hmm, doesn't AutoIt have a function that can tell the position of the control? Maybe not, I'm just not sure now. But it may be worth double checking the Help file, or asking in their forum.
toyfountain
I have good news for you. I think I gigured hoe to do it for Vista and Win98. Can you confirm the colours for these three pixels are as shown on the pix.

I used SI ColorPicker to determine the codes
http://www.softinstitute.com/soft/sicolorpicker.htm
Attached Images
Marvin Hlavac
I'm not on the road today, and my only Vista installation is my mobile pc. But I will do it tomorrow.
toyfountain
Marvin

I think if you replace this section in the original code, the zoom tracker should work. If you activate the second message box, it should show the pixel count. The maximum zoom should result in 419 for the x coordinate. BTW, I missed a zoom level in my original distance code section for 383 pixels = 70km zoom level. I'll be adding this later. I left three lines for the colours of Vista, XP and classic 98 colours. I left on the Vista line activated in the code below.

$counter_zoom = 0
Do
If WinActive($productname, "Map Control") Then
ControlFocus($productname, "", "msctls_trackbar321")
$pos_msctls_trackbar321 = ControlGetPos($productname, "", 31000)
;MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )
$left_ZoomScan = $pos_msctls_trackbar321[0]
$top_ZoomScan = $pos_msctls_trackbar321[1]
$right_ZoomScan = $pos_msctls_trackbar321[0] + $pos_msctls_trackbar321[2]
$bottom_ZoomScan = $pos_msctls_trackbar321[1] + $pos_msctls_trackbar321[3] + $titlebarhight

$coord_zoom = PixelSearch($left_ZoomScan, $top_ZoomScan, $right_ZoomScan, $bottom_ZoomScan, 0x958889, 0, 1 ) ; Win Vista
;$coord_zoom = PixelSearch($left_ZoomScan, $top_ZoomScan, $right_ZoomScan, $bottom_ZoomScan, 0x1DA21B, 0, 1 ) ; Win XP style
;$coord_zoom = PixelSearch($left_ZoomScan, $top_ZoomScan, $right_ZoomScan, $bottom_ZoomScan, 0x404040, 0, 1 ) ; classic win 98

If Not @error Then
;MsgBox(0, "X and Y are:", $coord_zoom[0] & "," & $coord_zoom[1]) ;activate this message box to view the pixel count
$x_coord_zoom = $coord_zoom[0]
$counter_zoom = $counter_zoom + 1
EndIf
EndIf
Until $counter_zoom > 0
toyfountain
Marvin

Can you tell me if this exists in Vista
HKEY_LOCAL_MACHINE\Software\Microsoft\Updates\Windows Vista

while not
HKEY_LOCAL_MACHINE\Software\Microsoft\Updates\Windows XP
while not
HKEY_LOCAL_MACHINE\Software\Microsoft\Updates\Windows 98

If this is the case, it might be a way for the scanner to detect on which system it is running and adapting the pixelsearch of the zoom tracker accordingly.
Marvin Hlavac
... or you could use:

If @OSVersion = "WIN_VISTA" Then

toyfountain
Great, even better. I'll try to find a difference when Win XP runs in Win 98 style or XP style.

Plus I just noticed in the help files these, @DesktopWidth
and @DesktopHeight . This could be used to set up different resolution settings for the scan distance.
Marvin Hlavac
I just looked at the pixel values. In RGB format, from left to right, they are 193,193,193 112,112,112 141,141,141
toyfountain
So if I understand correctly. You used RGB dec. I had used RGB hex.
If we are aiming for the far right one which had the RGB hex colour 95,88,89
the line should be?
$coord_zoom = PixelSearch($left_ZoomScan, $top_ZoomScan, $right_ZoomScan, $bottom_ZoomScan, "141141141", 0, 1 )

Can you test it with Vista? You just need to alter the pixelsearch line with the correct code for the far right pixel. You can read the values given by activating the second message box line.

Your values should be



Edit: Or can you post or email an unmodified BITMAP screen capture of the zoom tracker button (or the whole page if need be) using PAINT. When the tracker button is in GIF format it seems to modify the pixels. I have about 4 MB of space left in my email account.
Attached Images
Marvin Hlavac
Here's the screenshot from Vista (in .tif).

http://www.laptopgpsworld.com/images/uploads/zoom-slider-for-toyfountain-20071224.tif

I'm going to search to see if there is some function in AutoIt that could tell us the position of the zoom slider. It would make your work easier.
Marvin Hlavac
Toyfountain, see if this can be of any help:


#Include <GuiSlider.au3>
Opt("WinTitleMatchMode", 2)
WinActivate("- Microsoft Streets & Trips")
Sleep(1000)
$h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
MsgBox(0,"",_GUICtrlSliderGetPos($h_slider))


Start your Streets & Trips, and then run the script. A message box should display the position of the zoom slider (between 1 and 100). You may ignore the WinActivate() and Sleep() in your own script.
toyfountain
Thanks Marvin. Holidays, I've been away for a few days.

It works to get the value betwwen 1 and 100, but I run into two problems.

The first, cannot declare constants twice was easily solved. I moved the line
#Include <GuiSlider.au3>
with the Global constants.

Secondly, edited: found the solution below for the looping problem.
toyfountain
I found it trying other lines. It's

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$counter_zoom = 0
Do
if WinActive($productname, "Map Control") Then
Opt("WinTitleMatchMode", 2)
WinActivate("- Microsoft Streets & Trips")
ControlFocus($productname, "", "msctls_trackbar321")
$h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
$x_coord_zoom = _GUICtrlSliderGetPos($h_slider)
$counter_zoom = $counter_zoom + 1
EndIf
Until $counter_zoom > 0
$counter_GPS = 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

and not forgetting to modify the lines
from
If $x_coord_zoom <= 419 and $x_coord_zoom > 410 Then ; 419 = 1 km
to
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 419 = 1 km


This should work in all OS versions and I close the advanced toolbar to hide the zoom tracker. It still worked even after I modified the zoom level with my mouse's scroll wheel. I expect it would work truefull screen enabled too.

I uploaded the new version 1.2 beta in the first post
Marvin Hlavac
I haven't tried to add it to your application, I only tested the few lines I posted. I was also hoping it would work in full-screen mode, but I'm afraid it doesn't, (unless there is some other way to do it).
toyfountain
Did you test the new version 1.2 beta in true full screen? Even when I close the zoom tracker toolbar it still works. Unfortunately I can't test it myself until I repair my laptop.


Edit: I'm receiving a GPS signal even at my desk. From what I can tell, it appears to work in true full screen. I am getting a false positive with the maroon tack. I think it is set by the purple icons in nearby places. When I hide all places in find nearby places the false positive goes away.


I uploaded the new version 1_2_1 beta in the first post
It disables a controlfocus line that was conflicting with list boxes of S&T.
Marvin Hlavac
I was just playing with it a bit. I hear barely any sound. It is very weak. It isn't a beep, it only is just some very weak static noise. I don't know what the problem is, and I may try it later on another computer. In the mean time I just substituted the Beep(500, 200) with SoundPlay(@WindowsDir & "\media\tada.wav",1)

I'll play with it a bit now. I do hear sound in full screen mode, but I think the _GUICtrlSliderGetPos($h_slider) will not really work in full screen mode.
Marvin Hlavac
I was going to take it for a drive, but I ran into a problem: Streets & Trips was having difficult time refreshing screen. The red GPS icon was not showing at all, and neither were street names. I checked the CPU usage, and yes, the POI Scaner was up at around 30%. I added Sleep(5) to your two DO loops and to your one WHILE loop, and the CPU usage went down to 3%. I think you could increase the Sleep() to 100 milliseconds without any problem. Or even 1 second? I'm not sure. I'll take it for a drive as is with 5ms sleep.
Marvin Hlavac
The _GUICtrlSliderGetPos indeed works even in full-screen mode. It was an error on my part that made me originally think it didn't work !!! It does! I was driving around with your POI Scanner (with the three added Sleep() functions), and I was wondering why it worked well even in full-screen mode. Then I did a simple test, and yes... .

So far so good . I'm just looking forward to you fixing your laptop so you can test it on the road to see if all works as you designed it. It is starting to be interesting !!!
toyfountain
I'm really glad you finally get to hear what I've been hearing for a while now. If you want it even more interesting here are a few ideas that could be implemented in future development.

Imagine bundling the scanner with three custom made pushpin with each associated with a different sound. One could be used for red light cameras, another for known speed traps and the last for any other item wanted. All three could be set to whatever a user prefers too.

Just replace the beep sound (which can not be increased in volume, might even be too low to hear in a truck)
Beep(500, 200)
with the three different sounds used in the turnbeep function.
DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
These can be increased in volume if the sound is too low to hear.
(edit: I see above you already replaced the beep sound, good. Even more options that won't interfere with Keys)


Instead of scanning 500 meters by default, the distance scanned for each POI could be user selected in an options menu.

Can you post a zip file of your modified code with the added sleep commands where it uses less cpu coverage?

Do you remember Driven 1's request? Looks like we'll be able to answer with a positive on this eventually if it all works well together.
Marvin Hlavac
Here's your code with the two minor modifications:

* Three new instances of Sleep(1000) were added. I decided (without much thinking) to just set it to 1 second (1000 ms). GPS position refreshes once per second, so I'm thinking this delay will not harm anything. I tested it today, and it appears OK. But you do your tests to make sure all is working as you designed it. CPU usage is now 0 (zero ). If you wish to speed it up, Sleep(100) should still keep CPU usage close to 0.

* Two instances of SoundPlay(@WindowsDir & "\media\tada.wav",1) were added (to replace the existing "beep" code - I just don't hear it on my PC for some reason.

Code:
   $versionnumber = "1.2"
  ;$versionyear = 2008
  ;$REG_versionnumber = "15.0"
  Opt("WinTitleMatchMode", 2)
  Opt("WinTextMatchMode", 2)
  Opt("MouseClickDelay", 250)
  Opt("SendKeyDelay", 250)
  Global Const $GUI_EVENT_CLOSE = -3
  Global Const $GUI_EVENT_RESTORE = -5
  Global Const $GUI_CHECKED = 1
  Global Const $GUI_UNCHECKED = 4
  Global Const $GUI_SHOW = 16
  Global Const $GUI_HIDE = 32
  Global Const $GUI_ENABLE = 64
  Global Const $GUI_DISABLE = 128
  Global Const $GUI_FOCUS = 256
  Global Const $ES_READONLY = 0x0800
  Global Const $BS_DEFPUSHBUTTON = 0x0001
  Global Const $WS_SYSMENU = 0x00080000
  Global Const $WS_CAPTION = 0x00C00000
  Global Const $WS_POPUP = 0x80000000
  Global Const $WS_EX_TOPMOST = 0x00000008
  Global Const $LVS_SORTASCENDING = 0X0010
  Global Const $LVS_SINGLESEL = 0x0004
  Global Const $LVS_NOCOLUMNHEADER = 0x4000
  Global Const $LVS_SHOWSELALWAYS = 0x0008
  Global Const $LVS_EX_GRIDLINES = 0x00000001
  Global Const $LVS_EX_FULLROWSELECT = 0x00000020
  Global Const $TCS_MULTILINE = 0x0200
  Global Const $TCS_FOCUSNEVER = 0x8000
  Global Const $LVM_SETCOLUMNWIDTH = 0x101E
  Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036
  #Include <GuiSlider.au3>
  TraySetToolTip("POI Scanner " & $versionnumber & " for MS S&&&T and Autoroute 2008")
  $productname = "- Microsoft Streets & Trips"
  $titlebarhight = 30  ;$windowframehight = 4      ;$windowframewidth = 4
  Opt("TrayMenuMode", 1)
  Opt("TrayOnEventMode", 1)
  $exititem = TrayCreateItem("Exit - Quitter")
  TrayItemSetOnEvent($exititem, "HandleTray")
  TraySetState()
  ProcessSetPriority(@ScriptName, 1)
  $STpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\USA", "InstallTo")
  $ARpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\EUR", "InstallTo")
  $scan = 0
  While 1
  If WinExists($productname, "Task Panel") Then            
              $Zoom_pixel_1 = 310
              $Zoom_pixel_2 = 109
              $Zoom_pixel_3 = 37
              $Zoom_pixel_4 = 15
  EndIf
  If Not WinExists($productname, "Task Panel") Then     
              $Zoom_pixel_1 = 350
              $Zoom_pixel_2 = 126
              $Zoom_pixel_3 = 42
              $Zoom_pixel_4 = 17
  EndIf
      $counter_zoom = 0  
      Do
              if WinActive($productname, "Map Control") Then        
          Opt("WinTitleMatchMode", 2)
          WinActivate("- Microsoft Streets & Trips")
                  ;ControlFocus($productname, "", "msctls_trackbar321")
                  $h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
                  $x_coord_zoom = _GUICtrlSliderGetPos($h_slider)                        
                  $counter_zoom = $counter_zoom + 1           
              EndIf                
              Sleep(1000)
      Until $counter_zoom > 0
      $counter_GPS = 0
              Do
              If WinActive($productname, "Map Control") Then        
                  $pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
                  $left_GPSsearch = $pos_AfxWnd802[0]
          $top_GPSsearch = $pos_AfxWnd802[1]
          $right_GPSsearch = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
          $bottom_GPSsearch = $pos_AfxWnd802[1] + $pos_AfxWnd802[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 
                                      $counter_GPS = $counter_GPS + 1
                              EndIf
                          EndIf    
                          Sleep(1000)
      Until $counter_GPS > 0
              If WinActive($productname, "Map Control") Then
                  If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
                                      $left_MaroonTackScan = $pos_AfxWnd802[0]
                      $top_MaroonTackScan = $pos_AfxWnd802[1]
                                      $right_MaroonTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
                                      $bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight    
                      $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )  ;0x1DA21B  FF00FF
                                  If @error Then
                                  $scan = 0
                                  EndIf
                                  If Not @error Then
                                 ; Beep(500, 200)
                                                  SoundPlay(@WindowsDir & "\media\tada.wav",1)
                          Sleep(500)
                                  $scan = $scan + 1
                                                  EndIf
                                  If $scan > 4 Then
                          Sleep(19500)                           
                                                  EndIf 
                          EndIf    
                          If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km  
                                      $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_1
                      $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_1
                                      $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_1
                                      $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_1             
                      $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
                                                  If @error Then
                                  $scan = 0
                                                  EndIf
                                  If Not @error Then
                                  ; Beep(500, 200)
                                                  SoundPlay(@WindowsDir & "\media\tada.wav",1)
                          Sleep(500)
                                  $scan = $scan + 1
                                                  EndIf
                                  If $scan > 4 Then
                          Sleep(19500)                                   
                          EndIf    
                          EndIf
                          If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km   ; 80 = 8 km
                                      $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_2
                      $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_2
                                      $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_2
                                      $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_2             
                      $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
                                                  If @error Then
                                  $scan = 0
                                                  EndIf
                                  If Not @error Then
                                  ; Beep(500, 200)
                                                  SoundPlay(@WindowsDir & "\media\tada.wav",1)
                          Sleep(500)
                                  $scan = $scan + 1
                                                  EndIf
                                  If $scan > 4 Then
                          Sleep(19500)                                   
                          EndIf    
                          EndIf    
                          If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
                                      $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_3
                      $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_3
                                      $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_3
                                      $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_3             
                      $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
                                                  If @error Then
                                  $scan = 0
                                                  EndIf
                                  If Not @error Then
                                 ; Beep(500, 200)
                                         SoundPlay(@WindowsDir & "\media\tada.wav",1)
                          Sleep(500)
                                  $scan = $scan + 1
                                                  EndIf
                                  If $scan > 4 Then
                          Sleep(19500)                                   
                          EndIf    
                          EndIf
                          If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km  50 = 175 km
                                      $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_4
                      $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_4
                                      $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_4
                                      $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_4              
                      $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
                                                  If @error Then
                                  $scan = 0
                                                  EndIf
                                  If Not @error Then
                                  ;Beep(500, 200)
                                                  SoundPlay(@WindowsDir & "\media\tada.wav",1)
                          Sleep(500)
                                  $scan = $scan + 1
                                                  EndIf
                                  If $scan > 4 Then
                          Sleep(19500)                                   
                          EndIf    
                          EndIf
                          If $x_coord_zoom <= 50 Then  ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
                          Sleep(100)                                       
 
                          EndIf
              EndIf
              Sleep(1000)
  WEnd
  Func HandleTray()
              Local $TrayMsg = @TRAY_ID
              Switch $TrayMsg
 
                          Case $exititem
                                      Exit
              EndSwitch
  EndFunc
Yes, I still do remember the request by Driven1 and others. It seems like you have managed to do it - it seems the project is very close to being done. I personally would have never even attempted to start working on this project for a very simple reason: I just didn't believe it was possible to do it !!!
toyfountain
Marvin

I added two custom flags to the maroon tack each with it's own sound. They all scan at 500 meters. Can you check if the cpu usage is too high? If so, can you see what can be done to improve it.

I've joined the two bitmap images of the flags to import for a custom pushpin.
I plan on getting better colours for the flags later.

Code:
$versionnumber = "1.2.1"
;$versionyear = 2008
;$REG_versionnumber = "15.0"
Opt("WinTitleMatchMode", 2)
Opt("WinTextMatchMode", 2)
Opt("MouseClickDelay", 250)
Opt("SendKeyDelay", 250)
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_EVENT_RESTORE = -5
Global Const $GUI_CHECKED = 1
Global Const $GUI_UNCHECKED = 4
Global Const $GUI_SHOW = 16
Global Const $GUI_HIDE = 32
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $GUI_FOCUS = 256
Global Const $ES_READONLY = 0x0800
Global Const $BS_DEFPUSHBUTTON = 0x0001
Global Const $WS_SYSMENU = 0x00080000
Global Const $WS_CAPTION = 0x00C00000
Global Const $WS_POPUP = 0x80000000
Global Const $WS_EX_TOPMOST = 0x00000008
Global Const $LVS_SORTASCENDING = 0X0010
Global Const $LVS_SINGLESEL = 0x0004
Global Const $LVS_NOCOLUMNHEADER = 0x4000
Global Const $LVS_SHOWSELALWAYS = 0x0008
Global Const $LVS_EX_GRIDLINES = 0x00000001
Global Const $LVS_EX_FULLROWSELECT = 0x00000020
Global Const $TCS_MULTILINE = 0x0200
Global Const $TCS_FOCUSNEVER = 0x8000
Global Const $LVM_SETCOLUMNWIDTH = 0x101E
Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036
#Include <GuiSlider.au3>
TraySetToolTip("POI Scanner " & $versionnumber & " for MS S&&&T and Autoroute 2008")
$productname = "- Microsoft Streets & Trips"
$titlebarhight = 30  ;$windowframehight = 4      ;$windowframewidth = 4
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
$exititem = TrayCreateItem("Exit - Quitter")
TrayItemSetOnEvent($exititem, "HandleTray")
TraySetState()
ProcessSetPriority(@ScriptName, 1)
$STpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\USA", "InstallTo")
$ARpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\EUR", "InstallTo")
$scan = 0
While 1
If WinExists($productname, "Task Panel") Then    
    $Zoom_pixel_1 = 310
    $Zoom_pixel_2 = 109
    $Zoom_pixel_3 = 37
    $Zoom_pixel_4 = 15
EndIf
If Not WinExists($productname, "Task Panel") Then    
    $Zoom_pixel_1 = 350
    $Zoom_pixel_2 = 126
    $Zoom_pixel_3 = 42
    $Zoom_pixel_4 = 17
EndIf
    $counter_zoom = 0    
    Do
    if WinActive($productname, "Map Control") Then    
        Opt("WinTitleMatchMode", 2)
        WinActivate("- Microsoft Streets & Trips")
        ;ControlFocus($productname, "", "msctls_trackbar321")
        $h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
        $x_coord_zoom = _GUICtrlSliderGetPos($h_slider)        
        $counter_zoom = $counter_zoom + 1    
    EndIf
    Sleep(200)
    Until $counter_zoom > 0
    $counter_GPS = 0
    Do
    If WinActive($productname, "Map Control") Then
        $pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
        $left_GPSsearch = $pos_AfxWnd802[0]
        $top_GPSsearch = $pos_AfxWnd802[1]
        $right_GPSsearch = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
        $bottom_GPSsearch = $pos_AfxWnd802[1] + $pos_AfxWnd802[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    
            $counter_GPS = $counter_GPS + 1
            EndIf
        EndIf
        Sleep(200)
    Until $counter_GPS > 0
    If WinActive($productname, "Map Control") Then
        If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
            $left_MaroonTackScan = $pos_AfxWnd802[0]
            $top_MaroonTackScan = $pos_AfxWnd802[1]
            $right_MaroonTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
            $bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight    
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )  ;0x1DA21B  FF00FF
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)            
                EndIf 
        EndIf    
        If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km  
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_1
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_1
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_1
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_1        
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km   ; 80 = 8 km
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_2
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_2
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_2
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_2        
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf    
        If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_3
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_3
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_3
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_3        
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km  50 = 175 km
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_4
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_4
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_4
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_4         
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 50 Then  ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
                Sleep(100)                    
 
            EndIf
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Begin Green Tack scan
            If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
            $left_GreenTackScan = $pos_AfxWnd802[0]
            $top_GreenTackScan = $pos_AfxWnd802[1]
            $right_GreenTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
            $bottom_GreenTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight    
            $coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )  ;green tack
                If @error Then
                $scan_greentack = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_greentack = $scan_greentack + 1
                EndIf
                If $scan_greentack > 4 Then
                Sleep(4500)            
                EndIf 
        EndIf    
        If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km  
            $left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_1
            $top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_1
            $right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_1
            $bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_1        
            $coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
                If @error Then
                $scan_greentack = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_greentack = $scan_greentack + 1
                EndIf
                If $scan_greentack > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km   ; 80 = 8 km
            $left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_2
            $top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_2
            $right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_2
            $bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_2        
            $coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
                If @error Then
                $scan_greentack = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_greentack = $scan_greentack + 1
                EndIf
                If $scan_greentack > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf    
        If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
            $left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_3
            $top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_3
            $right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_3
            $bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_3        
            $coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
                If @error Then
                $scan_greentack = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_greentack = $scan_greentack + 1
                EndIf
                If $scan_greentack > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km  50 = 175 km
            $left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_4
            $top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_4
            $right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_4
            $bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_4         
            $coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
                If @error Then
                $scan_greentack = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_greentack = $scan_greentack + 1
                EndIf
                If $scan_greentack > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 50 Then  ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
                Sleep(100)                    
 
        EndIf
        ;;;;;;;;;;;;;;;;Begin grenn flag scan
                If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
            $left_GreenFlagScan = $pos_AfxWnd802[0]
            $top_GreenFlagScan = $pos_AfxWnd802[1]
            $right_GreenFlagScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
            $bottom_GreenFlagScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight    
            $coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )  ;0x1DA21B  FF00FF
                If @error Then
                $scan_green_flag = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_green_flag = $scan_green_flag + 1
                EndIf
                If $scan_green_flag > 4 Then
                Sleep(4500)            
                EndIf 
        EndIf    
        If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km  
            $left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_1
            $top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_1
            $right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_1
            $bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_1        
            $coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
                If @error Then
                $scan_green_flag = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_green_flag = $scan_green_flag + 1
                EndIf
                If $scan_green_flag > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km   ; 80 = 8 km
            $left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_2
            $top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_2
            $right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_2
            $bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_2        
            $coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
                If @error Then
                $scan_green_flag = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_green_flag = $scan_green_flag + 1
                EndIf
                If $scan_green_flag > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf    
        If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
            $left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_3
            $top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_3
            $right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_3
            $bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_3        
            $coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
                If @error Then
                $scan_green_flag = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_green_flag = $scan_green_flag + 1
                EndIf
                If $scan_green_flag > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km  50 = 175 km
            $left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_4
            $top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_4
            $right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_4
            $bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_4         
            $coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
                If @error Then
                $scan_green_flag = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                ;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
                ;Beep(500, 200)
                ;Sleep(500)
                $scan_green_flag = $scan_green_flag + 1
                EndIf
                If $scan_green_flag > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 50 Then  ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
                Sleep(100)                    
 
        EndIf
 
    EndIf
    Sleep(200)
WEnd
Func HandleTray()
    Local $TrayMsg = @TRAY_ID
    Switch $TrayMsg
 
        Case $exititem
            Exit
    EndSwitch
EndFunc
Attached Images
File Type: bmp blue flag.bmp (918 Bytes)
File Type: bmp purple flag.bmp (918 Bytes)
toyfountain
Marvin

You may or may not have to modify the colour of the blue flag from 0x003399 to 0x034EA2


Be careful, I had tried to use the default green flag and tack, but it conflicted with pixels in the map. I haven't renamed the code yet to follow the new flags pushpins. I just modified the colour codes for the pixel search.
Marvin Hlavac
Cool, I'll check that out, too. But first I just want to mention that on a few occasions I received a "false beep". It never happened in full-screen mode (that's excellent!), but on a few occasions it happened in windowed mode. First I though it might have been some other POI icons of similar color, so I turned off all POI's (in Find nearby places), and I even opened a new map file to make sure there is no pushpin of any kind - but it still occasionally gives "false beeps". I wonder if it may be seeing a pixel of the same color in some button on a toolbar. I'll try to take a screenshot of what I see on my screen when it happens.
toyfountain
I think I know why. I was experimenting with the green colour pixel and forgot to modify the code back to the pink pixel. Turms out the maroon tack still worked since it has green colour pixels in the tail of it. Green is a colour that gave me false returns with the second pushpin I tried to add. Make sure the code is set to pink for the maroon tack. It should be set to scan for 0xFF00FF , NOT 0x008080.

For the custom push pins, I noticed that when S&T imports them, the colours that are assigned are sometimes a different colour code for the pushpin. I'll try to identify and test each pixels in the standard push pins to see if another colour like pink is unique and not in the map.
toyfountain
I've prepared another for testing. I'm using the dark blue pushpin-tack-flag and the yellow push pin-tack-flag for the other two scans. In addition, in some zoom levels (80 to 90) it sometimes detects the yellow-dark blue pixels of icons in the standard, draw and other tool bars. It is best to close them. In true full screen this should not be a problem since the tool bars are gone. It also detects the dark blue nearby places like the train stations etc. It's best to hide them while scanning.

edited again: I prepared new code that solves the detection in the toolbars icons. I inserted a new top and bottom limit to the GPS search area.
toyfountain


An image makes it easier to understand. The code above is of my test scanner. It repeats the wav sounds faster than 20 seconds after the initial 5 wav plays.
I'll zip up a copy of the regular timed code once you have a chance to test the CPU usage. In the meantime, I've zipped up a copy of the test code scanner for S&T2008 and S&T2006-2007.

Code:
$versionnumber = "1.2.3"
;$versionyear = 2008
;$REG_versionnumber = "15.0"
Opt("WinTitleMatchMode", 2)
Opt("WinTextMatchMode", 2)
Opt("MouseClickDelay", 250)
Opt("SendKeyDelay", 250)
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_EVENT_RESTORE = -5
Global Const $GUI_CHECKED = 1
Global Const $GUI_UNCHECKED = 4
Global Const $GUI_SHOW = 16
Global Const $GUI_HIDE = 32
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $GUI_FOCUS = 256
Global Const $ES_READONLY = 0x0800
Global Const $BS_DEFPUSHBUTTON = 0x0001
Global Const $WS_SYSMENU = 0x00080000
Global Const $WS_CAPTION = 0x00C00000
Global Const $WS_POPUP = 0x80000000
Global Const $WS_EX_TOPMOST = 0x00000008
Global Const $LVS_SORTASCENDING = 0X0010
Global Const $LVS_SINGLESEL = 0x0004
Global Const $LVS_NOCOLUMNHEADER = 0x4000
Global Const $LVS_SHOWSELALWAYS = 0x0008
Global Const $LVS_EX_GRIDLINES = 0x00000001
Global Const $LVS_EX_FULLROWSELECT = 0x00000020
Global Const $TCS_MULTILINE = 0x0200
Global Const $TCS_FOCUSNEVER = 0x8000
Global Const $LVM_SETCOLUMNWIDTH = 0x101E
Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036
#Include <GuiSlider.au3>
TraySetToolTip("POI Scanner " & $versionnumber & " for MS S&&&T and Autoroute 2008")
$productname = "- Microsoft Streets & Trips"
$titlebarhight = 30  ;$windowframehight = 4      ;$windowframewidth = 4
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
$exititem = TrayCreateItem("Exit - Quitter")
TrayItemSetOnEvent($exititem, "HandleTray")
TraySetState()
ProcessSetPriority(@ScriptName, 1)
$STpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\USA", "InstallTo")
$ARpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\EUR", "InstallTo")
$scan = 0
While 1
If WinExists($productname, "Task Panel") Then    
    $Zoom_pixel_1 = 310
    $Zoom_pixel_2 = 109
    $Zoom_pixel_3 = 37
    $Zoom_pixel_4 = 15
EndIf
If Not WinExists($productname, "Task Panel") Then    
    $Zoom_pixel_1 = 350
    $Zoom_pixel_2 = 126
    $Zoom_pixel_3 = 42
    $Zoom_pixel_4 = 17
EndIf
    $counter_zoom = 0    
    Do
    if WinActive($productname, "Map Control") Then    
        Opt("WinTitleMatchMode", 2)
        WinActivate("- Microsoft Streets & Trips")
        $h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
        $x_coord_zoom = _GUICtrlSliderGetPos($h_slider)        
        $counter_zoom = $counter_zoom + 1    
    EndIf
    Sleep(300)
    Until $counter_zoom > 0
    $counter_GPS = 0
    Do
    If WinActive($productname, "Map Control") Then
        $pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
        $left_GPSsearch = $pos_AfxWnd802[0]
        $top_GPSsearch = $pos_AfxWnd802[1]
        $right_GPSsearch = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
        $bottom_GPSsearch = $pos_AfxWnd802[1] + $pos_AfxWnd802[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    
            $counter_GPS = $counter_GPS + 1
            EndIf
        EndIf
        Sleep(300)
    Until $counter_GPS > 0
    If WinActive($productname, "Map Control") Then
        If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
            $left_MaroonTackScan = $pos_AfxWnd802[0]
            $top_MaroonTackScan = $pos_AfxWnd802[1]    
            $right_MaroonTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
            $bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight    
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )  ;0x1DA21B  FF00FF
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)            
                EndIf 
        EndIf    
        If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km  
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_1
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_1
                if $top_MaroonTackScan < $top_GPSsearch Then
                    $top_MaroonTackScan = $pos_AfxWnd802[1]
                endif            
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_1
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_1    
                if $bottom_MaroonTackScan > $bottom_GPSsearch Then
                    $bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km   ; 80 = 8 km
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_2
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_2
                if $top_MaroonTackScan < $top_GPSsearch Then
                    $top_MaroonTackScan = $pos_AfxWnd802[1]
                endif            
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_2
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_2
                if $bottom_MaroonTackScan > $bottom_GPSsearch Then
                    $bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif                
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf    
        If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_3
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_3
                if $top_MaroonTackScan < $top_GPSsearch Then
                    $top_MaroonTackScan = $pos_AfxWnd802[1]
                endif            
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_3
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_3
                if $bottom_MaroonTackScan > $bottom_GPSsearch Then
                    $bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km  50 = 175 km
            $left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_4
            $top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_4
                if $top_MaroonTackScan < $top_GPSsearch Then
                    $top_MaroonTackScan = $pos_AfxWnd802[1]
                endif            
            $right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_4
            $bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_4
                if $bottom_MaroonTackScan > $bottom_GPSsearch Then
                    $bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
                If @error Then
                $scan = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\ding.wav", 1)
                $scan = $scan + 1
                EndIf
                If $scan > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 50 Then  ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
                Sleep(100)                    
 
            EndIf
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Begin DarkBlue scan
            If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
            $left_DarkBlueScan = $pos_AfxWnd802[0]
            $top_DarkBlueScan = $pos_AfxWnd802[1]
            $right_DarkBlueScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
            $bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight    
            $coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )  ;dark blue colour of the pushpin, flag, tack
                If @error Then
                $scan_DarkBlue = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                $scan_DarkBlue = $scan_DarkBlue + 1
                EndIf
                If $scan_DarkBlue > 4 Then
                Sleep(4500)            
                EndIf 
        EndIf    
        If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km  
            $left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_1
            $top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_1
                if $top_DarkBlueScan < $top_GPSsearch Then
                    $top_DarkBlueScan = $pos_AfxWnd802[1]
                endif            
            $right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_1
            $bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_1
                if $bottom_DarkBlueScan > $bottom_GPSsearch Then
                    $bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
                If @error Then
                $scan_DarkBlue = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                $scan_DarkBlue = $scan_DarkBlue + 1
                EndIf
                If $scan_DarkBlue > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km   ; 80 = 8 km
            $left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_2
            $top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_2
                if $top_DarkBlueScan < $top_GPSsearch Then
                    $top_DarkBlueScan = $pos_AfxWnd802[1]
                endif            
            $right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_2
            $bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_2
                if $bottom_DarkBlueScan > $bottom_GPSsearch Then
                    $bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
                If @error Then
                $scan_DarkBlue = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                $scan_DarkBlue = $scan_DarkBlue + 1
                EndIf
                If $scan_DarkBlue > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf    
        If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
            $left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_3
            $top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_3
                if $top_DarkBlueScan < $top_GPSsearch Then
                    $top_DarkBlueScan = $pos_AfxWnd802[1]
                endif            
            $right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_3
            $bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_3
                if $bottom_DarkBlueScan > $bottom_GPSsearch Then
                    $bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
                If @error Then
                $scan_DarkBlue = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                $scan_DarkBlue = $scan_DarkBlue + 1
                EndIf
                If $scan_DarkBlue > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km  50 = 175 km
            $left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_4
            $top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_4
                if $top_DarkBlueScan < $top_GPSsearch Then
                    $top_DarkBlueScan = $pos_AfxWnd802[1]
                endif            
            $right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_4
            $bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_4
                if $bottom_DarkBlueScan > $bottom_GPSsearch Then
                    $bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
                If @error Then
                $scan_DarkBlue = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
                $scan_DarkBlue = $scan_DarkBlue + 1
                EndIf
                If $scan_DarkBlue > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 50 Then  ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
                Sleep(100)                    
 
        EndIf
        ;;;;;;;;;;;;;;;;Begin Yellow pushpin scan
                If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
            $left_YellowPushpinScan = $pos_AfxWnd802[0]
            $top_YellowPushpinScan = $pos_AfxWnd802[1]
            $right_YellowPushpinScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
            $bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight    
            $coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )  ;0x1DA21B  FF00FF
                If @error Then
                $scan_YellowPushpin = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                $scan_YellowPushpin = $scan_YellowPushpin + 1
                EndIf
                If $scan_YellowPushpin > 4 Then
                Sleep(4500)            
                EndIf 
        EndIf    
        If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km  
            $left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_1
            $top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_1
                if $top_YellowPushpinScan < $top_GPSsearch Then
                    $top_YellowPushpinScan = $pos_AfxWnd802[1]
                endif            
            $right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_1
            $bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_1
                if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
                    $bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
                If @error Then
                $scan_YellowPushpin = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                $scan_YellowPushpin = $scan_YellowPushpin + 1
                EndIf
                If $scan_YellowPushpin > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km   ; 80 = 8 km
            $left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_2
            $top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_2
                if $top_YellowPushpinScan < $top_GPSsearch Then
                    $top_YellowPushpinScan = $pos_AfxWnd802[1]
                endif            
            $right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_2
            $bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_2
                if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
                    $bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
                If @error Then
                $scan_YellowPushpin = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                $scan_YellowPushpin = $scan_YellowPushpin + 1
                EndIf
                If $scan_YellowPushpin > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf    
        If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
            $left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_3
            $top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_3
                if $top_YellowPushpinScan < $top_GPSsearch Then
                    $top_YellowPushpinScan = $pos_AfxWnd802[1]
                endif            
            $right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_3
            $bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_3
                if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
                    $bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
                If @error Then
                $scan_YellowPushpin = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                $scan_YellowPushpin = $scan_YellowPushpin + 1
                EndIf
                If $scan_YellowPushpin > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km  50 = 175 km
            $left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_4
            $top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_4
                if $top_YellowPushpinScan < $top_GPSsearch Then
                    $top_YellowPushpinScan = $pos_AfxWnd802[1]
                endif            
            $right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_4
            $bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_4
                if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
                    $bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
                endif            
            $coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
                If @error Then
                $scan_YellowPushpin = 0
                EndIf
                If Not @error Then
                SoundPlay(@WindowsDir & "\media\notify.wav", 1)
                $scan_YellowPushpin = $scan_YellowPushpin + 1
                EndIf
                If $scan_YellowPushpin > 4 Then
                Sleep(4500)                    
                EndIf      
        EndIf
        If $x_coord_zoom <= 50 Then  ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
                Sleep(100)                    
 
        EndIf
 
    EndIf
    Sleep(200)
WEnd
Func HandleTray()
    Local $TrayMsg = @TRAY_ID
    Switch $TrayMsg
 
        Case $exititem
            Exit
    EndSwitch
EndFunc
Attached Images
File Type: jpg scanner.jpg (18.7 KB)
toyfountain
Marvin

I tried adding this code to let the Scanner detect which S&T is running between 2008 and 2006-2007. It didn't work. Can you suggest an alteration to the code? I have two S&T installed on my computer and would like the POI to be the same for 2006 to 2008. It would be nice to have to avoid using two versions.


Code:
If WinExists("AfxWnd802") Then
    $pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
EndIf    
If WinExists("AfxWnd702") Then    
    $pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd702")
EndIf
Marvin Hlavac
It would be easy (via registry) if a user had only one version installed. But some people may have two or more versions. Let me think about it a bit. Now I'm on the road. I just pulled over on the side of the road for a minute to wish you Happy New Year 2008 .
toyfountain
That's exactly my case. For testing it's best to have both version installed. I have come up with a new way for the wave sound and also found an alternative to scanning for the dark blue. In 2006, they use dark blue for gas stations in the map among several other things. I simply don't want to have to disable the nearby places.

I use the light grey in the tacks and surrounding the black circles-square-triangle. Can not use the yellow and maroon tacks tough because they set off two pixel detection. I have it for done for 2008. As always you need to avoid the POI with the dark burgundy pixels.

Here's an image of the pins you should use with it. Do not use the one's surrounded in burgundy with a slash across them.

The ones surrounded in grey play the windows\media\chimes.wav
The ones surrounded in yellow play the windows\media\notify.wav
The flag surrounded in pink plays the windows\media\ding.wav

Happy New Year to you, family and all others too.

I'll be hitting the road very soon also.
Attached Images
File Type: jpg POI 1_2_3.jpg (19.4 KB)
toyfountain
Quote:
Originally Posted by Marvin Hlavac
It would be easy (via registry) if a user had only one version installed. But some people may have two or more versions. Let me think about it a bit. Now I'm on the road. I just pulled over on the side of the road for a minute to wish you Happy New Year 2008 .
Marvin, I hope you had a great holiday.

I have good news on the task at hand. There is a way. It can even switch from 2006 to 2008 and vice versa without needing to restart the scanner. It looks for the Connected services button ID position in the 2008 S&T. It even works when the button is hidden with the navigation toolbar closed. All I need to test now is the full screen mode (I think it will work from what I can test at the desk).

$pos = ControlGetPos($productname, "", 35332)
If @error Then
$pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd702")
Else
$pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
EndIf
Marvin Hlavac
Ha ha, that's clever! It will not work for Streets & Trips 2009, though . For S&T Keys I just don't bother. When a new version of Streets & Trips comes out, I just stop working on the existing version. S&T is sooo inexpensive ...
Marvin Hlavac
toyfountain's newest version of POI Scanner is now available at: http://www.laptopgpsworld.com/216-poi-scanner-microsoft-streets-trips
© Laptop GPS WorldContact