<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Console painting over Quickwin window in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Console-painting-over-Quickwin-window/m-p/934145#M15468</link>
    <description>For convenience and safety I launch an old  Fortran ?legacy? console program from my Quickwin application using the techniques previously discussed  in  this forum and in the samples (using createprocess etc).  It all works very well except that if the user moves the console window about the desktop the Quickwin windows are painted over by the console window so that there appear to be numerous copies of the console window pasted all over the Quickwin windows.  Once the console app terminates the Quickwin application releases the console handle for the process, the console  window copies all disappear.    However I can?t close the process handle prematurely (i.e as soon as the process is launched) as it needs to passed to ?waitforsingleobject? and ?getexitcodeprocess? routines.  Any ideas of how to get around this? &lt;BR /&gt; &lt;BR /&gt;Thanks for any assistance &lt;BR /&gt; &lt;BR /&gt;Ed</description>
    <pubDate>Tue, 09 Jan 2001 13:15:07 GMT</pubDate>
    <dc:creator>mroczek</dc:creator>
    <dc:date>2001-01-09T13:15:07Z</dc:date>
    <item>
      <title>Console painting over Quickwin window</title>
      <link>https://community.intel.com/t5/Software-Archive/Console-painting-over-Quickwin-window/m-p/934145#M15468</link>
      <description>For convenience and safety I launch an old  Fortran ?legacy? console program from my Quickwin application using the techniques previously discussed  in  this forum and in the samples (using createprocess etc).  It all works very well except that if the user moves the console window about the desktop the Quickwin windows are painted over by the console window so that there appear to be numerous copies of the console window pasted all over the Quickwin windows.  Once the console app terminates the Quickwin application releases the console handle for the process, the console  window copies all disappear.    However I can?t close the process handle prematurely (i.e as soon as the process is launched) as it needs to passed to ?waitforsingleobject? and ?getexitcodeprocess? routines.  Any ideas of how to get around this? &lt;BR /&gt; &lt;BR /&gt;Thanks for any assistance &lt;BR /&gt; &lt;BR /&gt;Ed</description>
      <pubDate>Tue, 09 Jan 2001 13:15:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Console-painting-over-Quickwin-window/m-p/934145#M15468</guid>
      <dc:creator>mroczek</dc:creator>
      <dc:date>2001-01-09T13:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Console painting over Quickwin window</title>
      <link>https://community.intel.com/t5/Software-Archive/Console-painting-over-Quickwin-window/m-p/934146#M15469</link>
      <description>Well, you can't have'em both... &lt;BR /&gt;When you start the .exe using that mechanism, the calling &lt;BR /&gt;application gets blocked, which includes also updating its &lt;BR /&gt;window. These things tend to happen when an application &lt;BR /&gt;invokes a long-lasting process from its main thread... this &lt;BR /&gt;happens for example, to Word during a long AutoSave or &lt;BR /&gt;VisualStudio upon saving a large Workspace. &lt;BR /&gt; &lt;BR /&gt;The "right" way to launch a long-lasting process is to create &lt;BR /&gt;it in a separate thread and to ensure that nothing harmful &lt;BR /&gt;may happen in the calling process (i.e. disable menus, mouse &lt;BR /&gt;actions which may affect the program state etc.), while keeping &lt;BR /&gt;the calling process unblocked.  &lt;BR /&gt; &lt;BR /&gt;Luckily, the QuickWin already has two threads: in the &lt;BR /&gt;"secondary", PROGRAM (and subroutines called from it) are &lt;BR /&gt;executed; in the "primary", mouse and menu clicks are  &lt;BR /&gt;handled, along with window updating (and lot of other things &lt;BR /&gt;hidden beneath the surface). If you put CreateProcess... &lt;BR /&gt;in a, say, menu callback, you block the "primary" thread. &lt;BR /&gt;Instead, define a global flag called, say, "bExecProcess" &lt;BR /&gt;and put something like the following in the endless loop &lt;BR /&gt;at the PROGRAM end: &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt; 
DO WHILE (.TRUE.) 
    IF (bExecProcess) THEN 
        !TODO Disable menus and whatever else necessary here 
        hProcess = CreateProcess... 
        iSt = WaitForSingleObject... 
        bExecProcess = .FALSE. 
    END IF 
END DO 
&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;and, in the menu callback subroutine, just set &lt;BR /&gt;the value of bExecProcess to .TRUE. &lt;BR /&gt; &lt;BR /&gt;HTH &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Tue, 09 Jan 2001 23:47:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Console-painting-over-Quickwin-window/m-p/934146#M15469</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-01-09T23:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Console painting over Quickwin window</title>
      <link>https://community.intel.com/t5/Software-Archive/Console-painting-over-Quickwin-window/m-p/934147#M15470</link>
      <description>Jugoslav,  Yes that was the problem.  I was calling Createprocess from a menu callback function.   Now I only set up some parameters in the callback and call createprocess in the main program. &lt;BR /&gt; &lt;BR /&gt;Your help was much appreciated. &lt;BR /&gt; &lt;BR /&gt;Ed</description>
      <pubDate>Wed, 10 Jan 2001 07:53:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Console-painting-over-Quickwin-window/m-p/934147#M15470</guid>
      <dc:creator>mroczek</dc:creator>
      <dc:date>2001-01-10T07:53:36Z</dc:date>
    </item>
  </channel>
</rss>

