<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mitbekommen, wenn Anwendung beendet]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe ein kleines Problem. Ich habe mir untensethenden Code aus Forenbeiträgen zusammengezimmert. Es soll eine Andwendung starten und warten bis diese beendet ist. Ich habe gelesen, dass hProcess das mitteilen kann. Bei mit ist diese Variable aber immer 0x0000. Obwohl das Starten eines Programms funktionert.</p>
<p>Hoffe ihr könnt mir helfen wie ich das abfrage..</p>
<p>Gruß Filou</p>
<pre><code class="language-cpp">DWORD dWait;
	BOOL bCheck = FALSE;
	SHELLEXECUTEINFO App = {0};

//	App=(SHELLEXECUTEINFO*)malloc( sizeof(SHELLEXECUTEINFO) ); COMPILER: = kein operator definiert
    App.cbSize = sizeof(SHELLEXECUTEINFO);
    App.fMask = SEE_MASK_NOCLOSEPROCESS; 
//  App.hwnd = GetActiveWindow(); COMPILER: kann nicht in HWND__* kovertiert werden
    App.lpVerb = &quot;open&quot;; 
    App.lpFile = &quot;Scannen.doc&quot;; 
    App.lpDirectory = &quot;D:\\dave\\vorlage\\&quot;; 
    App.nShow = SW_SHOWNORMAL; 

	//Anwendung starten
    if ( ! ShellExecuteEx(&amp;App)) 
		{ 
        MessageBox(&quot;Anwendungsfehler: Die Prozessinitialisierung ist fehlgeschlagen.\nMöglicherweise wurde die Konfigurationsdatei zum Scannen von Dokumenten beschädigt.\n\nFehler: ShellExecuteEx:hProcess = NULL&quot;,&quot;Anwendungsfehler&quot;,MB_ICONSTOP); 
		this-&gt;EndDialog(0);
	    } 
	else
		{ 
		while(bCheck == FALSE)
			{
			dWait = WaitForSingleObject(App.hProcess,1000);//hProcess ist immer 0x00000
			if (dWait == NULL)
				{
				bCheck = TRUE;
				}
			Sleep(2000);
			}

		}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/170678/mitbekommen-wenn-anwendung-beendet</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 03:44:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/170678.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Jan 2007 14:03:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mitbekommen, wenn Anwendung beendet on Thu, 18 Jan 2007 14:03:17 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe ein kleines Problem. Ich habe mir untensethenden Code aus Forenbeiträgen zusammengezimmert. Es soll eine Andwendung starten und warten bis diese beendet ist. Ich habe gelesen, dass hProcess das mitteilen kann. Bei mit ist diese Variable aber immer 0x0000. Obwohl das Starten eines Programms funktionert.</p>
<p>Hoffe ihr könnt mir helfen wie ich das abfrage..</p>
<p>Gruß Filou</p>
<pre><code class="language-cpp">DWORD dWait;
	BOOL bCheck = FALSE;
	SHELLEXECUTEINFO App = {0};

//	App=(SHELLEXECUTEINFO*)malloc( sizeof(SHELLEXECUTEINFO) ); COMPILER: = kein operator definiert
    App.cbSize = sizeof(SHELLEXECUTEINFO);
    App.fMask = SEE_MASK_NOCLOSEPROCESS; 
//  App.hwnd = GetActiveWindow(); COMPILER: kann nicht in HWND__* kovertiert werden
    App.lpVerb = &quot;open&quot;; 
    App.lpFile = &quot;Scannen.doc&quot;; 
    App.lpDirectory = &quot;D:\\dave\\vorlage\\&quot;; 
    App.nShow = SW_SHOWNORMAL; 

	//Anwendung starten
    if ( ! ShellExecuteEx(&amp;App)) 
		{ 
        MessageBox(&quot;Anwendungsfehler: Die Prozessinitialisierung ist fehlgeschlagen.\nMöglicherweise wurde die Konfigurationsdatei zum Scannen von Dokumenten beschädigt.\n\nFehler: ShellExecuteEx:hProcess = NULL&quot;,&quot;Anwendungsfehler&quot;,MB_ICONSTOP); 
		this-&gt;EndDialog(0);
	    } 
	else
		{ 
		while(bCheck == FALSE)
			{
			dWait = WaitForSingleObject(App.hProcess,1000);//hProcess ist immer 0x00000
			if (dWait == NULL)
				{
				bCheck = TRUE;
				}
			Sleep(2000);
			}

		}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1212051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212051</guid><dc:creator><![CDATA[Filou204]]></dc:creator><pubDate>Thu, 18 Jan 2007 14:03:17 GMT</pubDate></item><item><title><![CDATA[Reply to Mitbekommen, wenn Anwendung beendet on Thu, 18 Jan 2007 14:47:32 GMT]]></title><description><![CDATA[<p>In diesem Fall wird Word über eine DDE Verbindung gestartet und geöffent. Hier tritt die dokumentierte Einschränkung auf:</p>
<p>&lt;zitat&gt;<br />
In some cases, such as when execution is satisfied through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle when it is no longer needed.<br />
&lt;/zitat&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1212087</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212087</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 18 Jan 2007 14:47:32 GMT</pubDate></item><item><title><![CDATA[Reply to Mitbekommen, wenn Anwendung beendet on Fri, 19 Jan 2007 07:20:48 GMT]]></title><description><![CDATA[<p>Danke für die Antwort.<br />
Also gibt es keine Möglichkeit Mitzubekommen wenn die Word-Datei beendet wird?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1212421</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212421</guid><dc:creator><![CDATA[Filou204]]></dc:creator><pubDate>Fri, 19 Jan 2007 07:20:48 GMT</pubDate></item><item><title><![CDATA[Reply to Mitbekommen, wenn Anwendung beendet on Fri, 19 Jan 2007 07:45:00 GMT]]></title><description><![CDATA[<p>So sollte das gehen</p>
<pre><code class="language-cpp">CWnd wnd= FindWindow(NULL,&quot;Scannen.doc - Microsoft Word&quot;);
	if (wnd)
	{
                 // mach was
         }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1212428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212428</guid><dc:creator><![CDATA[DaDings]]></dc:creator><pubDate>Fri, 19 Jan 2007 07:45:00 GMT</pubDate></item><item><title><![CDATA[Reply to Mitbekommen, wenn Anwendung beendet on Fri, 19 Jan 2007 08:06:16 GMT]]></title><description><![CDATA[<p>Nur eine Idee:<br />
Du könntest über die OLE-Automation arbeiten. Dann könntest Du das entsprechende Objekt anbieten. Wird das Dokument vom User geschlossen, dann wird IMHO das Visible Flag entfernt, der Objekt Zeiger auf das Dokument bei Dir bleibt gültig. Wenn Du also regelmässig auf Visible pollst könnte das eine Lösung sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1212440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212440</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 19 Jan 2007 08:06:16 GMT</pubDate></item><item><title><![CDATA[Reply to Mitbekommen, wenn Anwendung beendet on Fri, 19 Jan 2007 08:10:33 GMT]]></title><description><![CDATA[<p>Das &quot;Scannen.doc&quot; ist ein Makro welches den Scanner ansteuert, ein Dokument scannt, speichert und Word beendet.</p>
<p>Mit FindWindow hat es geklappt. Vielen Dank Euch allen!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1212442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212442</guid><dc:creator><![CDATA[Filou204]]></dc:creator><pubDate>Fri, 19 Jan 2007 08:10:33 GMT</pubDate></item></channel></rss>