<?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[Ermitteln ob EXE aktiv ist]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes Problem.<br />
Ich möchte das Funktionieren meiner Anwendung_B vom Aktivsein der<br />
Anwendung_A abhängig machen.<br />
Frage: Wie frage ich ab, ob meine *.exe von Anwendung_A aktiv ist (läuft)??</p>
<p>mfg<br />
Traugott</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/112395/ermitteln-ob-exe-aktiv-ist</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 10:12:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/112395.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Jun 2005 09:20:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Sun, 12 Jun 2005 09:20:34 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes Problem.<br />
Ich möchte das Funktionieren meiner Anwendung_B vom Aktivsein der<br />
Anwendung_A abhängig machen.<br />
Frage: Wie frage ich ab, ob meine *.exe von Anwendung_A aktiv ist (läuft)??</p>
<p>mfg<br />
Traugott</p>
]]></description><link>https://www.c-plusplus.net/forum/post/807422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/807422</guid><dc:creator><![CDATA[Traugott]]></dc:creator><pubDate>Sun, 12 Jun 2005 09:20:34 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Sun, 12 Jun 2005 09:25:59 GMT]]></title><description><![CDATA[<p>Ich würde sagen FindWindow() oder per Mutex...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/807426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/807426</guid><dc:creator><![CDATA[Reyx]]></dc:creator><pubDate>Sun, 12 Jun 2005 09:25:59 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Sun, 12 Jun 2005 09:36:47 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Hab schon im Forum (FAQ) gestöbert. Hier finde ich nur Code zum Abschalten einer *.exe.(Pfad vorgegeben)<br />
Ich aber möchte nur Prüfen ob die von mir benannte *.exe aktiv ist oder nicht.<br />
Deshalb wäre es für mich sehr hilfreich, wenn vieleicht ein Codeschnipsel dabei wäre.(oder Link)</p>
<p>mfg<br />
Traugott</p>
]]></description><link>https://www.c-plusplus.net/forum/post/807431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/807431</guid><dc:creator><![CDATA[Traugott]]></dc:creator><pubDate>Sun, 12 Jun 2005 09:36:47 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Sun, 12 Jun 2005 09:44:57 GMT]]></title><description><![CDATA[<p>Das Programm, dass laufen muss:</p>
<pre><code class="language-cpp">// Bei Programmstart
HANDLE kdg_mutex = OpenMutex(MUTEX_ALL_ACCESS, 0, &quot;irgend_eine_ID&quot;);

// Bei Programmende...
ReleaseMutex(kdg_mutex);
</code></pre>
<p>Im Programm, dass prüft, ob das andere gerade aktiv ist:</p>
<pre><code class="language-cpp">HANDLE kdg_mutex = OpenMutex(MUTEX_ALL_ACCESS, 0, &quot;irgend_eine_ID&quot;)

//Wenn Mutex-Handle 1 ist, ist gerade eine Programminstanz aktiv...
if(kdg_mutex)   {
    // Hier was passieren soll, wenn das Programm läuft...
}
</code></pre>
<p>Ist jetzt aber aus'm Kopf, könnten Fehler drin sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/807435</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/807435</guid><dc:creator><![CDATA[Reyx]]></dc:creator><pubDate>Sun, 12 Jun 2005 09:44:57 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Sun, 12 Jun 2005 09:52:10 GMT]]></title><description><![CDATA[<p>Ich wrede es ausprobieren.<br />
Erst einmal Vielen Dank für die Unterstützung.</p>
<p>mfg<br />
Traugott</p>
]]></description><link>https://www.c-plusplus.net/forum/post/807440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/807440</guid><dc:creator><![CDATA[Traugott]]></dc:creator><pubDate>Sun, 12 Jun 2005 09:52:10 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Sun, 12 Jun 2005 10:04:38 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>dazu gibt es bereits in den Builder-Examples ein Control dazu :<br />
&lt;BCB_Path&gt;\Examples\Controls\SingleInst</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/807448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/807448</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 12 Jun 2005 10:04:38 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Sun, 12 Jun 2005 11:31:03 GMT]]></title><description><![CDATA[<p>Wenn ich das richtig verstanden habe und die anderen falsch, dann willst du feststellen, ob ein Fremdprozess läuft, der nicht von dir stammt?<br />
In dem Fall könntest du dir die Prozesse anhand des Dateinamens im System auflisten und schauen, ob der gesuchte dabei ist.</p>
<pre><code class="language-cpp">DWORD GetPidByName(PSTR ProcessName) {
	DWORD PIDs[1024], BytesNeeded, ProcessCount;

	//SetDebugPrivilege();

	if (!EnumProcesses(PIDs,sizeof(PIDs),&amp;BytesNeeded)) {
		return 0;
	}

	ProcessCount = BytesNeeded / sizeof(DWORD);
	BytesNeeded = 0;

	for (UINT i = 0;i&lt;ProcessCount;i++) {
		HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION,false,PIDs[i]);

		if (hProcess != NULL) {
			HMODULE hModule;

			char CurProcessName[MAX_PATH];

			if (EnumProcessModules(hProcess,&amp;hModule,sizeof(hModule),&amp;BytesNeeded) ) {
				if (GetModuleBaseName(hProcess,hModule,CurProcessName, sizeof(CurProcessName) )) {
					if (strcmpi(CurProcessName,ProcessName)==0) {
						CloseHandle (hProcess);
						return PIDs[i];
					}
				}
			}
		}

		CloseHandle(hProcess);
	}
	return 0;
}
</code></pre>
<p>Deklarationen in der psapi.h -&gt; psapi.lib einbinden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/807504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/807504</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Sun, 12 Jun 2005 11:31:03 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Wed, 04 Oct 2006 13:50:53 GMT]]></title><description><![CDATA[<p>Reyx schrieb:</p>
<blockquote>
<p>Das Programm, dass laufen muss:</p>
<pre><code class="language-cpp">// Bei Programmstart
HANDLE kdg_mutex = OpenMutex(MUTEX_ALL_ACCESS, 0, &quot;irgend_eine_ID&quot;);

// Bei Programmende...
ReleaseMutex(kdg_mutex);
</code></pre>
<p>Ist jetzt aber aus'm Kopf, könnten Fehler drin sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
</blockquote>
<p>Wenn ich das so benutze, kommen bei mir folgende Fehler:</p>
<pre><code>[C++ Warnung] Unit1.cpp(21): W8004 'kdg_mutex' wurde ein Wert zugewiesen, der nie verwendet wird
  [C++ Fehler] Unit1.cpp(25): E2451 Undefiniertes Symbol 'kdg_mutex'
</code></pre>
<p>Ich bin damit nicht so vertraut. Muss ich da noch etwas machen?<br />
Danke im Voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149280</guid><dc:creator><![CDATA[Benutzername....]]></dc:creator><pubDate>Wed, 04 Oct 2006 13:50:53 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Wed, 04 Oct 2006 20:04:55 GMT]]></title><description><![CDATA[<p>Hat echt keiner 'ne Ahnung? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149514</guid><dc:creator><![CDATA[Benutzername....]]></dc:creator><pubDate>Wed, 04 Oct 2006 20:04:55 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Wed, 04 Oct 2006 20:18:12 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>die Fehelrmeldung ist doch klar. Du deklarierst zwar kdg_mutex, aber dort wo den Release aufrufst, ist kdg_mutex nicht bekannt. Vermutlich hast du kdg_mutex lokal in eienr Methode deklariert, aber wei ldu den Release in einer anderen aufrufst, must du kdg_mutex stattdesen als Member der Klasse deklarieren.</p>
<p>Ist das nicht der Fall und du findest den Fehler selber nicht, dann poste nochmal genau, in welchem Zusammenhang die beiden Codezeilen stehen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149526</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 04 Oct 2006 20:18:12 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Wed, 04 Oct 2006 21:03:50 GMT]]></title><description><![CDATA[<p>Also jetzt kommt der Fehler nicht mehr. Allerdings funktionierts auch nicht so:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
HANDLE kdg_mutex = OpenMutex(MUTEX_ALL_ACCESS, 0, &quot;123&quot;);
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
ReleaseMutex(kdg_mutex);
}
//---------------------------------------------------------------------------
</code></pre>
<pre><code>Programm das überprüft werden soll.
</code></pre>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
HANDLE kdg_mutex = OpenMutex(MUTEX_ALL_ACCESS, 0, &quot;123&quot;);
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{

//Wenn Mutex-Handle 1 ist, ist gerade eine Programminstanz aktiv...
if(kdg_mutex)
  {
  ShowMessage(&quot;Opened&quot;);
  }
}
//---------------------------------------------------------------------------
</code></pre>
<pre><code>Programm das überprüft.
</code></pre>
<p>Das überprüfende Programm gibt nie die Meldung aus (ShowMessage), egal ob das erste Programm geöffnet ist oder nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149552</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149552</guid><dc:creator><![CDATA[Benutzername....]]></dc:creator><pubDate>Wed, 04 Oct 2006 21:03:50 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 04:36:08 GMT]]></title><description><![CDATA[<p><a href="http://www.marquardtnet.info/cecke/quickies.1/1_quicky_19.html" rel="nofollow">http://www.marquardtnet.info/cecke/quickies.1/1_quicky_19.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149618</guid><dc:creator><![CDATA[Christian411]]></dc:creator><pubDate>Thu, 05 Oct 2006 04:36:08 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 13:20:05 GMT]]></title><description><![CDATA[<p>Aber da wird erklärt wie man verhindert das ein Programm 2x geöffnet wird.<br />
Aber ich will eigentlich wissen wie man &quot;ermittelt ob eine EXE Datei geöffnet ist&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149921</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149921</guid><dc:creator><![CDATA[Benutzername....]]></dc:creator><pubDate>Thu, 05 Oct 2006 13:20:05 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 13:57:59 GMT]]></title><description><![CDATA[<blockquote>
<p>Aber da wird erklärt wie man verhindert das ein Programm 2x geöffnet wird.</p>
</blockquote>
<p>Damit wird auch doch irgendwie geklärt, ob ein Programm schon läuft. Ob du dann nun einen weiteren Start verhinderst oder sonstewas machst......</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149947</guid><dc:creator><![CDATA[Christian411]]></dc:creator><pubDate>Thu, 05 Oct 2006 13:57:59 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 15:16:34 GMT]]></title><description><![CDATA[<p>Achso ja Sorry hab ein Problem mit logischem Denken hehe<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150001</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150001</guid><dc:creator><![CDATA[Benutzername....]]></dc:creator><pubDate>Thu, 05 Oct 2006 15:16:34 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 15:39:19 GMT]]></title><description><![CDATA[<p>OK jetzt läuft es soweit...<br />
Allerdings ein Problem.</p>
<p>Programm1 (Ausgeführtes)<br />
Programm2 (Überprüfendes)</p>
<p>1. Erst mache ich Programm1 an, dann Programm2. Programm2 meldet das Programm1 bereits läuft. OK soweit. Wenn ich jetzt Programm1 schließe und Programm2 nochmal überprüfen lasse, wird immer noch gemeldet das Programm1 läuft.</p>
<p>2. Erst starte ich Programm2 und lasse überprüfen, keine Fehlermeldung. Dann starte ich Programm1 und lasse wieder überprüfen, das Programm meldet dass Programm1 läuft. Wenn ich Programm1 schließe wieder der selbe Fehler von Punkt1.</p>
<p>Programm1:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
HANDLE hMutex=OpenMutex(MUTEX_ALL_ACCESS,0,&quot;MeinProgramm&quot;);
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
ReleaseMutex(hMutex);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
if(!hMutex)
  {
  hMutex=CreateMutex(0,0,&quot;MeinProgramm&quot;);
  }
else
  {
  ShowMessage(&quot;Das Programm läuft bereits&quot;);	
  }
}
//---------------------------------------------------------------------------
</code></pre>
<p>Programm2:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
HANDLE hMutex=OpenMutex(MUTEX_ALL_ACCESS,0,&quot;MeinProgramm&quot;);
if(!hMutex)
  {
  ReleaseMutex(hMutex);
  }
else
  {
  ShowMessage(&quot;Das Programm läuft bereits&quot;);
  ReleaseMutex(hMutex);	
  }
}
//---------------------------------------------------------------------------
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1150016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150016</guid><dc:creator><![CDATA[Benutzername....]]></dc:creator><pubDate>Thu, 05 Oct 2006 15:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 16:22:34 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ich kann deinen Quellcode jetzt nicht testen, weil ich keinen Builder habe.<br />
Aber CreateMutex und ReleaseMutex sollten besser in dem Konstruktor bzw. dem Destruktor des Forms stehen, und <em>HANDLE hMutex</em> sollte ein Member des Forms sein (also im Header des Forms nach private deklarieren).</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150033</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 05 Oct 2006 16:22:34 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 16:46:10 GMT]]></title><description><![CDATA[<p>Danke akari, kannst du (oder jemand anderes) mir noch sagen was Konstruktor und Destruktor bedeutet? Oder wo ich das finde?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150037</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150037</guid><dc:creator><![CDATA[Benutzername....]]></dc:creator><pubDate>Thu, 05 Oct 2006 16:46:10 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 17:06:21 GMT]]></title><description><![CDATA[<p>Konstuktor:</p>
<pre><code class="language-cpp">__fastcall TForm1::TForm1(TComponent* Owner) 
        : TForm(Owner) 
{ 
} 
//---------------------------------------------------------------------------
</code></pre>
<p>besser ist aber das TForm Event <strong>OnCreat</strong>.</p>
<p>Destruktor:<br />
ist ist das TForm Event <strong>OnDestroy</strong><br />
kannst du im Objektinspektor für TForm doppelt klicken.<br />
Ok stimmt nicht ganz da der Destruktor danach kommt.<br />
Den Destruktor würde ich nicht überschreiben!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150044</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150044</guid><dc:creator><![CDATA[dlonra]]></dc:creator><pubDate>Thu, 05 Oct 2006 17:06:21 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 17:07:45 GMT]]></title><description><![CDATA[<p>Hallo</p>
<blockquote>
<p>besser ist aber das TForm Event OnCreat.</p>
</blockquote>
<p>Falsch. Genausowenig wie OnDestroy besser als der Destruktor sein soll. Das gegenteil ist der Fall, die Begründung hatten wir schon ein paar mal in verschiedenen Threads dieses Forums.</p>
<blockquote>
<p>Danke akari, kannst du (oder jemand anderes) mir noch sagen was Konstruktor und Destruktor bedeutet? Oder wo ich das finde?</p>
</blockquote>
<p>Lies gleich ein ganzes <a href="http://tutorial.schornboeck.net/oop.htm" rel="nofollow">Tutorial</a> zum Thema OOP, denn du wirst es noch brauchen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150050</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 05 Oct 2006 17:07:45 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 18:14:49 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-160149-and-highlight-is-%2Aoncreat%2A.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-160149-and-highlight-is-%2Aoncreat%2A.html</a></p>
<p>Link von Braustein führt zu einem englischen Forum.<br />
Die Aussage dort ist mir neu:</p>
<p>Ok, so let's summarize the most important reason why OnCreate is<br />
dangerous: because it could execute before your constructor executes<br />
and before any member objects have been initialized. In C++, it is<br />
generally mandated that a base class constructor should not be able to<br />
call the member functions of a derived class. OnCreate violates<br />
this. OnDestroy does too, but during destruction.</p>
<p>Meine Frage ist jetzt, wie ich den Destruktor der Form einbaue?<br />
etwa so:</p>
<p>Beispiel:</p>
<p>unit1.h</p>
<pre><code class="language-cpp">private:
__fastcall TForm1::TForm1(TComponent* Owner): TForm(Owner);
 ~Form1();
 TGraphics::TBitmap *hallo;
</code></pre>
<p>unit.cpp</p>
<pre><code class="language-cpp">__fastcall TForm1::TForm1(TComponent* Owner) 
        : TForm(Owner) 
{ 
 hallo=new TGraphics::TBitmap();
} 
//--------------------------------------------------------------------------- 
~Form1()
{
 delete hallo;
}
</code></pre>
<p>wäre das so richtig?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150111</guid><dc:creator><![CDATA[dlonra]]></dc:creator><pubDate>Thu, 05 Oct 2006 18:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 20:16:25 GMT]]></title><description><![CDATA[<p>Bitte die Faustregel beachten: ein Thema ein Thread, ein Thread ein Thema. Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150196</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150196</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Thu, 05 Oct 2006 20:16:25 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 20:27:12 GMT]]></title><description><![CDATA[<p>Geht sowas auch indem man prüft, ob z.B. ABC.EXE in den ausgeführten Prozessen steht? Wenn ja, wie prüft man dies?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150205</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150205</guid><dc:creator><![CDATA[Feyo-Su]]></dc:creator><pubDate>Thu, 05 Oct 2006 20:27:12 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 20:42:06 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>dlonra schrieb:</p>
<blockquote>
<p>Meine Frage ist jetzt, wie ich den Destruktor der Form einbaue?<br />
etwa so:</p>
</blockquote>
<p>ja, Syntax und Anwendung von Destruktor und Konstruktor sind in Ordnung.<br />
Wenn du aber schon mal dabei bist, dann mach es gleich richtig und benutzt die <em>Initialisierungsliste</em></p>
<pre><code class="language-cpp">__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner), hallo(new TGraphics::TBitmap())
{
}
</code></pre>
<p>Aber nun back to Topic.</p>
<p>Feyo-Su schrieb:</p>
<blockquote>
<p>Geht sowas auch indem man prüft, ob z.B. ABC.EXE in den ausgeführten Prozessen steht? Wenn ja, wie prüft man dies?</p>
</blockquote>
<p>Ja das geht auch, mit der WinAPI-Funktion FindWindow.<br />
Allerdings ist das etwas unsauberer, mit den Mutexten geht das sicherer.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150212</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150212</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 05 Oct 2006 20:42:06 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 21:16:16 GMT]]></title><description><![CDATA[<p>Habe mal über Google bisschen gesucht, nachdem ich in der BCB Hilfe nichts gefunden hatte. Aber ich finde keine Seite wo steht wie man FindWindow benutzt. Hat vielleicht jemand gerade einen Link dazu, oder kanns selber erklären? Danke scho'ma</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150231</guid><dc:creator><![CDATA[Feyo-Su]]></dc:creator><pubDate>Thu, 05 Oct 2006 21:16:16 GMT</pubDate></item><item><title><![CDATA[Reply to Ermitteln ob EXE aktiv ist on Thu, 05 Oct 2006 23:00:25 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>hier hab ich ein Beispiel für FindWindow gefunden. So wie es aussieht muss dieser Code in die Projekt.cpp rein.</p>
<p><a href="http://www.bcb-box.de/Informationen/Laeuftschon/laeuftschon.html" rel="nofollow">http://www.bcb-box.de/Informationen/Laeuftschon/laeuftschon.html</a></p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>auch interessante Schnippsel<br />
<a href="http://www.bcb-box.de/Informationen/informationen.html" rel="nofollow">http://www.bcb-box.de/Informationen/informationen.html</a><br />
Grüsse</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1150256</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1150256</guid><dc:creator><![CDATA[dlonra]]></dc:creator><pubDate>Thu, 05 Oct 2006 23:00:25 GMT</pubDate></item></channel></rss>