Hello,

you need the WinAPI to do that

Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As
String, ByVal nCmdShow As Integer) As Integer

'to your constants add:
Define sw_shownormal 1 'opens and shows in designed size/position
Define sw_showminimized 2 'opens in minimized state with start bar icon
Define sw_showmaximized 3 'opens in maximized state with start bar icon
'''' there are others but these are most used and M$ recommended


build you command string then:

WinExec(command,sw_showminimized)


here a app I wrote for execute and wait



'executes a program specified by lpCmdLine with the *show mode* in nCmdShow
Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As
String, ByVal nCmdShow As Integer) As Integer

'returns 0 is window does not exists otherwise a non-zero value
Declare Function IsWindow Lib "user32" Alias "IsWindow" (ByVal hwnd As
Integer) As Integer
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer
Declare Function GlobalAddAtom Lib "kernel32" Alias "GlobalAddAtomA" (ByVal
lpString As String) As Integer
Declare Function GlobalDeleteAtom Lib "kernel32" Alias "GlobalDeleteAtom"
(ByVal nAtom As Integer) As Integer

'to your constants add:
Define sw_shownormal 1 'opens and shows in designed size/position
Define sw_showminimized 2 'opens in minimized state with start bar icon
Define sw_showmaximized 3 'opens in maximized state with start bar icon
'''' there are others but these are most used and M$ recommended

'add this to your variable dim's
DIM aProg as String
DIM WinHndl as integer
DIM iAtom as integer

aProg="notepad.exe"
'>>> start the application
WinHndl = WinExec(aProg, sw_shownormal)
if WInHndl>32 then
iAtom=GlobalAddAtom(aProg)
'>>> wait for application to terminate do not use for MB to continue
WinHndl=FindWIndow(iAtom,"")
print chr$(12)+str$(iAtom)+" = "+WinHndl
while WinHndl<>0
  WinHndl=FindWIndow(iAtom,"")
wend
iAtom=GlobalDeleteAtom(iAtom)
note str$(WinHndl)+" Finished"
'>>> end of wait for termination
end if


Trey Pattillo
[EMAIL PROTECTED]
http://www.wap3.com

------------------------------------------------

To ME or not to ME, that is the question.
For some it will be to Whistle
and indure the thorns and thistle.
For me it is not to ME, but to NT,
The OS for ME !

  ----- Original Message -----
  From: Scott McVicar
  To: '[EMAIL PROTECTED]'
  Sent: Monday, April 30, 2001 17:23
  Subject: MI-L MI: Dos Command


  This message is in MIME format. Since your mail reader does not understand
  this format, some or all of this message may not be legible.



  Hello,

  When using the MapBasic command 'Run Program' to issue DOS commands does
  anyone know of a way to keep the DOS window from appearing?
  Will Sum.

  Thanks,
  Scott




  _______________________________________________________________________
  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.

Reply via email to