View Full Version : Determine if Map has been closed

12-07-2005, 10:17 AM
Hi, I was wondering if there is an easy way of determining if a map has been closed by the user. A quick overview of whats happening is from our software we call an ocx that we've created that opens a Mappoint map and displays the customer location. By default we leave this map up and the user can look at other customers and map them on the same map. The problem is if the user closes the original map and tries to map another customer we need to open a new map.

Is there something that I can check to determine if the map is still running and if not create a new map.


12-07-2005, 01:33 PM

I'm not sure I full understeand you. But as far as I do you run an external instance of mappoint that you use, and you want to know if this instance has closed by the user, right ?

Very simple. Start the instance with the win32 API call CreateProcess. Then you can use GetExitCodeProcess API call to check if the instance is still alive. If not then you can start an instance again using the same API call.