forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CISSUE@ / hide DOS windows

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Fri Jan 22, 2016 12:19 am    Post subject: CISSUE@ / hide DOS windows Reply with quote

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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Jan 22, 2016 9:15 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Jan 22, 2016 8:47 pm    Post subject: Reply with quote

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 ...
Back to top
View user's profile Send private message
dgurok



Joined: 26 May 2011
Posts: 66

PostPosted: Tue Feb 16, 2016 10:53 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Wed May 04, 2016 9:56 am    Post subject: Reply with quote

Here is a different solution using a script:

Code:
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
Back to top
View user's profile Send private message
dgurok



Joined: 26 May 2011
Posts: 66

PostPosted: Wed May 18, 2016 8:33 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed May 18, 2016 8:57 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
dgurok



Joined: 26 May 2011
Posts: 66

PostPosted: Wed May 18, 2016 9:35 am    Post subject: Reply with quote

This code illustrates my problem simplified:

Code:
      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.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed May 18, 2016 10:28 am    Post subject: Reply with quote

It doesn't happen for me on Windows 8.1.
Which operating system are you using?
Back to top
View user's profile Send private message AIM Address
dgurok



Joined: 26 May 2011
Posts: 66

PostPosted: Wed May 18, 2016 10:51 am    Post subject: Reply with quote

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

Window positioning ok:



Window positioning shifted when external program is executed:



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.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed May 18, 2016 11:32 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group