When the command "Set Window MapInfo Front" is not working, try the Win-API
call:
rc = SetForegroundWindow(WindowInfo(WIN_MAPINFO, WIN_INFO_WND))
Where rc i an integer an the declaration of the api goes:
Declare Function SetForegroundWindow Lib "user32" Alias
"SetForegroundWindow" (ByVal hwnd as integer) as integer
This always brings me back with MI in front, after a MB dialogbox is
pressed ok, or if I return from a DDE talk within Access. It works both for
modal and non modal forms.
Modal form: like MapBasic dialogs. The form (dialog) locks all other
activity in the active application, until released
Non modal form: like external applications or modeless form dll's. The user
can switch away from the form like Vertical Mappers Layer Manager.
Jakob Lanstorp, Computing Geologist
Kampsax GIS Software & Solutions, Rugaardsvej 55, 5000 Odense, DK
tel: + 45 63 13 50 13, dir: + 45 63 13 50 11, fax: + 45 63 13 50 90
mailto:[EMAIL PROTECTED] , http://www.kampsax-gis.dk, http://www.kampsax.dk
Authorized MapInfo Partner & Distributor in Denmark and Norway
***Visit http://www.kortal.dk and see Denmark from above
----- Videresendt af Jakob Lanstorp/Kampsax - 28-01-02 11:08 -----
[EMAIL PROTECTED] (David
Baker) Til:
[EMAIL PROTECTED]
Sendt af: cc:
[EMAIL PROTECTED] Vedr.: Re: MI-L Loss of
focus on MapInfo Pro.
onsmag.com
26-01-02 15:00
Besvar venligst til David
On 24 Jan 2002 at 16:11, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>
> I am currently implementing a system which involves MapInfo spawning to
> another application. This application appears modal to MapInfo Pro. and
> when the user closes this application, the operating system needs to
return
> focus to Pro.
>
> However this is not happening at present. I have attempted to use
>
> "Set Window MapInfo Front"
>
> but this did not work. Has anyone any further ideas?
I'm not sure what you are doing differently to me, but I am running a EXE
files from MapInfo with the command:
Run Program ProgToRun
and on certain conditions I bring MapInfo back to the front (& focus) with
the command:
Set Window MapInfo Front
This has worked fine for 3 years with Windows 95, 98 & Win 2000. The only
thing I am not sure about is "This application appears modal to MapInfo"...
That might be different to me - I've forgotten what modal & non-modal are,
or more correctly which is which.
Dave
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.