Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Programmatically calling Toolbar buttons

This is a discussion on Programmatically calling Toolbar buttons within the MapPoint Desktop Discussion forums, part of the Map Forums category; i found out the other day that using "ATL:10024320" and "ATL:100240A0" might not work for all computers. Code: hwnd = ...

  1. #11
    Kevin_Williams is offline Junior Member Yellow Belt
    Join Date
    Nov 2006
    Posts
    20

    Re: Programmatically calling Toolbar buttons

    i found out the other day that using "ATL:10024320" and "ATL:100240A0" might not work for all computers.
    Code:
    hwnd = FindWindowEx(hwnd, IntPtr.Zero, "ATL:10024320", IntPtr.Zero);
    hwnd = FindWindowEx(hwnd, IntPtr.Zero, "ATL:100240A0", IntPtr.Zero);
    i had my application installed on another computer and it didn't work because "ATL:10024320" was another set of number "ATL:########"

    the article implemented a FindChildWindow() function to do a partial match on the string "ATL:".
    http://www.mp2kmag.com/downloads/mpvbtest1.zip

    i was too lazy to implement a string comparison, so i used GetWindow() to just grab the child:
    Code:
    [DllImport("user32.dll")]
    private static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd);
    private const uint GW_CHILD = 5;
    
    hwnd = GetWindow(hwnd, GW_CHILD);  // get the first "ATL:########"
    hwnd = GetWindow(hwnd, GW_CHILD);  // get the second "ATL:########"
    mapPointHwnd = FindWindowEx(hwnd, IntPtr.Zero, "AfxFrameOrView70", IntPtr.Zero);

  2. #12
    DrNobody is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    10

    Re: Programmatically calling Toolbar buttons

    Quote Originally Posted by Kevin_Williams View Post
    Thanks WilFried
    ...but I'm not sure how to FindChildWindow in C#...
    Hi.

    May be this WIN32 API function will be helpfull:

    BOOL EnumChildWindows(
    HWND hWndParent,
    WNDENUMPROC lpEnumFunc,
    LPARAM lParam)

  3. #13
    Gianmaria is offline Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    47

    Re: Programmatically calling Toolbar buttons

    Hi Kevin,
    i'm reading your cod to access the hidden features of MapPoint. Did you find a way to "press" the DrawCircle n the Drawing toolBar?
    Can you show me some code in c# to do it?

    Regards,
    Gianmaria

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating a new toolbar
    By alt-088 in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-14-2004, 07:38 AM
  2. Drawing an Oval Using The Toolbar - QueryCircle?
    By Steve Wenck in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-16-2004, 01:49 PM
  3. Cancel Mouse Buttons in Mappoint using VB.NET
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-27-2004, 06:20 AM
  4. 911 outbound calling
    By LLurie in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-21-2003, 10:41 AM
  5. VBA calling MP2k2
    By rkehn in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-15-2003, 12:47 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66