2

I am working on an Add-in for MapPoint in C#. Interestingly, the Add-in is also loaded when another program uses the MapPoint control within itself. What I would like to do is get the name of the window that is using the MapPoint control.

In the Add-in, you can refer to this instance of the application like this:

Private MapPoint.Application thisApp = application as MapPoint.Application;

But if I look at the parent, or even the parent of the parent, I hit a ceiling at the MapPoint application. Is there a way to get the parent window name from within an add-in called by a window control in C#?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
profmuggs
  • 21
  • 2
  • In theory, you can use PInvoke against the native windows APIs to find the handle of a parent window all the way out to the shell. Once you have the window handle, you could use the same APIs to read various properties of said window including it's name. This applies to "classic winforms" style applications, WPF plays by a different set of rules. – Joe Caffeine Sep 26 '13 at 04:25

0 Answers0