| 
| 
| 
| #208763 - 2014-03-26 02:29 PM  Kix32 console behavior with RUN |  
| Howard Bullock   KiX Supporter
 
       
   Registered:  2000-09-15
 Posts: 5809
 Loc:  Harrisburg, PA USA
 | 
Can someone help me understand this behavior of Kix32 console (KiX2010.463)?
 If you invoke KiXtart script using Kix32 from a CMD file and output text, a console window appears as expected.
 
 If you then use RUN to invoke another KiXtart instance running a separate script that calls a MessageBox that is Application-modal the console window never closes until after you acknowledge the messagebox.
 
 If you have text output after the messagebox it is displayed in the console after the message is displayed. Using RUN I would expect the second text to be output since RUN lets the original script continue running. However, why does the original script not exist and close the original console?
 
 Invoke the CMD from the Windows RUN command not an existing CMD window.
 
 Invoking CMD file:
 
 
 First script test1.kix:
 
 @Scriptname ?
;RUN "kix32.exe test2.kix"
RUN "%COMSPEC% /e:1024 /c kix32.exe test2.kix"
@kix ?
 Second script (test2.kix):
 
 $x=MESSAGEBOX("Test Text","Test Message",64)
 Edited by Howard Bullock (2014-03-26 02:30 PM)
 |  
| Top |  |  |  |  
| 
| 
| #208764 - 2014-03-26 04:12 PM  Re: Kix32 console behavior with RUN
[Re:  Howard Bullock] |  
| Allen   KiX Supporter
 
       
 Registered:  2003-04-19
 Posts: 4562
 Loc:  USA
 | 
It seems kix doesn't like to run or shell another instance of kix.  I ran into a different problem a few years ago where WrapATEOL was reset just by simply running the kix32.exe again.  http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=203626#Post203626  Ruud said he would look at it, but honestly, I never checked to see if any of the current releases fixed it.
 |  
| Top |  |  |  |  
| 
| 
| #208771 - 2014-03-27 01:24 PM  Re: Kix32 console behavior with RUN
[Re:  BradV] |  
| ChristopheM   Hey THIS is FUN
 
       
 Registered:  2002-05-13
 Posts: 311
 Loc:  STRASBOURG, France
 | 
I think the problem is not a problem of process and parent process but a problem of console window. look at the code below for test1.kix :and for test2.kix@Scriptname ?
RUN "wkix32.exe "+@scriptdir+"\test2.kix"
@kix ?
"== sleep 5 seconds ==" ?
sleep 5
"== finished and exit =="$x=MESSAGEBOX("message 1","Test Message",64)
"hello world" ?
$x=MESSAGEBOX("message 2","Test Message",64)
if you run this code and validate the message box, a second console appears. Don't validate the second messagebox and wait 5 seconds, all runs fine. The first windows disappears.
 Now, in test1.kix, replace
 RUN "wkix32.exe "+@scriptdir+"\test2.kix"
 by
 RUN "cmd /c wkix32.exe "+@scriptdir+"\test2.kix"
 this is not working any more. why ?
 there is a process that is still handling the console window. All "graphical" elements are managed with handle (like for file) and a window is deleted only when the LAST process handling it stops !!!
 
 
 an other example for understanding graphical handle is below (test3.kix)
 start a console with cmd.exe. from this console, run "kix32 test3.kix".$=SetConsole( "HIDE" )
exitin this case, the window disappears but if you look at task manager, you still see a cmd process running and you can't get it visible. In fact, the window still exists but kix32 as hidden it and when the process ends, cmd.exe continues to run in the hidden window.
 
 there is not the problem with wkix32 because it is a win32 "graphical" process and it creates a own console the first time it needs it.
 with win32 console processes (cmd.exe, kix32.exe), the first one creates a console and child processes share the same console. Then, this is not the "owner" that deletes the console but this is the last process using it. This mechanism is similar to garbage collector in java or .NET framework, an object is deleted only when there is not reference anymore to it.
 
 To conclude, i think this is not a problem with kix32. I think this is by design in Windows.
 
_________________________Christophe
 |  
| Top |  |  |  |  
 Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
 
 | 
| 
 
| 0 registered
and 739 anonymous users online. 
 | 
 |  |