1. RE: Minimize CMD.EXE
- Posted by Mike W <MWisolmerski at mayors.com> Jan 21, 2004
- 475 views
Thank you Juergen, but I am running an MS-DOS program to perform a connection to our iSeries box to map network drives. You are correct that the command window does not pop up when executing a Windows application. Ideally I would like to run this command minimized. Thanks - Mike W. Juergen Luethje wrote: > > > Mike W wrote: > > > Does anyone know if there is a way to use system_exec and not have the > > command window pop up? I need the return code from the called program, > > so I don't think I can use any shell code like WIN32Lib's > > shellExecuteEx. > > Since you mention Win32Lib, I assume you are writing a _Windows_ > program, > right? > Hm... when I call system_exec() in a Windows program (see example below) > using 'exw.exe', the command window does _not_ pop up. I use Win 98/1st > ed. and Euphoria 2.4. > > -----------------------[ begin 'test.exw' ]----------------------- > integer x > x = system_exec("calc.exe", 2) -- calls the Windows calculator > ------------------------[ end 'test.exw' ]------------------------ > > But when I use 'exwc.exe' (a console version of 'exw.exe') instead to > run my program, then the command window pops up. > > Regards, > Juergen > > -- > /"\ ASCII ribbon campain | The difference between men and boys > \ / against HTML in | is the price of their toys. > X e-mail and news, | > / \ and unneeded MIME | http://home.arcor.de/luethje/prog/ >
2. RE: Minimize CMD.EXE
- Posted by Mike W <MWisolmerski at mayors.com> Jan 23, 2004
- 461 views
Thank you Juergen, but I could not get the PIF to work on XP pro(yes, bleeding edge). But, I was able to get the command window to launch first behind the primary one and that will do. Thanks - Mike W. Juergen Luethje wrote: > > > Mike W wrote: > > > Thank you Juergen, but I am running an MS-DOS program > > Ah, I see. Then you can't use Win32Lib at all. > > > to perform a > > connection to our iSeries box to map network drives. You are correct > > that the command window does not pop up when executing a Windows > > application. Ideally I would like to run this command minimized. > > > > Thanks - > > Mike W. > > I've got a solution, that works at least on Windows 98/1st ed. Assume > you have a bound or translated/compiled DOS program, say "test.exe". > When you first run this program, Windows normally automagically creates > a file "test.pif" in the same folder. > > (In the following description, I try to translate the German names to > English, because I don't know the exact English names of all that dialog > window elements.) > Right-click at "test.pif", and choose "Properties" from the context > menu. > Choose the "Program" tab, and select "Execute: minimized" from the > appropriate drop down list. Make a tick at the checkbox "close on exit". > That's it. > > When "test.pif" is in the same folder as "test.exe" (that's the case > when Windows had created "test.pif" automagically), it doesn't matter > whether you call "test.pif" or "test.exe", in order to run your program. > > When your program is neither bound nor translated/compiled, and you call > it like: ex.exe test.ex, > you have to choose the desired settings in the file "ex.pif". But this > of course affects all other programs that are executed by "ex.exe", too. > > > Juergen Luethje wrote: > >> > >> > >> Mike W wrote: > >> > >>> Does anyone know if there is a way to use system_exec and not have the > >>> command window pop up? I need the return code from the called program, > >>> so I don't think I can use any shell code like WIN32Lib's > >>> shellExecuteEx. > > <snipped old text> > > HTH, > Juergen > > -- > /"\ ASCII ribbon campain | |\ _,,,---,,_ > \ / against HTML in | /,`.-'`' -. ;-;;,_ > X e-mail and news, | |,4- ) )-,_..;\ ( `'-' > / \ and unneeded MIME | '---''(_/--' `-'\_) >
3. RE: Minimize CMD.EXE
- Posted by Mike W <MWisolmerski at mayors.com> Jan 23, 2004
- 476 views
Thank you Al, but I could not get the the SetConsoleTitle to work. I am using XP pro and it need to research this further. For now, though, I was able to get the command window to launch first behind the primary one and that will do. I did this after trying your suggestion and realizing that I could use ?"" to launch the command window first. I had not used (or knew about) ?"" before your reply. Thanks - Mike W. Al Getz wrote: > > > Mike W wrote: > > > > > > Hi - > > > > Does anyone know if there is a way to use system_exec and not have the > > command window pop up? I need the return code from the called program, > > so I don't think I can use any shell code like WIN32Lib's > > shellExecuteEx. > > > > Thanks - > > Mike W. > > > > Hi Mike, > > I had a program in exe form that absolutely HAD to be run with > an attached console, so the best i could do was minimize the > darn thingHere's what i ended up doing: > > ?"" --force open console window > --other code > retv=c_func(xSetConsoleTitle,{lpConsoleTitle}) > hConsole=c_func(xFindWindow,{0,lpConsoleTitle}) > if hConsole!=0 then > --minimize this console window > retv=c_func(xShowWindow,{hConsole,6}) > end if > > First the console window is forced open with ?"" or > printf(1,"%s","\n") or similar, then (in an onOpen event) > the console window title is changed to some unusual > name, then the handle is found with FindWindow(), then > ShowWindow (passing the console window handle) minimizes it. > > If the window title doesnt have to be changed you could > try GetConsoleTitle instead of SetConsoleTitle. > > Note that you may have to call Set or GetConsoleTitle > in an onOpen event. It may not work immediately after > the print statement that opens the console for the first time. > > Take care, > Al