MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




An API to Control MapPoint 2006 GPS Features - Part I of II

This is a discussion on An API to Control MapPoint 2006 GPS Features - Part I of II within the MP2K Magazine Articles forums, part of the Map Forums category; Paul Larson shares an API he developed to add programmatic GPS functionality to MapPoint code projects and includes a demo ...


Go Back   MapPoint Forums > Map Forums > MP2K Magazine Articles

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-31-2006
Eric Frost's Avatar
Administrator
Black Belt
 
Join Date: Jul 1992
Posts: 2,210
Blog Entries: 1
An API to Control MapPoint 2006 GPS Features - Part I of II

Paul Larson shares an API he developed to add programmatic GPS functionality to MapPoint code projects and includes a demo to illustrate how the API works.

"With the release of MapPoint 2006 North America (MP2K6NA) earlier this year, many users have been elated with the new map content and the addition of GPS features and Driving Guidance to the product. Likewise, many developers have thus found issue with the lack of improvement to the MapPoint API, specifically in relation to these new features. Being of the latter group, I decided to roll-my-own API to add programmatic GPS functionality to my MapPoint code projects."

Read the full article --
An API to Control MapPoint 2006 GPS Features - Part I of II - MapPoint Articles - MP2K Magazine

Discuss the article in this thread below by clicking on Post Reply or use the Quick Reply button on the right.
__________________
Order MapPoint 2006 | Read Programming MapPoint in .NET | Start Using the Pushpin Tool - Free Trial Download - click here.

Last edited by Eric Frost; 08-31-2006 at 10:23 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-07-2006
Senior Member
Green Belt
 
Join Date: Sep 2005
Location: Marshall, Michigan
Posts: 113
Exclamation Author's Note: Using the mpGPS API with MapPoint 2006 EUROPE

I've finally obtained a copy of MapPoint 2006 EUROPE, and noted a slight change needed in the code to handle a difference in this version.

For some reason, Microsoft embedded a CrLf combo in the text of the button to toggle voice prompting. So, in the module mpGPS.vb, in the New() procedure, add the following code:

'EDIT: In mappoint2006 EUROPE, there is a CrLf in the button caption for voice control:
If hwToggleVoice = 0 Then hwToggleVoice = FindWindowEx(hwChild(3), 0, vbNullString, "Turn Voice" & ControlChars.CrLf & "Off (F7)")

...immediately before the line which reads:
hwRepeatLastInstruction = FindWindowEx(hwChild(3), 0, vbNullString, "Repeat Instruction (Spacebar)")

Also, you will of course need to update the sample project (mpGPSDemo) reference for Interop.MapPoint to the correct version when using it with the European desktop product.

Best Regards,
Paul Larson
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-07-2006
Eric Frost's Avatar
Administrator
Black Belt
 
Join Date: Jul 1992
Posts: 2,210
Blog Entries: 1
Cool thanks, Eric
__________________
Order MapPoint 2006 | Read Programming MapPoint in .NET | Start Using the Pushpin Tool - Free Trial Download - click here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 09-14-2006
PC PC is offline
Junior Member
White Belt
 
Join Date: Jul 2002
Posts: 5
Thumbs up

Wonderful article, thanks.

When will part II be posted.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 09-27-2006
Junior Member
White Belt
 
Join Date: Mar 2006
Posts: 11
awesome work ... i'm eagerly waiting for part II.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 10-03-2006
Junior Member
White Belt
 
Join Date: Oct 2006
Location: austin, tx
Posts: 3
C# version

Here is a version I use that is in C#. This code should compile and provide the basic toggling of the GPS Pane. Enjoy
Attached Files
File Type: zip MapPointWin32API.zip (1.7 KB, 74 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 11-15-2006
Junior Member
White Belt
 
Join Date: Aug 2006
Posts: 9
Re: An API to Control MapPoint 2006 GPS Features - Part I of II

Great article, have recompiled for Mappoint Europe and it works fine. Anyone any clues how to extend this to hook the modal warning window pop up when navigation is selected and OK it automatically. Its a really annoying feature of mappoint!.

Cheers Pete
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 11-23-2006
Senior Member
Green Belt
 
Join Date: Sep 2005
Location: Marshall, Michigan
Posts: 113
Re: An API to Control MapPoint 2006 GPS Features - Part I of II

Hi Enigma

I'm not envisioning distributing the code to dismiss this warning as a part of the API, simply for liability reasons. However, if you contact me directly, I'd be happy to provide a code snippet.

Best Regards,
Paul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 11-24-2006
Junior Member
White Belt
 
Join Date: Aug 2006
Posts: 9
Re: An API to Control MapPoint 2006 GPS Features - Part I of II

Hi Paul

Thanks, I have sent you a PM.

Cheers Pete
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 12-12-2006
Senior Member
Green Belt
 
Join Date: Sep 2005
Location: Marshall, Michigan
Posts: 113
Re: An API to Control MapPoint 2006 GPS Features - Part I of II

Greetings!

Since I've had numerous requests for the code to automatically dismiss the "Safety Warning" dialog when calling my ToggleGuidance() method, I'm posting the code here for public use.

Simply replace the entire routine for ToggleGuidance() with the entire code below. (In module mpGPS.vb)

Note: By using this code you assume full responsibility and risk, and agree not to hold Paul Larson nor Paul Larson, LLC liable for damages.


'---BEGIN CODE---
Public Sub ToggleGuidance()
If lGPS_UseDrivingGuidance = False Then Dim myDismisser As New DismissSafetyWarning
SendMessage(hwProvideDrivingGuidance, BM_CLICK, 0, 0)
lGPS_UseDrivingGuidance = Not lGPS_UseDrivingGuidance
End Sub

Private Class DismissSafetyWarning
Private IsDismissed As Boolean = False
Public Sub New()
Dim myThread As System.Threading.Thread
myThread = New System.Threading.Thread(AddressOf DismissWarningThread)
myThread.Start()
End Sub
Private Sub DismissWarningThread()
Dim Retries As Integer
Dim hwWarning As Integer
Dim hwAgree As Integer
For Retries = 1 To 10
'wait 1/8 of a second
System.Threading.Thread.Sleep(125)
hwWarning = FindWindowEx(GetDesktopWindow, 0, vbNullString, "Safety Warning")
If hwWarning <> 0 Then
hwAgree = FindWindowEx(hwWarning, 0, "Button", "I &Agree")
If hwAgree <> 0 Then
SendMessage(hwAgree, BM_CLICK, 0, 0)
IsDismissed = True
End If
End If
Next
End Sub
End Class
'---END CODE---


Best Regards,
Paul Larson
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/api-control-mappoint-2006-gps-features-part-i-ii-5183.html

Posted By For Type Date
An API to Control MapPoint 2006 GPS Features - Part I of II - MapPoint Articles - MP2K Magazine This thread Refback 09-13-2006 08:36 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
MapPoint Automation with C/C++ - Part 1 Eric Frost MP2K Magazine Articles 10 09-15-2006 10:01 AM
Access some hidden features in MapPoint2002 ActiveX control baal_2000 MapPoint 2006/2009 Discussion 43 08-29-2006 10:46 AM
Using Python to Control MapPoint, Part 2 Eric Frost MP2K Magazine Articles 0 07-11-2006 07:41 PM
Using Python to control MapPoint, Part 1 Eric Frost MP2K Magazine Articles 0 03-26-2006 10:29 PM
Hi EB Can i use the Map point control features .... Anonymous MapPoint 2006/2009 Discussion 1 05-14-2002 02:03 AM


All times are GMT -5. The time now is 09:01 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5
MP2K Magazine
Visitor Map

Cheap Flights to Benidorm
Book cheap flights to Benidorm with Holiday Hypermarket. Whether Summer or Winter Benidorm is a great destination.

Spain Holidays
Find and book Spain Holidays with Travel Counsellors. Holiday destinations around the world including Spain.

Turkey Holidays
Istanbul is Turkey's prime attraction as it has the most beautiful mosques and palaces of the country; it has Byzantine churches and Roman temples. Book Turkey Holidays online.

Dubai Holidays
Dubai holidays provide you with exotic sights, desert safaris and superb cuisine. There is an extensive range of things to do and see!

Cheap Portugal Holidays
Want to know what the best time to book cheap Portugal holidays is? Well have a look on ulookubook.com for some useful information to save your cash. Golf, tennis and cycling are all very popular here.

Travel
Check out the travel options on Travel.co.uk.

Cheap Goa Holidays
Experience the world famous Wednesday Flea Market at Anjuna! Book cheap Goa holidays at On The Beach!


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47