<?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 Re: key pressing emulation with CreateProces in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985069#M26947</link>
    <description>Jugoslav wrote: &lt;BR /&gt;&amp;gt; 1) Try using WriteConsoleInput-&amp;gt;INPUT_RECORD-&amp;gt;KEY_EVENT_RECORD.  &lt;BR /&gt; &lt;BR /&gt;Yes, I tried that some time ago. The problem is: If I set &lt;BR /&gt;   si%dwFlags = IOR (si%dwFlags, STARTF_USESTDHANDLES), &lt;BR /&gt;that is necessary for the use of StdInput handle, the exe doesn't run &lt;BR /&gt;at all. Maybe it can't write to stdout anymore, or something?  &lt;BR /&gt;Don't know. &lt;BR /&gt; &lt;BR /&gt;And GenerateConsoleCtrlEvent can only create Ctrl-C  &lt;BR /&gt;and Ctrl-BREAK events, not Esc. &lt;BR /&gt; &lt;BR /&gt;Simo</description>
    <pubDate>Fri, 01 Mar 2002 18:14:50 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2002-03-01T18:14:50Z</dc:date>
    <item>
      <title>key pressing emulation with CreateProces</title>
      <link>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985067#M26945</link>
      <description>Dear all,  &lt;BR /&gt;  &lt;BR /&gt;How can I simulate a key press event (Esc) on a console  &lt;BR /&gt;application started using CreateProcess?  &lt;BR /&gt;  &lt;BR /&gt;I have a dll, that calls an .exe  &lt;BR /&gt;(like the fem.exe example discussed previously)  &lt;BR /&gt;I want to limit the run time, by using WaitForSingleObject.  &lt;BR /&gt;Ok, that exe can be stopped nicely by pressing Esc.  &lt;BR /&gt;If I just kill the process, the output file is not finished.  &lt;BR /&gt;  &lt;BR /&gt;How can I "press Esc" from my calling DLL?  &lt;BR /&gt;  &lt;BR /&gt;Simo</description>
      <pubDate>Wed, 27 Feb 2002 23:29:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985067#M26945</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-02-27T23:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: key pressing emulation with CreateProces</title>
      <link>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985068#M26946</link>
      <description>Don't have a finished answer -- just a couple of suggestions:&lt;BR /&gt; &lt;BR /&gt;1) Try using WriteConsoleInput-&amp;gt;INPUT_RECORD-&amp;gt;KEY_EVENT_RECORD. The first argument (hConsoleInput) should come from STARTUPINFO%hStdInput you put into CreateProcess.&lt;BR /&gt; &lt;BR /&gt;2) You may also try GenerateConsoleCtrlEvent.&lt;BR /&gt; &lt;BR /&gt;3) keybd_event may well be the simplest method, although for that to work the console has to have keyboard focus. &lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Thu, 28 Feb 2002 01:48:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985068#M26946</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2002-02-28T01:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: key pressing emulation with CreateProces</title>
      <link>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985069#M26947</link>
      <description>Jugoslav wrote: &lt;BR /&gt;&amp;gt; 1) Try using WriteConsoleInput-&amp;gt;INPUT_RECORD-&amp;gt;KEY_EVENT_RECORD.  &lt;BR /&gt; &lt;BR /&gt;Yes, I tried that some time ago. The problem is: If I set &lt;BR /&gt;   si%dwFlags = IOR (si%dwFlags, STARTF_USESTDHANDLES), &lt;BR /&gt;that is necessary for the use of StdInput handle, the exe doesn't run &lt;BR /&gt;at all. Maybe it can't write to stdout anymore, or something?  &lt;BR /&gt;Don't know. &lt;BR /&gt; &lt;BR /&gt;And GenerateConsoleCtrlEvent can only create Ctrl-C  &lt;BR /&gt;and Ctrl-BREAK events, not Esc. &lt;BR /&gt; &lt;BR /&gt;Simo</description>
      <pubDate>Fri, 01 Mar 2002 18:14:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985069#M26947</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-03-01T18:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: key pressing emulation with CreateProces</title>
      <link>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985070#M26948</link>
      <description>As I said, my answer was based solely on docs -- I thought handles would be &lt;B&gt;returned&lt;/B&gt; even if you don't set STARTF_USESTDHANDLES. If that's not the case, try specifying STARTF_USESTDHANDLES and fill in the members of STARTUPINFO using GetStdHandle (you have to specify bInheritHandles=.TRUE. for CreateProcess).</description>
      <pubDate>Fri, 01 Mar 2002 19:30:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/key-pressing-emulation-with-CreateProces/m-p/985070#M26948</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2002-03-01T19:30:28Z</dc:date>
    </item>
  </channel>
</rss>

