Silverfrost Forums

Welcome to our forums

CISSUE@ / hide DOS windows

21 Jan 2016 11:19 #17151

In some cases I have to call old DOS programs with the cissue@() method. Even if there is no input and no output from the DOS program, an ugly (black) DOS window opens and stays on the screen until the program terminates. I made a lot of efforts to suppress this window, but in vain. No I found a very simple workaround which may be of interest for some of you:

Just use %ww[topmost] in the first window of your main program. Now, all DOS windows are at least displayed 'behind' the main window, and if the latter one is in full-screen mode, the DOS windows are completely invisible.

Regards - Wilfried

22 Jan 2016 8:15 #17152

A call to WinExec sometimes does the trick and this has an argument that hides the window. I don't remember if this works for console programs.

22 Jan 2016 7:47 #17156

Wilfried,

Isn't cmd.exe just another Windows program? Surely that means you can find out what it is called and send it a message to go off and hide itself?

I'm assuming that they are not DOS programs that you could recompile yourself ...

16 Feb 2016 9:53 #17204

In this case I'm using ShellExecuteEx + WaitForSingleObject. You can use parameter SW_HIDE to hide the application. It also works for Batch and Console application.

4 May 2016 8:56 #17465

Here is a different solution using a script:

subroutine create_vbs()

include <windows.ins>
integer*4      j,start_process@

open(10,file='run_dosapp.vbs',status='unknown')
write(10,'(A)')'Set WshShell = WScript.CreateObject('WScript.Shell')'
write(10,'(A)')'WshShell.Run 'c:\old_stuff\my_dos_app.exe',0,True'
close(10)
j = start_process@('wscript','run_dosapp.vbs')
end

The Parameter 'True' is used to hide the DOS box when 'my_dos_app.exe' is running.

Wilfried

18 May 2016 7:33 #17492

Paul,

I have observed something strange with respect starting an external program in main application. During the execution (after some seconds) of the external program the window position of main application shifts by few pixel. When I close the executed external program the window position of the main application shits back to the original position. With the debugger I can't reproduce this behavior. Is it possible to turn off this behavior somehow?

18 May 2016 7:57 #17493

I doubt that this can be fixed. It is probably something to do with Windows.

If you could post some code that demonstrates this behaviour then I would have a better idea of what is possible.

18 May 2016 8:35 #17494

This code illustrates my problem simplified:

      program test
C      
      INTEGER*4
     * I,f_func
C     
      external f_func
     
      I=WINIO@('%ca[test]&')
      I=WINIO@('%sp&', 1, 1)
      I=WINIO@('%sz&', 1920, 1080)  !+ fullscreen 
      I=WINIO@('%^bt[start_process and wait]', f_func)
      end
C      
C      
      function f_func()
C
      integer*4
     * f_func,
     * i, 
     * start_process@ 
C
      i = start_process@('calc.exe',' ') 
      f_func=1     
C      
      end

Please start the external process and after some seconds the position of main window will shift. When you close calc.exe the position of main window will shift back.

18 May 2016 9:28 #17496

It doesn't happen for me on Windows 8.1. Which operating system are you using?

18 May 2016 9:51 #17499

I'm using Windows 7 (64-bit), FTN95 7.10.0

Window positioning ok:

http://www2.pic-upload.de/img/30689012/ok.jpg

Window positioning shifted when external program is executed:

http://www2.pic-upload.de/img/30689013/false.jpg

I observed it has something to do with the used design/visual effects in windows. With the windows basic or classic design there is no shifting in windows 7. When I use Aero the problem occurs.

18 May 2016 10:32 #17503

OK. So it looks like it is something that we would not be able fix within ClearWin+. I doubt very much that you will be able to fix this.

Please login to reply.