<?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[Automatisches schließen von Programmen(Problem)]]></title><description><![CDATA[<p>Also ich hab ein kleines Problem und hoffe ihr könnt mir weiterhelfen,<br />
ich habe ein Programm geschrieben, das andere Programme schließen soll doch es funktionier leider nicht.</p>
<pre><code class="language-cpp">#include &quot;windows.h&quot;
#include &quot;time.h&quot;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	time_t Zeitstempel;
    tm * nun;
    Zeitstempel = time(0);
    nun = localtime(&amp;Zeitstempel);

	HWND hWnd;

	int min = 0;
	int hou = 0;

	while(true)
	{
		hWnd = FindWindow(NULL, static_cast&lt;LPCSTR&gt;(&quot;Unbenannt - Editor&quot;));

		if(hWnd)
		{
			min = nun-&gt;tm_min;
			hou = nun-&gt;tm_hour;

			while((hou) == nun-&gt;tm_hour &amp;&amp; (min + 1) == nun-&gt;tm_min)
			{
				if(!hWnd)
					continue;
				else
				{
					SendMessage(hWnd, WM_CLOSE, NULL, NULL);
					MessageBox(NULL, static_cast&lt;LPCSTR&gt;(&quot;Programm beendet&quot;), static_cast&lt;LPCSTR&gt;(&quot;Achtung&quot;), NULL);
				}
			}
		}
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/240734/automatisches-schließen-von-programmen-problem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 05:46:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/240734.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 May 2009 20:24:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Sun, 10 May 2009 20:24:57 GMT]]></title><description><![CDATA[<p>Also ich hab ein kleines Problem und hoffe ihr könnt mir weiterhelfen,<br />
ich habe ein Programm geschrieben, das andere Programme schließen soll doch es funktionier leider nicht.</p>
<pre><code class="language-cpp">#include &quot;windows.h&quot;
#include &quot;time.h&quot;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	time_t Zeitstempel;
    tm * nun;
    Zeitstempel = time(0);
    nun = localtime(&amp;Zeitstempel);

	HWND hWnd;

	int min = 0;
	int hou = 0;

	while(true)
	{
		hWnd = FindWindow(NULL, static_cast&lt;LPCSTR&gt;(&quot;Unbenannt - Editor&quot;));

		if(hWnd)
		{
			min = nun-&gt;tm_min;
			hou = nun-&gt;tm_hour;

			while((hou) == nun-&gt;tm_hour &amp;&amp; (min + 1) == nun-&gt;tm_min)
			{
				if(!hWnd)
					continue;
				else
				{
					SendMessage(hWnd, WM_CLOSE, NULL, NULL);
					MessageBox(NULL, static_cast&lt;LPCSTR&gt;(&quot;Programm beendet&quot;), static_cast&lt;LPCSTR&gt;(&quot;Achtung&quot;), NULL);
				}
			}
		}
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1708693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708693</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 10 May 2009 20:24:57 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Sun, 10 May 2009 21:18:06 GMT]]></title><description><![CDATA[<p>hab es schon gelöst nicht perfekt aber es funktioniert</p>
<pre><code class="language-cpp">#include &quot;windows.h&quot;
#include &quot;time.h&quot;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	HWND hWnd;

	time_t Zeit;
	tm * nun;
	Zeit = time(0);
	nun = localtime(&amp;Zeit);

	int min = 0;
	int hou = 0;

	while(true)
	{
		hWnd = FindWindow(NULL, static_cast&lt;LPCSTR&gt;(&quot;Unbenannt - Editor&quot;));

			if(hWnd)
			{
			min = nun-&gt;tm_min;
			hou = nun-&gt;tm_hour;
			}

			while(hWnd)
			{
				Zeit = time(0);
				nun = localtime(&amp;Zeit);

				if(nun-&gt;tm_hour &gt;= (hou) &amp;&amp; nun-&gt;tm_min &gt;= (min + 1))
				{
				SendMessage(hWnd, WM_CLOSE, NULL, NULL);
				MessageBox(NULL, static_cast&lt;LPCSTR&gt;(&quot;Programm beendet&quot;), static_cast&lt;LPCSTR&gt;(&quot;Achtung&quot;), NULL);
				hWnd = 0;
				}
			}

	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1708717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708717</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 10 May 2009 21:18:06 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 06:00:18 GMT]]></title><description><![CDATA[<p>Was sollen denn die &quot;static_cast&lt;LPCSTR&gt;&quot; in Deinem Code!?<br />
Ersetze das lieber mal durch _T...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1708765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708765</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 11 May 2009 06:00:18 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 11:15:47 GMT]]></title><description><![CDATA[<p>Visual C++ Express meckert dann rum wenn ich es mit L versuche</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1708903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708903</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 11 May 2009 11:15:47 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 11:24:19 GMT]]></title><description><![CDATA[<p>Da es sich um ein String Literal handelt musst Du, wie von Martin schon erwähnt, _T(&quot;&quot;) benutzen. Dein Projekt ist offensichtlich nicht Unicode, desshalb funktioniert auch L&quot;&quot; nicht.</p>
<p>Simon</p>
<p>Edit: Hast Du eigentlich Martins Post gar nicht gelesen???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1708908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708908</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Mon, 11 May 2009 11:24:19 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 11:32:53 GMT]]></title><description><![CDATA[<p>Doch hab mein Projekt jetzt auf UNICODE umgeschalten und es wieder mit L versucht funktioniert einwandfrei <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>
<p>Außerdem wollte ich wissen wie man ein Fenster, ohne den Fensternamen zu wissen, in HWND einbinden kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1708911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708911</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 11 May 2009 11:32:53 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 13:00:49 GMT]]></title><description><![CDATA[<p>andrewla1990 schrieb:</p>
<blockquote>
<p>Doch hab mein Projekt jetzt auf UNICODE umgeschalten und es wieder mit L versucht</p>
</blockquote>
<p>Warum machst Du das, wenn Dir hier zweimal empfohlen wird, _T(&quot;&quot;) zu benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1708975</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708975</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Mon, 11 May 2009 13:00:49 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 13:23:50 GMT]]></title><description><![CDATA[<p>_T() ist schirch.<br />
Verwende keinen Unicode und fertig. Braucht man eh meist nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1708994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1708994</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Mon, 11 May 2009 13:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 17:54:58 GMT]]></title><description><![CDATA[<p>unicode is bei solchen programmen (und bei fast allen anderen die keine<br />
textverarbtung haben) käse, MessageBoxA und ruhe is. ohne optionen ändern</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1709122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1709122</guid><dc:creator><![CDATA[aber echt]]></dc:creator><pubDate>Mon, 11 May 2009 17:54:58 GMT</pubDate></item><item><title><![CDATA[Reply to Automatisches schließen von Programmen(Problem) on Mon, 11 May 2009 20:48:59 GMT]]></title><description><![CDATA[<p>hab das mit _T(&quot;&quot;) schon probiert, es funktionieren alle varianten und ich kenne keine vor oder nachteile bei einer dieser lösungen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1709195</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1709195</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 11 May 2009 20:48:59 GMT</pubDate></item></channel></rss>