PDA

View Full Version : Extending the MapPoint ActiveX Control - Pt. II



Anonymous
05-13-2003, 09:03 PM
Sergiy Pavlov continues to show how to add functionality to the MapPoint ActiveX control

Read the full article at: Extending the MapPoint ActiveX Control - Pt. II - MapPoint Articles - MP2K Magazine (http://www.mp2kmag.com/a96--ActiveX.Extending.Spy.mappoint.html)

baal_2000
05-16-2003, 11:00 AM
Please visit the subject's discussion at:
http://www.mp2kmag.com/mappoint/discussion/viewtopic.asp?t=3790

Sergiy Pavlov

Eric Frost
06-09-2007, 05:55 PM
I was taking a look at the code for this and wondering if there is a way to trigger or simulate clicking the Freeform button on the drawing toolbar?






'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''
' (R) 2003 Sergiy Pavlov -- Do not remove this header
' baal_2000 AT yahoo DOT com
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''
' This source code is provided "as is" and can only be used in accordance
' with the terms and conditions of the Microsoft MapPoint 2002 and Microsoft
' Visual Basic End User License Agreements.
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''
Option Explicit
Private objMap As clsMapPoint
Private Sub mnuAddAsEnd_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdAddAsE nd)
End Sub
Private Sub mnuAddAsStart_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdAddAsS tart)
End Sub
Private Sub mnuAddAsStop_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdAddAsS top)
End Sub
Private Sub mnuAlwaysShowPosition_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdGPSAlw aysShowPosition)
End Sub
Private Sub mnuAvoidArea_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdAvoidA rea)
End Sub
Private Sub mnuClearRoute_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdClearR oute)
End Sub
Private Sub mnuConstructionInfoUpdate_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdRoadCo nstructionNfoUpd)
End Sub
Private Sub mnuCopy_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdCopy)
End Sub
Private Sub mnuCopyDirections_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdCopyDir ections)
End Sub
Private Sub mnuCopyMap_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdCopyMap )
End Sub
Private Sub mnuCopyShortcut_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdCopySho rtcut)
End Sub
Private Sub mnuDataMappingWizard_Click()
Call objMap.SendCommand(MapPointMenu.mnuData.cmdDataMap pingWizard)
End Sub
Private Sub mnuDirections_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdDirect ions)
End Sub
Private Sub mnuDrawing_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdTBDrawi ng)
End Sub
Private Sub mnuExit_Click()
Unload Me
End Sub
Private Sub mnuExportToExcel_Click()
Call objMap.SendCommand(MapPointMenu.mnuData.cmdExportT oExcel)
End Sub
Private Sub mnuFind_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdFind)
End Sub
Private Sub mnuFindNearbyPlaces_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdFindNe arbyPlaces)
End Sub
Private Sub mnuFontLarge_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdFont_La rge)
End Sub
Private Sub mnuFontLargest_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdFont_La rgest)
End Sub
Private Sub mnuFontMedium_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdFont_Me dium)
End Sub
Private Sub mnuFontSmall_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdFont_Sm all)
End Sub
Private Sub mnuFontSmallest_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdFont_Sm allest)
End Sub
Private Sub mnuGetDirections_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdGetDir ections)
End Sub
Private Sub mnuGPSReceiverSettings_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdGPSRec eiverSettings)
End Sub
Private Sub mnuGPSSensor_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdGPSSen sor)
End Sub
Private Sub mnuGPSTrackPosition_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdGPSTra ckPosition)
End Sub
Private Sub mnuImportDataWizard_Click()
Call objMap.SendCommand(MapPointMenu.mnuData.cmdImportD ataWizard)
End Sub
Private Sub mnuLegendAndOverview_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdLegendA ndOverview)
End Sub
Private Sub mnuLinkDataWizard_Click()
Call objMap.SendCommand(MapPointMenu.mnuData.cmdLinkDat aWizard)
End Sub
Private Sub mnuLocationAndScale_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdTBLocat ionAndScale)
End Sub
Private Sub mnuLocationSensor_Click()
objMap.LocationSensorVisible = Not objMap.LocationSensorVisible
End Sub
Private Sub mnuMapPointHelp_Click()
Call objMap.SendCommand(MapPointMenu.mnuHelp.cmdMapPoin tHelp)
End Sub
Private Sub mnuMapPolitical_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdMapStyl e_Political)
End Sub
Private Sub mnuMapStyleRoads_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdMapStyl e_Roads)
End Sub
Private Sub mnuMapStyleRoadsAndData_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdMapStyl e_RoadsAndData)
End Sub
Private Sub mnuMapStyleTerrain_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdMapStyl e_Terrain)
End Sub
Private Sub mnuMeasureDist_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdMeasur eDistance)
End Sub
Private Sub mnuNavigateBack_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdBack)
End Sub
Private Sub mnuNavigateForward_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdForward )
End Sub
Private Sub mnuNavigation_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdTBNavig ation)
End Sub
Private Sub mnuOptimizeStops_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdOptimi zeStops)
End Sub
Private Sub mnuOptions_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdOption s)
End Sub
Private Sub mnuPageSetup_Click()
Call objMap.SendCommand(MapPointMenu.mnuFile.cmdPageSet up)
End Sub
Private Sub mnuPaste_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdPaste)
End Sub
Private Sub mnuPrint_Click()
Call objMap.SendCommand(MapPointMenu.mnuFile.cmdPrint)
End Sub
Private Sub mnuRedo_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdRedo)
End Sub
Private Sub mnuRouteOptions_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdRouteO ptions)
End Sub
Private Sub mnuExport_Click()
Call objMap.SendCommand(MapPointMenu.mnuFile.cmdExportT oPocketStreets)
End Sub
Private Sub mnuRoutePlanner_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdRouteP lanner)
End Sub
Private Sub mnuSaveAs_Click()
Call objMap.SendCommand(MapPointMenu.mnuFile.cmdSaveAs)
End Sub
Private Sub mnuSaveAsWebPage_Click()
Call objMap.SendCommand(MapPointMenu.mnuFile.cmdSaveAsW ebPage)
End Sub
Private Sub mnuManageSavedWebPages_Click()
Call objMap.SendCommand(MapPointMenu.mnuFile.cmdManageS avedWebPages)
End Sub
Private Sub mnuScheduleStop_Click()
Call objMap.SendCommand(MapPointMenu.mnuRoute.cmdSchedu leStop)
End Sub
Private Sub mnuSendMapFeedback_Click()
Call objMap.SendCommand(MapPointMenu.mnuTools.cmdSendMa pFeedback)
End Sub
Private Sub mnuShowOrHidePlaces_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdShowOrH idePlaces)
End Sub
Private Sub mnuStandard_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdTBStand ard)
End Sub
Private Sub mnuTerritories_Click()
Call objMap.SendCommand(MapPointMenu.mnuData.cmdTerrito ries)
End Sub
Private Sub mnuTestSaveAsWebPage_Click()
Dim TWnd As New TWindow

TWnd.hWnd = objMap.hWnd_EXE 'got the target!

'toggle SaveAsWebPage dialog!
Call TWnd.PostMessageLong(WM_COMMAND, 35032)
End Sub
Private Sub mnuUndo_Click()
Call objMap.SendCommand(MapPointMenu.mnuEdit.cmdUndo)
End Sub
Private Sub mnuZoomIn_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdZoom_In )
End Sub
Private Sub mnuZoomOut_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdZoom_Ou t)
End Sub
Private Sub mnuZoomTo48States_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdZoom_To 48States)
End Sub
Private Sub mnuZoomToData_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdZoom_To Data)
End Sub
Private Sub mnuZoomToEntireRoute_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdZoom_To EntireRoute)
End Sub
Private Sub mnuZoomToNorthAmerica_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdZoom_To NorthAm)
End Sub
Private Sub mnuZoomToSelection_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdZoom_To Selection)
End Sub
Private Sub RoadsAndDatamnuMapStyleData_Click()
Call objMap.SendCommand(MapPointMenu.mnuView.cmdMapStyl e_Data)
End Sub
Private Sub CheckLocationSensorTimer1_Timer()
'Check for LocationSensor here
On Error Resume Next
Dim bIsChecked As BorderStyleConstants
bIsChecked = objMap.LocationSensorVisible
If mnuLocationSensor.Checked <> bIsChecked Then
mnuLocationSensor.Checked = bIsChecked
End If
End Sub
Private Sub Form_Load()
Set objMap = New clsMapPoint
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Set objMap = Nothing
End Sub

Eric Frost
06-09-2007, 06:11 PM
It looks like Paul Larson just answered this in April !

http://www.mapforums.com/select-contents-shape-5830.html#post16062

Thanks Paul.

Eric