Community of VE/MapPoint Users and Developers
This is a discussion on Programmatically calling Toolbar buttons within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I was wondering if there was a way to programmatically the toolbar buttons. I want to make my own ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Programmatically calling Toolbar buttons I was wondering if there was a way to programmatically the toolbar buttons. I want to make my own custom toolbar instead of using mappoint's navigation and drawing toolbars. TIA |
| |||
| Re: Programmatically calling Toolbar buttons
Hi, You can send messages for it. There is an article somewhere on this site. Try a search on 'accessing hidden features' or something similar.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Programmatically calling Toolbar buttons
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Programmatically calling Toolbar buttons
Hi, This article points the things out: Extending the MapPoint ActiveX Control - Pt. I - MapPoint Articles - MP2K Magazine I dont know about the Url. Can you maybe try to contact the author?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Programmatically calling Toolbar buttons
Thanks WilFried I read Extending the MapPoint ActiveX Control - Pt. I and Extending the MapPoint ActiveX Control - Pt. II and I think I understand how it works. I'm trying to implement this in C#. I saw your code in the "Access some hidden features" thread and it was pretty helpful. I think I have all the pieces, but I'm not sure how to FindChildWindow in C#... |
| |||
| Re: Programmatically calling Toolbar buttons
Hi, I think it is just a class method to return the windows handle. I think you can use FindWindow. It take the classname and windowcaption, both are optional, it returns the handle. In C# like this: Code: [DllImport("User32.dll")]
public static extern IntPtr FindWindow(string ClassName, string WindowName);
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Programmatically calling Toolbar buttons
thanks so much for all your help Wilfried i got most of the stuff i wanted to work i pretty much used the Extending the MapPoint ActiveX control guide to understand the concept. from there, i did my code in C# these are the class method i used Quote:
Quote:
Quote:
|
| |||
| Re: Programmatically calling Toolbar buttons
Hi, thx for feedback it sure will benefit other user.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Programmatically calling Toolbar buttons
A small change to Kevin's code made it work for me. If the map control is contained on any other component than the form (or window) itself it did not work for me: Code: hwnd = FindWindow(null, Resources.APP_TITLE); This line of code finds the handle to the form your control is contained on and can be replaced by: Code: hwnd = myForm.Handle; SO: if your control is on anything other than the form you can use: Code: hwnd = myPanel.Handle; or Code: hwnd = myToolStripContainer1.ContentPanel.Handle; //in my case Then the rest is as Kev had it before: Code: hwnd = FindWindowEx(hwnd, IntPtr.Zero, "ATL:10024320", IntPtr.Zero); hwnd = FindWindowEx(hwnd, IntPtr.Zero, "ATL:100240A0", IntPtr.Zero); mapPointHwnd = FindWindowEx(hwnd, IntPtr.Zero, "AfxFrameOrView70", IntPtr.Zero); Thanks for all the posts and code to solve this. It makes life easier... |
![]() |
| Tags |
| buttons, calling, programmatically, toolbar |
| ||||
| Posted By | For | Type | Date | |
| gmane.comp.gis.mappoint | This thread | Refback | 03-11-2008 03:43 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 12-01-2006 04:44 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating a new toolbar | alt-088 | MapPoint 2006/2009 Discussion | 4 | 11-14-2004 07:38 AM |
| Drawing an Oval Using The Toolbar - QueryCircle? | Steve Wenck | MapPoint 2006/2009 Discussion | 1 | 08-16-2004 01:49 PM |
| Cancel Mouse Buttons in Mappoint using VB.NET | Anonymous | MapPoint 2006/2009 Discussion | 0 | 02-27-2004 06:20 AM |
| 911 outbound calling | LLurie | MapPoint 2006/2009 Discussion | 4 | 04-21-2003 10:41 AM |
| VBA calling MP2k2 | rkehn | MapPoint 2006/2009 Discussion | 2 | 01-15-2003 12:47 PM |