<?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[Speicherleck]]></title><description><![CDATA[<p>Hallo,<br />
ich kontrolliere über ein Timergesteuerte Funktion alle 5 Sekunden ob ein bestimmter Prozess im TAskmanager noch läuft.<br />
Durch diese Aktion wird der verfügbare Speicher immer weniger ...<br />
Kann mir da bitte jemand weiterhelfen ?<br />
Hier die vorgehensweise:</p>
<pre><code class="language-cpp">//SetTimer(1, 5000,NULL) in der OnInitDialog

OnTimer(UINT nTimerID)
{
	ControlProc(&quot;MyExe.exe&quot;);	
}

//Die Funktion:
proc1.dwSize = sizeof(proc1);

	//holen des Handles auf die momentanen Systemprozesse
    hSysSnapshot = CreateToolhelp32Snapshot ( TH32CS_SNAPPROCESS, 0 );

	Process32First(hSysSnapshot,&amp;proc1); 
    proc1.dwSize = sizeof(proc1);
   	 do
	 {
		act_proc_name = proc1.szExeFile;

		if(proc.Compare(act_proc_name) == 0)//proc läuf 
		{
			pid = 1;
		}

    }while(Process32Next(hSysSnapshot,&amp;proc1));

	 if(pid == 0)//proc läuft nicht
	 {
	    WinExec(&quot;My.exe&quot;,1);
	 }
</code></pre>
<p>Wo liegt hier der Fehler ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/74482/speicherleck</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 09:33:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/74482.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 May 2004 08:43:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Speicherleck on Fri, 21 May 2004 08:43:08 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich kontrolliere über ein Timergesteuerte Funktion alle 5 Sekunden ob ein bestimmter Prozess im TAskmanager noch läuft.<br />
Durch diese Aktion wird der verfügbare Speicher immer weniger ...<br />
Kann mir da bitte jemand weiterhelfen ?<br />
Hier die vorgehensweise:</p>
<pre><code class="language-cpp">//SetTimer(1, 5000,NULL) in der OnInitDialog

OnTimer(UINT nTimerID)
{
	ControlProc(&quot;MyExe.exe&quot;);	
}

//Die Funktion:
proc1.dwSize = sizeof(proc1);

	//holen des Handles auf die momentanen Systemprozesse
    hSysSnapshot = CreateToolhelp32Snapshot ( TH32CS_SNAPPROCESS, 0 );

	Process32First(hSysSnapshot,&amp;proc1); 
    proc1.dwSize = sizeof(proc1);
   	 do
	 {
		act_proc_name = proc1.szExeFile;

		if(proc.Compare(act_proc_name) == 0)//proc läuf 
		{
			pid = 1;
		}

    }while(Process32Next(hSysSnapshot,&amp;proc1));

	 if(pid == 0)//proc läuft nicht
	 {
	    WinExec(&quot;My.exe&quot;,1);
	 }
</code></pre>
<p>Wo liegt hier der Fehler ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/524422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/524422</guid><dc:creator><![CDATA[Randy]]></dc:creator><pubDate>Fri, 21 May 2004 08:43:08 GMT</pubDate></item><item><title><![CDATA[Reply to Speicherleck on Sat, 22 May 2004 14:46:14 GMT]]></title><description><![CDATA[<p>CreateToolhelp32Snapshot<br />
To destroy the snapshot, use the CloseHandle function.</p>
<p>wenn die funktion create... heisst solltest du immer auf sowas achten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/525143</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/525143</guid><dc:creator><![CDATA[Sovok]]></dc:creator><pubDate>Sat, 22 May 2004 14:46:14 GMT</pubDate></item></channel></rss>