Hi Greg,
I have experinced a similiar behaviour: The application I am writing
involves a DLL written in Delphi. When I start the MBX, MI looses the
focus as soon as it runs out of command to execute. (Starting the MBX
means creating a new menu and then waiting for user input). Just as in
your case, the last used application gets the focus, and if Delphi is
available, then it's Delphi (I was wondering already if this is a
built-in feature of Delphi?).
Anyway, what I am doing is using two API-calls to get the handle of the
forground window, and then re-setting it after the menus are created.
The Syntax is as follows:
Declare Function GetForegroundWindow Lib "user32" Alias
"GetForegroundWindow" () As Integer
Declare Function SetForegroundWindow Lib "user32" Alias
"SetForegroundWindow" (ByVal hwnd As Integer) As Integer
Dim iMapInfoID As Integer
iMapInfoID = GetForegroundWindow()
If SetForegroundWindow(iMapInfoID) Then
'...MI has the focus
End If
Hope this helps...
Cheers, Andreas
.................................................
Andreas Mahn
dds GmbH
Stumpfstr.1
76131 Karlsruhe
Germany
Tel.: +49 - (0)721 - 9651406
Fax: +49 - (0)721 - 9651419
http://www.dds.ptv.de/
.......................
[EMAIL PROTECTED]
>----------
>Von: Toothaker, Greg[SMTP:[EMAIL PROTECTED]]
>Gesendet: Mittwoch, 27. Januar 1999 19:37
>An: '[EMAIL PROTECTED]'
>Betreff: MI: MB Set Window DOS Stuff
>
>Hello all,
>
>I'm having a problem with a MB app which executes a few .bat files in DOS.
>After the .bat file has executed, my MI window loses focus. I've tried
>using:
>Set Window WIN_MAPINFO Front
>Set Window MAPINFO Front
>Set Window 1011 Front
>All make the MI window blue on the win start bar, but my last used
>application comes to the front(ie if I executed the MB app from MB, the MB
>window comes to the front). I thought the problem had to do with MB
>continuing as the .bat executed, but I found a way to loop MB until the .bat
>finishes. Any thoughts would be appreciated.
>
>Thanks
>
>
>Greg Toothaker
>GIS Specialist
>Resource Data International
>Boulder, Colorado
>(303) 928-6529
>
>----------------------------------------------------------------------
>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
>
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]